Directly exporting rule-based count results in QGIS

Question: I have hundreds of rules specifying ranges of polygon areas. I would like to create a table of the ranges and their values outside of QGIS and since these results are exactly what I am after I would like to export them directly from the layer properties here. I know there are tools like statistics by category which are useful but it would be far easier and quicker if I could simply use these count results directly.
Comment: Just label and rule, or all table including count, duplicate count?
Comment: Thanks, I am after the rule and count.
Answer: You can access the filter expression of each rule with this script. Copy-paste it to the script editor of the Python console and click Run
Make sure the layer is selected in the Layers Panel, and that it is not in edit mode, else the filter will not be applied.
# get layer
lyr = iface.activeLayer()

# get the rule-based rendered from the layer
r = lyr.renderer()

# get the root rule
root = r.rootRule()

# iterate through rules
for rule in root.children():
    # get the rule filter expression
    exp = rule.filterExpression()

    # set the rule filter on the layer
    lyr.setSubsetString(exp)

    # count filtered features
    count = lyr.featureCount()

    # reset the filter
    lyr.setSubsetString('')

    print(f'rule: {exp} | count: {count}')

    ## do something with rules (save to text file)

Output:
rule: "code" = 'A' | count: 12425
rule: "code" = 'B' | count: 12580
rule: "code" = 'C' | count: 12298
rule: "code" = 'D' | count: 12618
rule: "code" = 'E' | count: 12534
rule: "code" = 'F' | count: 12441

Answer: To elaborate on my other answer, and with the help of this excellent answer by Ben W, I came up with a script to save the rules, counts, and symbology to an Excel spreadsheet.
It relies on one non-native library, XlsxWriter. The easiest way to install it is to open the OsGeo4W shell (via the Start Menu on Windows) and use:
pip install XlsxWriter

Then run the script in the Script Editor in the QGIS Python console.
import os
import xlsxwriter
from io import BytesIO

# path to save images
IMG_PATH = r'D:\OneDrive\geodata\symbols'

# path to save the spreadsheet
EXPORT_PATH = r'D:\OneDrive\geodata\rules.xlsx'

workbook = xlsxwriter.Workbook(EXPORT_PATH)
worksheet = workbook.add_worksheet()

def convert_icon(icon, size=None, fmt='PNG'):
    '''
    This function modified from:
    https://stackoverflow.com/questions/40789856/python-convert-qt-qicon-into-jpeg
    Credit: stackoverflow member ekhumoro
    '''
    if size is None:
        size = 18
    pixmap = QPixmap.fromImage(icon)
    pixmap = pixmap.scaledToWidth(size)

    array = QtCore.QByteArray()
    buffer = QtCore.QBuffer(array)
    buffer.open(QtCore.QIODevice.WriteOnly)
    pixmap.save(buffer, fmt)
    buffer.close()
    return array.data()

# write the spreadsheet headers
worksheet.write('A1', 'symbol')
worksheet.write('B1', 'label')
worksheet.write('C1', 'rule')
worksheet.write('D1', 'count')

# get layer
lyr = iface.activeLayer()

# get the rule-based rendered from the layer
r = lyr.renderer()

# get the root rule
root = r.rootRule()

# set the spreadsheet row to enter data
sheet_row = 2

# iterate through rules
for rule in root.children():

    # get various attributes from rule
    sym = rule.symbol()
    lab = rule.label()
    exp = rule.filterExpression()

    # set the rule filter on the layer
    lyr.setSubsetString(exp)
    # count filtered features
    count = lyr.featureCount()
    # reset the filter
    lyr.setSubsetString('')

    # get rule symbol as image
    img = sym.asImage(QSize(40,40))

    # optionally save symbols as png
    img.save(
        os.path.join(
            IMG_PATH,
            (exp.replace('<=', 'lte')
                .replace('>=', 'gte')
                .replace('<>', 'not')
                .replace('<', 'lt')
                .replace('>', 'gt')
                .replace('=', 'eq')
                .replace('.', '_')
                .replace('"','')
                .replace("'", '') + '.png')
        )
    )

    # convert QImage to QByteArray
    img_data = convert_icon(img)

    # convert to BytesIO object
    io_data = BytesIO(img_data)

    # assign cells for data
    icon_cell  = f'A{sheet_row}'
    label_cell = f'B{sheet_row}'
    rule_cell  = f'C{sheet_row}'
    count_cell = f'D{sheet_row}'

    # insert symbol and corresponding data into cells
    worksheet.insert_image(icon_cell, 'image.png', {'image_data': io_data, 'x_offset': 15, 'y_offset': 3})
    worksheet.write(label_cell, lab)
    worksheet.write(rule_cell, exp)
    worksheet.write(count_cell, count)

    # set the width of specific columns to accommodate data
    worksheet.set_column('B:B', 20)
    worksheet.set_column('C:C', 40)

    # go to next row of spreadsheet
    sheet_row+=1

# commit the changes to the workbook
workbook.close()

The spreadsheet:

The saved image files:
Comment: Thanks Matt, this looks fantastic. Unfortunately I'm having trouble running the script. I seem to have successfully installed xlsxwriter (ran pip.main(['install','XlsxWriter']) in the python console and output said successfully installed), then when I run the script it fails at the beginning with ModuleNotFoundError: No module named 'xlsxwriter' (I can't paste the output here as it goes over character limit).
Comment: [Ben details a few ways](https://gis.stackexchange.com/a/422305/128665) to install the module in his answer. I found the easiest way was through the OsGeo4W shell (see update to my answer). Is it a requirement that it must be installed via the script?
Comment: I tried first through OsGeo4W shell as Ben writes but doing that I got the error msg it is not recognized as an internal or external command, etc.

I looked for other ways and found that the command python -m pip install XlsxWriter worked.

I don't know if it has to be installed via a script, it would be good if there was perhaps another way (I haven't so far found one).
Comment: Unfortunately, I cannot reproduce your issue, as using OsGeo4W shell works fine for me. I just tried with another library (`flickrapi`) and I can import it in the QGIS Python console directly after `pip install flickrapi` in the OsGeo4W shell.
Comment: Thanks Matt, got it up and running! What if there was another level of rules and counts within the rules ie. children of children, could that be shown as well?


How to deal with the difference in the range of Dependent variable in Train and Test data

Question: I am training a XGBoost model for predicting number of applications and the minimum number of applications in training data is 40 and the maximum number of applications is 2000, while in test set minimum number of applications in training data is 400 and the maximum number of applications is 800. Hence the model is getting confused while predicting the value.
Any suggestions on how should I solve this issue?
Answer: The assumption in supervised ML is that the test set follows the same distribution as the training set. It's clear from your description that this assumption is not satisfied in your data, so it's not very surprising that things don't work well. Beyond the difference in the range of the dependent variable, if the training and test set have been collected independently it's likely that the distributions of the features also differ.
So how to fix this depends on the goal of the task and in particular why the test set and training set don't follow the same distribution:

If the difference is not meaningful, i.e. there is no reason to assume that real production data would be different than the training set, then the experiment should be redone after properly randomizing the split between training and test set.
If the difference is meaningful, i.e. the test set is purposefully different from the training set because the production data will also be different, then the setup should be redesigned to account for that. For example there could be a step of semi-supervised learning on the test set, which would adapt the model to the new data distribution while leveraging the information from the training data.
Answer: You can try transforming the target using MixMaxScaler so that both train and test set's target is between 0 and 1.
from from xgb import XGBRegressor
from sklearn.compose import TransformedTargetRegressor
from sklearn.metrics import r2_score
from sklearn.preprocessing import MinMaxScaler

regressor = XGBRegressor()

model = TransformedTargetRegressor(regressor= regressor,
                                        transformer = MinMaxScaler()
                                        ).fit(trainX,trainY)

pred = model.predict(testX)
print(pred)

Comment: Hey it's not working. Thanks for the help though


Hyundai can't remove key

Question: When switching car off unable to get key from the switch. The switch will not go past acc. point. Remove  battery ground cable then able to switch to lock position and  remove key.
Answer: Hyundai makes lots of different models. Do a search for shift interlock problems on your year, make, model. That's what the system is called.

Hyundai can't remove key


How do you run a membership/event report?

Question: To be considered a 'voting' member in our organization, you have to be an active member, and also have attended a certain number of events in the past year. I see how to run a membership report, and I see how to run an event report, but how can I search for 'active member' AND 'attended 3 events in the last 12 months'?
Answer: There are several answers to this; I'll give you three!  Use whichever works best for you.
Note that I originally thought that either Summary Fields or Event Count custom search extensions would be part of this solution, but neither can count only events in the last 12 months without modification.
Easy, best for now
Search for active members.  Add them to a group.  Run the event report, filtering by the Active Member group.  If you need to run this report regularly, the Active Member group should be a smart group.
Coming soon
There's an alpha version of the Search overhaul that ships (disabled and hidden) in CiviCRM 5.28 (which released three days ago).  This will allow doing searches like you describe in a single search pretty easily.
Comment: Thank you very much. I will use the easy option for now, and track the search overhaul as it matures! Thank you Jon.


Prove that a graph on $n$ vertices with $c$ components has at least $n-c$ edges.

Question: My question is about graph theory. Prove that a graph on $n$ vertices with $c$ components has at least $n-c$ edges.
Answer: Suppose your graph has $c$ conected componentes, each with $n_1$, $n_2$, $\ldots$, $n_c$ vertices. Your graph as a whole has $n=n_1+n_2+\ldots+n_c$ vertices. Supose the components are conected by the fewest edges posibles. Any set of $k$ vertices can be conected by just $k-1$ vertices, as in path graphs, $K_{1,k-1}$ bipartite graphs, and so on; so the $i$-th component of your graph can be conected with at least $n_i-1$ edges. The sum of these numbers gives you a lower bound for the number of edges in the whole graph: $$\sum^{c}_{i=1}(n_i-1) =n_1+n_2+\ldots+n_c-c=n-c.$$
Answer: First we prove that if $c = 1$ (if the graph is connected) we have at least $n - 1$ edges.
A simple path with $n$ vertices has $n - 1$ edges, thus it's possible.
If $\delta \geq 2$, then we have at least $n$ edges, thus there is a node with $\delta = 1$. use induction on other vertices, so you have at least $n-2$ edges on other vertices of the graph and $n - 1$ edges on all vertices of the graph.
Now, we have $c$ connected components with $a_i$ vertices on $i^{th}$ component. thus we have at least $\Sigma_{i = 1}^c (a_i - 1) = n - c$


Source of Pingbacks

Question: I've replaced the default comments in WordPress with Facebook Comments plugin.
But I'm still getting comments in the form of Pingbacks my in wp-admin > Comments (http://mydomain.com/wp-admin/edit-comments.php).
How can I know the source of these pingbacks ?
Comment: Do you mean what site they're coming from? How to disable them? Where in the code they're stored? How they work?
Comment: Yes - "what site they're coming from" - The source of the Pingbacks.
Answer: Not long ago I did a talk on v3.5 and posted a link to my blogpost on the company site, resulting in a pingback/trackback.
Going to the comments page I can see this:

As you can see, the title of the referring page and the link to it ( the source ) are in the first column, and the post linked to on the right

Source of Pingbacks


Shading issues on the edges when using bevel and subdivision surface modifier

Question: Using Blender 3.5. I am modelling this rook chess piece and having some weird shading issues. Here, in the image, the place where the rook's top wall and window meet, I have the shading problem. I applied a bevel and subdivision surface modifier on it. How can I fix this?
Comment: You might take a peek at the (very opinionated, but generally right :) ) Ian McGlasham's [chess-set](https://www.youtube.com/watch?v=vi0jiL7LsDA). The result is pretty similar to moonboots.. (4-poles on sharp corners) .. but a way of thinking clean-subdiv.  from the outset.
Comment: @RobinBetts Thank you. I've taken a look at it. He indeed uses a method that is very different.
Answer: A Bevel modifier won't always work, maybe use this topology instead:
Comment: Thank you. Changing the topology as you suggested didn't completely solve the issue but gave me the idea of getting acquainted with topology in general. It seems like there was a pole on that corner where 5 edges meet. I turned it to a vertex where only 4 edges meet, like in your image, and added some support looks. That fixed it.
Answer: If you want a "quick 'n dirty" way to sort it on this particular model, change the Miter Outer setting in the modifier's Geometry section from Sharp to Arc:

You should always look at the rest of your model to make sure it hasn't caused any other problems.
Comment: Arc causes pinching though
Comment: @moonboots I did say "quick 'n dirty"! It really depends how fussy you are with the shading. The car_paint matcap is intended to show up the slightest shading defect.
Answer:
Changing the topology as you suggested didn't completely solve the issue but gave me the idea of getting acquainted with topology in general. It seems like there was a pole on that corner where 5 edges meet. I turned it to a vertex where only 4 edges meet.

The problem isn't how many faces you have meeting there, it's that you're generating non-convex polygons. Subdividing an N-gon with a concavity results in... well, the mess you discovered.
That said, you probably don't want 'Sharp' outer miters, especially if you're going to try to subdivide the result further. So, first change that to 'Arc' (as in John's answer). I'd also play around with the width type; I've noticed 'Absolute' often gives more consistent results.
The way (I found) to fix this with the least modeling changes is to split the faces to either side of the crenels (below the merlons) into triangles with the diagonals pointing to the corners. This happens to work with two subdivisions of bevel (and outer miter set to 'Arc'!) because it results in convex quads around the problem corners:

(You may notice I also added a ring of quads to the top. This significantly improved some artifacts that were popping up there.)
Applying subdivision gives this result:

FWIW, I'd also recommend removing the 'baked in' bevels and instead generating them with a modifier. Use bevel weight to achieve different bevel radii.

BTW, I'd be darned tempted to model this as a revolute and use boolean operations to cut the crenels. That would probably allow you to avoid needing subdivisions at all. (Or, model it in FreeCAD so you can model it as surfaces rather than polygons.)


How to detect WiFi spoofing?

Question: I have recently become concerned that someone might be spoofing the WiFi network at my office. The network has been really unstable these last few weeks. The password isn't really that secret, and I'm guessing that if someone had the SSID as well as the password, someone could configure a fake router with the same MAC advertisting the same SSID and password. Is that possible?
Are there any tools for Windows that can be used to see if there is an unsual amount of broadcasts for an SSID with the same MAC? Or are there other ways to detect this?
Comment: You are exactly talking about "Evil Twin Attack" , I think. https://en.wikipedia.org/wiki/Evil_twin_(wireless_networks)
Answer: To begin with, Wifi spoofing is named as Evil Twin attack. You can find more information about it if you search as "Evil Twin Attack" rather than "Wifi Spoofing".
I have found a good article about the attack: What is evil twin?.
Plus, there is a good explanation about how to commit it on Null-Byte.WonderHowTo. ( for learning purpose only ).
There is no need the attacker to know about your password. In addition, he does not even need to spoof your MAC address. Detecting Evil Twin is already explained well in How would you detect an Evil Twin attack, especially in a new environment? . So you can read it.

How to detect WiFi spoofing?


Non-Newtonian substance - Tahini

Question: Raw Tahini seems to me like a non-Newtonian substance. When I mix it fast, it gets tougher. When I mix it slowly, it gets softer.
Is there any truth to that?
Answer: Yes, tahini (and cornstarch-water mixtures) are dilatant, non-Newtonian fluids, with viscosity increasing with shear strain. See http://en.wikipedia.org/wiki/Dilatant for definition and https://www.youtube.com/watch?v=D-wxnID2q4A, https://www.youtube.com/watch?v=BleCJJAKkgw for demo.
Tahini is much better in hummus than in a swimming pool, though. ;-)

Non-Newtonian substance - Tahini


Is my motherboard OK after accidentally putting a case screw in a non-case screw hole?

Question: I was building my first computer, and I accidentally put a case screw into another screw's spot to secure the motherboard. However, I cannot get it out. It makes weird "clicking" screws every 1 turn or so and I'm afraid to mess around with it. I cannot remove it. How do I remove this case screw? I want to get it out because it puts unnecessary tension on the motherboard (not too much but still...) I also, while trying to get it out, I bent a capacitor a little (30 degrees about) but it's still intact. I ended up bending it back. Should my motherboard be okay? It didn't damage the PCB at all except a hairline scratch. How do I get the screw out?
Comment: Use a screwdriver with a magnetic.  You got it in there you can get it out.  electricity and metal in places where they should not causes shorts.
Comment: You need to remove it.  It can indeed cause a short.  We can't tell you if your motherboard will be "ok"
Answer: After letting off some steam, I realised the standoff and screw were "stuck" together; if you moved one you moved the other no matter what. I unscrewed all the other screws and I was able to unscrew the whole motherboard [with the standoff and screw still attached to it] and with pliers and a screwdriver I was able to disassemble it all. Next time, I'll read the manual!!!
Answer: Motherboard screws are usually being screwed into spacers that in turn are screwed into the case:

The case screw has a different thread that the motherboard one, so by screwing it into the spacer you basically stripped the thread.
So to get it out you need to get to the spacer and hold it (perhaps with a side wrench of the small size) while attempting to unscrew it.
The other option is to remove ALL screws except yours and try to remove the board with the spacer still attached and remove if afterwards


Sharing Video on Facebook

Question: If I post a video to my profile on Facebook and make it only visible to a custom list, can those members then re-post the video and share it with whoever they wish?
Comment: If you share an video to a restricted list the share will not appear and your friends will have to either post a link to the video or upload the video themselves after downloading it to repost it on their timeline.
Answer: If the video is made available to a custom list only, then the ability to download and/or share are removed from the basic interface.
That being said, there is surely a way for someone who has access to the video to hack and get a copy of it and then redistribute it on their own, but it is not done easily or through the normal usage of the facebook application or API.

Sharing Video on Facebook


Which is correct, go for a walk or go to a walk?

Question: I was studying prepositions and stumble upon this phrase "(1) go for a walk (2) go to a walk" which one from these two is correct and why?
Answer: If the walk is a destination/event (such as a walk to end cancer, a school walk-a-thon, etc.), you could use "go to a walk" or "go to the walk."
However, in most circumstances, "walk" does not represent a destination/event, and you should say "go for a walk."
This web page might help you out further (Collins Dictionary) by giving you some example sentences.
Answer: As is so often the case in English, more than one preposition is common and acceptable in an expression with "go...a walk".
I'm going to go on a walk with John.
I'm going to go for a walk this afternoon.
I'm going to go to a walk for senior citizens at the mall (an event).
Also, sentences can use "to walk" (infinitive) rather than a phrase with an indefinite article ("a walk"): "I'm going to walk around the park."


How to copy a row from one SQL Server table to another

Question: I have two identical tables and need to copy rows from table to another. What is the best way to do that? (I need to programmatically copy just a few rows, I don't need to use the bulk copy utility).
Comment: What's "bulk copy utility"?
Answer: As long as there are no identity columns  you  can just
INSERT INTO TableNew
SELECT * FROM TableOld
WHERE [Conditions]

Comment: Be careful with this syntax as it won't work if Table2 has an identity column and it will break in the future if Table1 ever changes without Table2 changing in sync (burned me before). This solution might be perfect for your case, just be aware of these considerations.
Comment: You can use `SET IDENTITY_INSERT < table > ON` (and `SET IDENTITY_INSERT < table > OFF`) in order to temporarily disable the identity column on the table you're trying to insert into. Worked for me trying to restore a few missing records in the middle of dataset.
Comment: what if the primary key in table1 exists in table2 as a foreign key? I have the same thing, and i don't know what to do.. in table2 id the foreign-key AS "Technology_idTechnology" and in table 1, it is there as "idTechnology" I want to copy all the entries from table1 to table2, when the idTechnology matches in both tables..
Answer: Alternative syntax:
INSERT tbl (Col1, Col2, ..., ColN)
  SELECT Col1, Col2, ..., ColN
  FROM Tbl2
  WHERE ...

The select query can (of course) include expressions, case statements, constants/literals, etc.
Comment: This is great when the tables differ slightly.  I've a few extra columns in my second table and the accepted answer doesn't work with MSSQL as they need to be identical.
Answer: Jarrett's answer creates a new table.
Scott's answer inserts into an existing table with the same structure.
You can also insert into a table with different structure:
INSERT Table2
(columnX, columnY)
SELECT column1, column2 FROM Table1
WHERE [Conditions]

Comment: @ScottStonehouse: if you collect all the other answers into this answer like you have done but with code (making it comprehensive), you'd definitely become the best answer.
Answer: SELECT * INTO < new_table > FROM < existing_table > WHERE < clause >

Comment: Sure! Just fully qualify the database. [servername].[schema].[table]. For example `SELECT * INTO [SQLTEST].[dbo].[EMPLOYEES] FROM [SQLPROD].[dbo].[EMPLOYEES]`
Comment: This creates a new table, which is not what the OP is asking for.
Comment: Is there any way to do this If this two tables are in diff databases in sql-server.
Answer: INSERT INTO DestTable
SELECT * FROM SourceTable
WHERE ...

works in SQL Server
Comment: This works only when DestTable does not exist. You will get an error if DestTable is created before this query.
Comment: Actually it fails if the destination table doesn't exist. It may cause errors if the existing DestTable isn't empty.
Answer: To select only few rows..This will work like charm..
SELECT TOP 10 *
INTO db2.dbo.new_table
FROM db1.dbo.old_table;

Note : Just create a new table in the required db..We need not define its structure.


What is the best way to deal with being counter picked?

Question: Sometimes being counter picked can't be avoided (because you're first pick, or your teammates are unwilling/unable to trade). So when you get counter picked mid/top, what is the best way to deal with it?
Answer: Farm, farm, farm, farm! All I can say is, buy a lot of health pots and play defensive, ask your jungler for ganks and cross your fingers and hope that the other lanes wins.
Comment: I guess that could work, but that seems to be if they push the lane and allow you the chance to farm, what if they are good at denying you and holding the lane, it's almost like you're just screwed lol. Well I can apply this to next time. Thanks.
Answer: There are a couple of things you can do, and many of these apply to just general playing the game, not only when counterpicked.

Learn to farm under the tower. Its pretty hard to do in some cases, and takes a fair bit of practice. There are a couple of guides around about how to do it, but nothing beats practicing, even if its in a custom game.
Try and guess who you will be facing and change your runes if possible. I have to admit I'm terrible at this and generally build my rune pages with some form of AR/MR by default (and cause I'm too lazy to switch runes)
Play passively and wait for them to make a mistake. A lot of players get really annoyed when you sit by your tower and farm minions, and eventually the frustration gets the better of them. This is especially true of champions that are generally really strong early game, as they are used to getting lots of kills. If you get counterpicked and you manage to still farm, and harass them occassionally, and get through laning phase without dying, then its more than anyone could expect of you.
Dont be a slave to the meta. Just because you picked Ryze doesnt mean you have to go mid. If you were counter picked severly, or even if you are just being outplayed, ask for a switch. It can make things a little more difficult, having people play in lanes they arent used to, but you may even find that switching it up like that is enough to throw the enemy team off. LB expecting Ryze in mid and finding Cait might just be enough to give Cait an edge.
Ask for help. It's a team game, and if you are having issues helping the team, then its better to swallow your pride and ask for help than remain silent and feed. Some people will always be assholes and give you grief for asking for help, but most of the time your team will understand.
Change up your item build. Sacrifice some damage for a bit of extra MR/AR/HP. Item builds have to be flexible, there is no one size fits all.
Dont stop farming when your tower is destroyed. Quite often I see a tower go down in a lane and instantly the lane jumps into gank mode. They rush to another lane and spend so much time trying to gank or leeching their teammates farm when they could be farming their own lane still. This is especially true for the ad carry.
Realise that losing a tower early is not always a bad thing. Sure, losing a tower can be a pain, and no one likes to lose a tower, but it does put the farming more in your court. All of a sudden you can farm on your side of the map, where they have to either go off somewhere else, or put themselves in serious risk of a gank.
Realise that if you were counterpicked, and the other player is of similar skill level to you, that you will most likely die a few times. There's very few things you can do to avoid it. Just try not to lose your head when it happens. Dont use this as an excuse and tell the rest of your team it isnt your fault, because no one likes to hear excuses. Just take a breath, figure out what you did wrong, and go back in there.

tl;dr; (cause I know I probably wouldnt read all that) Play passively, keep calm, be flexible (runes/masteries/build/lane) and farm as much as possible without taking risks.
Comment: This. Good tips, and yes I read it all lol. Thanks.


My site Cache version problem

Question: I have an issue for last month and that also affected my website ranking. When I fetch my site it will be normal but after 48 hours it will be shown without title and description and this wording showing " Index of / .ftpquota .qidb/ · New folder.zip · wp-config.php. Apache Server at smmpoint.com Port 80" instead of description . please check in following image
Comment: *When I fetch my site*... How? This may help to clarify the situation. As well, are there other factors you can think of? Cheers!!
Answer: It looks like you are not uploading the data to the correct DocumentRoot. Make sure you are uploading the data under the public_html directory.
Also, make sure the domain name is not pointing to a subfolder of the root domain name..
Comment: It is quite common that people deploy their site to the wrong directory. My concern is that the OP says *When I fetch my site...* and I do not know what that means. It may be that the site works the way it should for a period then goes wonky. I have never seen this of course. Something to consider. I posted a comment for the OP asking for more specifics. Cheers!!

My site Cache version problem


New to sous vide and not having any luck

Question: Tried a pork loin that had been well marinated. Cooked it at 140 for 3 hours. Was very tender and did not have any character and no taste of marinade.
Next try was chicken tenders. Cooked at 140 for almost 2 hours. Used it for Orange Chicken. It was very tender and kind of like eating tofu with orange sauce.
Third try was a marbled beef chuck roast. Put salt, pepper and onion powder on before vacuum bagging it. Cooked for 48 hours at 135. Seared in oil in cast iron pan on all sides. Was very tender but not falling apart. Did not taste like a roast.
My wife thinks I wasted money on sous vide. Everything I read raves about everything cooked this way, but we have not experienced that.. What am I doing wrong?
Comment: Are you saying "tender" is a bad thing? It kind of sounds like it. In general, can you be a little more specific about what your goals are? It's pretty clear that you wanted your pork loin to taste like the marinade, but a little less clear for the others.
Comment: Did you follow good recipes (e.g. following Kenji's recipes on Serious Eats or something) or just wing it?
Comment: I expected it to be tender, but i did not expect a blob of tender meat with no taste. I used the temp and time from charts and the sauce was one i regularly use on chicken.
Answer: Sous vide is a great method for getting tender meat but it doesn't impart flavor to anything. Marinades only go so far adding flavor, you need your meat to have flavor in the first place. Other than from marinade flavor in cooked meat comes from:

The quality of the meat: good quality meat comes from good breeds that have been raised well and given quality feed
The cut: the more work the meat does on the animal the more flavor it has. A tenderloin is tender to begin with because it just fills a gap and doesn't move, but it isn't going to taste the same a shoulder. A working cut has a much stronger flavor and the connective tissues break down into gelatin which adds flavor and a luscious mouth feel. My personal opinion is that there's no point in slow cooking tender cuts, I always go for the beef shin (leg), chuck, or rump (round). Chicken breast, especially your standard cheap store brands, has very little flavor, I prefer dark meat, or if I'm cooking breast I go for quality free range birds
Maillard reactions and caramelization: When cooking at high temperatures you get flavors from maillard reactions and the caramelization of sugars, slow cooking does not add these, so you need to brown before or after (you appear to have done this with your beef which is good), before is better for slow cooking in my opinion as you get the flavors from the browning throughout the meat

The simple truth is you won't get a tasty result in cooking unless you start with good ingredients, and this is especially true in sous vide cooking, or any slow cooking method really. Sous vide is not a magic bullet which transforms mediocre steak into amazing steak, it's got to be amazing steak in the first place. Good restaurants use the best quality meats they can get their hands on, so if you want to get similar results you will too.
Comment: "Marinades only go so far adding flavor, you need your meat to have flavor in the first place." -- literally true, but maybe not the whole story. If you actually sous vide the meat *in* the marinade/sauce, it can take on a fair amount of flavor, and if you then reduce the liquid from the bag to use as a sauce, you'll be in even better shape. If on the other hand you marinate the meat then take it out of the marinade and put it in a bag to sous vide, then eat the meat plain, you won't get nearly as much.
Comment: "Sous vide is not a magic bullet which transforms mediocre steak into amazing steak" Well, it *can*, but the sear is critical: http://cooking.stackexchange.com/questions/53373/sous-vide-chuck-roast-or-chuck-steaks/53376#53376
Comment: Thanks for all the info. I think i need to explore different sources for meat. Also i think i will try searing the meat before cooking.
Comment: (I realize I'm late to this thread) To the last comment - The searing comes after the Sous Vide, no?
Comment: Joe - i think it is normally done afterwards, but my only successful sous vide is fajlta skirt steak. I seared it before putting in the vacuum bag. Completed cooking it, then put it on the grill for a few minutes at a high temp. It was great.
Answer: Chicken should be noticeably firmer than tofu after cooking to 140 degrees, but it will be quite soft (and a little bit slimy) at 135 degrees.  You may need to calibrate your equipment to make sure you're getting the right temperature.
It's possible your food simply needs more salt (or other flavors) added after cooking.  I prefer not to add a lot of flavor before cooking, especially if it's going to cook for a long time.  If you are going to add flavor first, keep it simple and avoid adding oil.  (Oil absorbs some of the flavor, but it doesn't penetrate the meat very well.)
Starting with good quality meats helps a lot, too.
Comment: I wonder if, with the pork and chicken, if i over cooked the grocery store meat. I will check the calibration.
Answer: Afters using sous vide on well over 30 occasions with all types of meat, I hear familiar tones to your concerns about the meat being tender, but lacking flavor. In my opinion, sous vide makes for good pictures of pink-centered steaks, but little else (note in many of those pictures there is little juice coming out of the just sliced meat - my experience  consistently). It robs the fatty juices, and breaks down collagen to a point where the meat no longer tasted like meat, but chalk. And yet, all I hear, is the constant bandying about regarding time of cooking. Folks, it's not time, it's the failure of the process itself. I have abandoned sous vide for cooking meats. I cook meat now I've gone back to cooking meats like the pros do. Reverse sear, broil, or roast depending on the cut and type.
Comment: Your Emperors-New-Clothes view of the situation doesn't really hold together given the many of us who find sous vide a useful, effective tool in commercial kitchens or at home. It's a poor workman who blames his tools.
Comment: (There's also a lot factually wrong there.. for instance, sous vide cooking is notably *deficient* at breaking down collagen, a process which really only gets going in the 70s C, and which has little impact on the taste.)


Anytime: 随時 vs. 何時でも

Question: Is 随時{ずいじ} used to express anytime like いつでも?
Answer: The words are actually quite different in their nuances: (and consequently not interchangeable)

随時 - as required  (e.g. 随時更新します - I will update as required (as things change))
いつでも - at any time (e.g. いつでも来てください - Come whenever you like)
Comment: +1. 隋時 implies that there are many small requests/tasks which are served as they came. You cannot use 随時 for a one-time event.
Comment: L'electeur provides many great answers, but on this particular occasion he is incorrect. I checked your link at it says "適宜" (as appropriate) and 定期的でないこと (irregularly). These terms are not interchangeable and they have different nuances. As I said, the consensus is clearly on this answer yet you seem very invested in the other answer.
Comment: @user1602 If you already knew the answer then why did you ask this question? 随時 does not mean at any time and cannot be used to reference a one time event as Naruto correctly pointed out. The consensus is clear that this answer is correct.
Comment: I believe 随時 has two senses: 1) at any time 2) as needed.  My question was about the first sense, therefore l'électeur(http://japanese.stackexchange.com/users/4032/l%c3%a9lecteur) answer is the most appropriate.
Comment: I was skeptical about the answer, and wanted a native Japanese speaker to confirm the JMDict translation. Obviously you do not trust l'électeur, so to confirm his answer I had to struggle with my limited Japanese to understand Goo 辞書 http://dictionary.goo.ne.jp/srch/all/%E9%9A%8F%E6%99%82/m1u/ and it looks like one of the senses is 好きな時にいつでも, which very close to "anytime", and by the way, anytime does not imply one time - I don't know where this came from.

Anytime: 随時 vs. 何時でも


Why did my Inquisitor increase the foreign religion?

Question: I had a religion, somewhat like taoism. A bunch of apostles came to my main city and converted more than half of my people. Afterwards, I went with an Inquisitor to repel them, but my Inquisitor only increased the foreign religion. Is this a bug or is meant to be like that?
Comment: If I tagged the incorrect game (I'm basing this on the answer), then feel free to correct it.
Comment: not quite the same - but similar: I had an apostle with the eradicate other religions promotion and used him - the religious lens showed my religion had the majority (and no other religions were present), but the city still had the other religion's logo and was coloured differently in the religion lens...
Answer: Any religious units you make will follow the majority religion of that city.  So if you purchased the Inquisitor after that city was converted, then the Inquisitor would be of the foreign religion and would remove your religion when used. So yes, it's meant to be like that.
As for regaining your religion, you could purchase an Inquisitor in another city that is still Taoist.  If you do not have any Taoist cities left, I don't know of a way to regain your religion.  Sounds like a good time to pivot to another victory type!
Comment: ok, yes it was civ 6, and i think that clears it up. thanks.
Comment: Could be dated, but in Civ5 a holy city was almost impossible to keep as anything but its native religion and Great Prophets are always your religion. TL;DR - you should be able to get your religion back even if it's been completely wiped.


Why is the p-state status MSR on ryzen not changing?

Question: I am trying to detect the current p-state of my cpu. I have noticed that the p-state status MSR (C001_0063) always returns 2 on my ryzen 1700x system, even if the core is clearly not in that state. I think it used to work with the initial bios (v0403) that my motherboard came with, but that's not available for download anymore1.
My cpu is overclocked2 to 3.8GHz. I used cpufreq-set to fix the speed and cpufreq-info to verify:
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 4294.55 ms.
  hardware limits: 2.20 GHz - 3.80 GHz
  available frequency steps: 3.80 GHz, 2.20 GHz
  available cpufreq governors: ondemand, conservative, performance, schedutil
  current policy: frequency should be within 3.80 GHz and 3.80 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 3.80 GHz (asserted by call to hardware).

Following is a little test program that shows the value of the register for core #0, along with the effective speed relative to P0 state. Needs root privileges. For me, it constantly prints pstate: 2, speed: 99% under load.
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main(int argc, char** argv)
{
    uint64_t aperf_old = 0;
    uint64_t mperf_old = 0;
    int fd;

    fd = open("/dev/cpu/0/msr", O_RDONLY);
    uint64_t pstate_limits;
    pread(fd, &pstate_limits, sizeof(pstate_limits), 0xC0010061);
    printf("pstate ranges: %d to %d\n", (int)(pstate_limits & 0x07), (int)((pstate_limits >> 4) & 0x07));

    for(;;)
    {
        uint64_t pstate;
        uint64_t pstate_req;
        uint64_t aperf;
        uint64_t mperf;
        pread(fd, &pstate_req, sizeof(pstate_req), 0xC0010062);
        pread(fd, &pstate, sizeof(pstate), 0xC0010063);
        pread(fd, &aperf, sizeof(aperf), 0x000000E8);
        pread(fd, &mperf, sizeof(mperf), 0x000000E7);
        printf("pstate: %d, requested: %d", (int)(pstate & 0x07), (int)(pstate_req & 0x07));
        if (mperf_old != 0 && mperf_old != mperf)
        {
            printf(", speed: %d%%", (int)(100 * (aperf - aperf_old) / (mperf - mperf_old)));
        }
        putchar('\n');
        mperf_old = mperf;
        aperf_old = aperf;
        sleep(1);
    }
}

A similar approach used to work on my FX-8350. What am I doing wrong? Test results also welcome.
System information:

Cpu: ryzen 1700x, P0 & P1 is 3.8GHz3, P2 is 2.2GHz
Motherboard: Asus Prime X370-A, bios 3401
Operating system: debian 7.1, kernel 4.9.0

Update: I have changed the code to print the requested pstate and that register is changing as expected. The actual cpu speed is changing too, as confirmed by various benchmarks.

1 For some obscure reason, the bios backup function is disabled, so I couldn't make a copy before updating.
2 I will run a test at defaults when I get a chance.
3 No idea why it's duplicated.
Answer: Per-core (in reality: per CCD) P-States are in the undocumented MSR c0010293, bits 22:24, I think.
Comment: That certainly seems to do something, although I only observed values 1 and 2.
Answer: It may not be related, however I have heard that some people have successfully had their Ryzen 7s replaced by AMD, due to p states causing system stability issues in Unix or Unix like systems. Although from commentary on the matter, especially from ASrock forum points towards a driver/firmware issue, I have read elsewhere that AMD may be taking some responsibility with early batches of chips. That said from what I know of P and C states, some states are requested by the operating system, or host vertulisation environment. So a patch could be done from within?


What is this rubber circle on duct

Question: Can anyone identify? I'm hoping I can use it somehow to affect air flow.

https://i.stack.imgur.com/VxqOu.jpg
Comment: I've seen holes of that sort used to insert a probe to _measure_ airflow, but since you probably don't have that tool...
Answer: It's a plug for a hole. It should pry out - doubtful that it will allow you to adjust airflow.
Beware of random self-adjustments to a furnace's airflow done without checking the current to the fan motor - you can overload the fan (and the overload will happen in the opposite direction than you expect, unless you are unusually well educated in the ways of centrifugal fans.)
Comment: Per the fan overloading, see: http://diy.stackexchange.com/a/53816/18078 and a comment on that answer.
Answer: That plug is to stop up a hole that was added to the duct work. The most likely use for the hole was to insert a long tool that was to knock loose dust clinging to the inside of the duct during a duct cleaning exercise.
It is extremely unlikely that you will be able to use that specific hole for any type of duct air flow control. Most duct air flow control is done using dampers that are installed inline with the duct. Typically a damper assembly is part of a joint frame that becomes the connector between two sections of the duct piping.
The pictures below show two types of duct damper assemblies:

It would not be advisable to haphazardly install arbitrarily located dampers in the air circulation system. The original installer of the system has presumably done a careful job of engineering the air flow analysis so that the system does a balanced job of properly delivering airflow throughout the dwelling. The best advice, if you need to tweak the airflow to a specific room is to adjust the vanes in the register grate that emits the airflow into that room.

What is this rubber circle on duct


Domain Keys Identified Mail (DKIM)

Question: If a company uses Domain Keys Identified Mail ("sender adds a special signature which includes author name / date signed by RSA Private Key. Receiver verifies the signature by looking up the public key of the sender and ensures that the email's sender name and the date in the regular email header matches the signed name and date in the signature tag") and has an online database with employees public keys and someone (lets say Mallory) hacks the database and changes the public key of an employee (lets say Alice).  How can Mallory listen into the conversation between Alice and another employee, Bob?  Would "Mallory" be able to eavesdrop / man in the middle attack and be able to listen into the conversation without Alice and Bob knowing?  Is there a way that she can listen in even with the domain keys identified mail system?
Comment: As far as I know, DKIM provides authentication, not secrecy. It does not encrypt messages so it doesn't protect from eavesdropping. Do you know the difference between encryption and digital signatures?
Answer:
Would "Mallory" be able to eavesdrop / man in the middle attack and be able to listen into the conversation without Alice and Bob knowing?

DKIM is not used for message encryption, it is used to prevent spoofing.  A message signed with a DKIM signature is clearly visible in plaintext to anyone in a position to view it in transit between the sender and the recipient (e.g. 'Mallory' in the context of your question).
However, DKIM will prevent Mallory from spoofing a message that appears to be from firstname.lastname@example.com, because Mallory does not have the private key associated with bobsdomain.com, which would be needed to create a valid DKIM signature for the message.

Domain Keys Identified Mail (DKIM)


What to do if a subordinate complains about his/her own subordinates?

Question: I lead a project involving several teams led by separate team leaders. There's this one TL who always goes to me to complain about the work of their own team members, and frankly it has become exhausting because I have several other things to juggle and expect the TL to address those issues at their level before escalating to me. I give advice on what they can do to address the issues, but it always looks like they want me to be the one to do something. I don't want to appear dismissive but I want to tell the TL to handle it instead of complaining to me. What is the best way to do that? And at what point should I really step in?
Comment: Sounds a bit like this TL either doesn't want to be or doesn't know how to be a TL ... Is there any training they could/should have?
Comment: Does the TL have the authority to address the issues? It is not much helpful to tell him to address the issues himself, if the team doesn't listen to him and he cannot do anything to make them do so.
Answer: I always had a policy of "Don't bring me a problem unless you already have a solution".  It's a polite way of saying "do your job" without saying it.   It also creates a solutions-oriented mindset.
If you tell the team lead to only bring complaints when he has solutions, he'll be in a more positive track.  Team lead is a sticky situation because the position is not technically management, so the TL might not be clear on just when HE can step in.
Sit down with the TL and outline exactly where his authority lies, then only step in when he's reached the limit of what he can do.  This way, the TL's roles and responsibilities will be more clearly defined and the only reason he should be coming to you with complaints at that point is when he has a solution in hand, or a need for you to step in.
Comment: +1 for "Team lead is a sticky situation because the position is not technically management". No one wants to be "that guy" (or girl) who has to be reminded that they are "only" a TL, hence, it's helpful to clearly define management vs. TL functions.


How do I import Notes from my iMac to my iPad?

Question: Notes from my iMac do not appear on my iPad or iPhone, what could be wrong?
Comment: OK...how are you syncing your iPhone and iPad? What version of iOS is in use on the devices? What versions of OS X and iTunes are you using? Are you syncing with a cable or wirelessly? Do you have iCloud set up to sync notes?
Comment: I synch wirelessly. Yosemite10.10.1 on imac. iTunes is 188.8.131.52 on iMac. iPhone is iOS 7.1.2. iCloud preferences on iMac show a check mark to the left of Notes
Comment: When I sign into iCloud itself and open settings to see Notes, notes that I have written from Notes on my Mac and which still appear appear as notes on my Mac do not show up in the Notes app that appears in iCloud itself. Hope that makes sense. Thanks for whatever help.
Answer: This is most easily done through iCloud, which should be the same account you sign in to the App Store with.
Go to System Preferences > iCloud. If you haven't already set up your iCloud account on your Mac, simply click on iCloud, and enter the username and password.
In the right side field, scroll down to "Notes" and tick the checkbox next to it. You may need to wait 5 or so minutes for iCloud to update.
On your iPad and iPhone, go to Settings > iCloud, scroll down to Notes and turn on the slider.
For additional setup info:
https://www.apple.com/icloud/setup/mac.html
Comment: Thanks.  Hmm. When I open system preferences on my imac and then open Notes, the box next to Notes has been checked.  HOWEVER, when I go onto iCloud itself and open settings to see Notes, notes that I have written from Notes on my Mac and which still appear appear as notes on my Mac do not show up in the Notes app that appears in iCloud it self. Hope that makes sense.
Answer: The Notes Application on the Mac has local (on the Mac only) and iCloud notes.

On the Menu Bar click View > Show Folders List if it is hidden.  If you have iCould set up, you should see 2 Lists: One for iCloud, the other called On My Mac.
You can drag individual Notes (not the folder) from the Notes On My Mac to the Notes list on iCloud.  Then you should be able to see/edit them on your iOS devices.


Best way to show that a screenshot continues on the next page?

Question: I'm working on a presentation and need to show that a screenshot continues onto the next page. For some reason I'm having trouble finding the icon that is normally used - I feel like it's sort of a lightning bolt that indicates the page has been separated. Does anyone have a good example?
Comment: What is the medium? A multi-paged PDF? Something else? How about an arrow or the word "next"?
Comment: It's a multi page PDF - more or arrow would definitely work, but I was asked specifically for the lightning bolt sort of thing, which I've definitely seen but can't think of a way to search for it in google images or noun project.
Comment: How about going to icon sites and looking for lighting bolts? As for example: http://www.flaticon.com/search/lightning-bolt
Answer: You can use a 'torn page' edging style to indicate that something is continued somewhere else and in a particular direction.
Answer: You can add black inset gradient inside image - it will suggest that image isn't displayed full.
EDIT - Example image

I know that this gradient is too visible, I just wanted to show what I mean.
Comment: Add a sample to make your answer a bit clearer :)
Comment: Ok, sorry. Updated :)
Answer: One of the way instructional designers use to show that the screenshot on a page is not complete is to show it by dashed-lines. As shown in figure 01
The same idea can be used to indicate that the screenshot is incomplete and next page shows the screenshot beginning with the dashed lines indicating continuation.
Another way is to use what we traditionally use while making flowcharts. Use the circle with  the number or alphabet and use same in the next page. I have tried to display in figure 02


Help decipher the notation said to denote a common pattern in various branches of science in Prelude to Mathematics by W. W. Sawyer

Question: In Section 1.2 - Nature's Favorite Pattern? (excerpted below) of Prelude to Mathematics by W. W. Sawyer (1982), he said mathematicians used the notation $\nabla^2 V$ to denote a pattern that occurs "in at least a dozen different branches of science", without explaining the meaning of the symbols.  In the footnote, he extended the notation to an equation $\nabla^2 V = 0$ and tried to provide some explanation.  It seems to talk about the law that properties in physics manifest the same in empty space regardless of position and direction.  But how does $\nabla^2 V = 0$ expresses this law? Could someone give an interpretation of the equation in a concrete context?  I am exposed to basic physics in high school.
Comment: This is not an answer to your question since I know little physics. But this is the Laplacian operator: see e.g. https://en.wikipedia.org/wiki/Laplace_operator. It is central to the study of gravitation, heat flow, electrostatics, etc etc. The Wiki article referenced shows how it is connected with "averaging over a sphere". In one dimension this is just the infamous limit $\lim_{h\to 0}(f(x+h)-2f(x)+f(x-h))/h^2 =f''(x)$ - $f''$ is the 1-d Laplacian.
Comment: And it's not correctly written, since the Laplacian is denoted by either $\nabla^2$ or $\Delta$, but not $\Delta^2$.
Comment: Clearly the related physical question should be, what is wrong with this naïve mathematical viewpoint; the prediction of negative mass, non-existent magnetic monopoles perhaps, absence of a guide to non-linear behaviour of diverse physical systems from their linear behaviour, should positive and negative charges be interpreted in terms of unlimited sources and sinks in analogy to fluid dynamics.
Comment: Oh, thanks for the pointer!
Comment: I personally think this question would be better answered on Physics SE. Voting to migrate.
Comment: I don't think this should be migrated. The text clearly contains a mathematicians viewpoint on the commonality between the mathematical description of a diverse array of physical systems. In many ways the interesting physics is in the differences, not the commonality,
Answer: If you're looking for a concrete example, perhaps the best one comes from Maxwell's equations. The first of Maxwell's equations is
$$\nabla \boldsymbol\cdot \mathbf{E}=\frac{\rho}{\varepsilon_0} \tag{1}$$
Here $\mathbf{E}$ is the electric field, which is vector valued, $\nabla\boldsymbol\cdot$ is the divergence operator, which essentially measures how much $\mathbf{E}$ "spreads out", $\rho$ is the charge density, which is scalar valued, and $\varepsilon_0$ is the vacuum electric permittivity constant.
What is this equation saying? Basically it says that

The more charge there is at some point in space, the more the electric field at that point will spread out. (Or in the case of negative charge, compress in)

Which makes intuitive sense. Now assuming $\mathbf{E}$ is conservative, which essentially means that it makes no difference what path you take between a start and end point in terms of how much work it will take, then we can find some scalar function $V$ such that $\nabla V=-\mathbf E$. (The function $V$ is related to the potential energy of the charge;  the minus sign is a matter of convention.)  Here $\nabla$ is the gradient operator, which basically tells you in which direction you need to travel to see the greatest increase in $V$. Substituting this into $(1)$ we get
$$\nabla\boldsymbol\cdot \nabla V=-\frac{\rho}{\varepsilon_0}$$
Which is commonly written as
$$\nabla^2 V=-\frac{\rho}{\varepsilon_0}\tag{2}$$
Once again, what is this equation saying? What is $\nabla^2$, physically? Well, the $\nabla^2$ operator, known in the business as the Laplace operator, essentially measures how much the value of a scalar field at a point varies from its average value over a small ball around that point. So, the stronger the electric charge density $\rho$, the more rapidly these averages will deviate. This also makes intuitive sense.
Notice what we have done here - we have translated 3 partial differential equations (one for each component of $\mathbf E$) into a single partial differential equation, only involving $V$. This is a very beautiful simplification. Although the new equation is now second order, instead of first order, it turns out in practice that equation $(2)$ is a lot easier to work with than $(1)$.
Why does the author emphasize this point so much?
Equation $(2)$ is an example of Poisson's equation, which mathematically speaking is a very interesting and beautiful equation. But let's go further than that - imagine that we are in a scenario where we have a point charge sitting at the origin. Since a point has no volume, the charge density is essentially infinite at the origin, but zero elsewhere. If we forget about the origin for a moment, that means that at all other points in space $(2)$ simplifies to
$$\nabla^2 V=0\tag{3}$$
This is a hugely important equation! So important, in fact, that is has a special name, Laplace's equation. Why do I say this equation is so important? Well, I'll give you a list of all the places you will see this equation -

Electrostatics
Quantum Mechanics
Fluid Dynamics
Complex Analysis
Newtonian Mechanics
General Relativity

These are the ones I could think of off the top of my head (my physics background is really shining through here), but I'm sure there are more.
That's all I have today. I probably left out some interesting points but I think this answer will suffice so far. Please comment any questions.


When will Sirius be closest to the solar system?

Question: Sirius is currently approaching the solar system, at a rate of 5.5 km/s, consequently in the future it will be closer and therefore brighter. When will Sirius pass closest to the solar system? How far will it then be from the sun, and what magnitude will it reach?
Comment: https://en.wikipedia.org/wiki/Sirius "Sirius is gradually moving closer to the Solar System, so it will slightly increase in brightness over the next 60,000 years. After that time its distance will begin to increase"
Comment: Appears to be answered in http://astronomy.stackexchange.com/questions/3601/how-often-do-stars-pass-close-1ly-to-the-sun/3605#3605 though it is not a duplicate. I cannot vouch for the answer, but the radial velocity and proper motion of Sirius is readily available for the interested.
Answer: Sirius is moving towards the sun at 5.5 km/s, and according to Sky and Telescope, will reach its closest distance in 60000 years, at which time it will be 7.8 light years distant, and be at magnitude -1.64, only slightly brighter than it's current magnitude -1.46.
Calculations using the latest Hippacos results give a slightly different value: a closest approach of 8.18 ly in 46000 years, and consequently a slightly dimmer peak. However Sirius is not moving rapidly relative to the sun, and will not change its brightness greatly in the next 100000 years or so
It will be the brightest star in the sky for another 90000 years, and no star will match its current brightness for another million years (when delta Scuti will reach magnitude -1.84.
Comment: The Wikipedia page is based on an edition of Sky and Telescope. Its an older issue, but it checks out, the radial velocity given is -5.5km/s This agrees with Simbad http://simbad.u-strasbg.fr/simbad/sim-basic?Ident=sirius&submit=SIMBAD+search . The SE answer has a velocity of Sirius of 17.66km/s, though that may be a speed, not a radial velocity. Its not clear. However either way, it is clear that Sirius is moving slowly wrt the sun, and given the uncertainty in the values, the two values may be within experimental accuracy.
Comment: Well instead of relying on wikipedia, or SE, I did the calculations myself... The results are in a google sheet: https://docs.google.com/spreadsheets/d/1p8y7LeipylmtacHEMXLq28b7wPJZIBwve-ZT_etVWD8/edit?usp=sharing . And my calculations agree well with the table in SE, using data from Simbad. A closest approach of 8.18 ly in 46000 years +- 2500 years
Comment: Of course my calculation doesn't model the acceleration of stars around the galaxy, which may be significatn'
Comment: This disagrees with the SE answer I referred to. So which, if either, is correct?
Comment: There is very little uncertainty in the motion of Sirius I think. The answer of course depends on the total velocity, not just the radial velocity.
Comment: Only *differential* acceleration between Sirius and the sun would be an issue. In practice they are both sitting in an almost identical potential.
Comment: I am *assuming* though that you have correctly used the centre of mass velocity for the Sirius system right?


Block diagram of 16:1 MUX using four 4:1 MUX only

Question: As far as I know we can make a 16:1 MUX using five 4:1 MUX. For four 4:1 MUX, I think we have to apply NOT to different selection lines but I am not getting the correct configuration to do that.
Comment: The question is not clear. Also, if you provide a schematic or drawings to your question it will improve your explanation a lot!
Answer: You could've easily found it on the internet if you searched.
The basis: See it this way: You need a combinational logic with 16 input pins, 4 select lines and one output. In a 4:1 mux, you have 4 input pins, two select lines and one output.
So, at the least you have to use 4 4:1 MUX, to obtain 16 input lines. But you'd then have a logic with 4 output pins. We can use another 4:1 MUX, to multiplex only one of those 4 outputs at a time. Hence, this would be your final design. There might be other designs methods too, but this is the most common.

Image courtesy: www.slideplayer.com
EDIT:
Yes, we can implement it without using the last 4:1 MUX; but you have to use an OR gate there and also include enable pins for each 4:1 MUX. It utilizes the traditional method; drawing a truth table and then analytically deciding the design. Here is an example of an 8:1 MUX from 2:1 MUX without using a 2:1 MUX at the output.

Image courtesy: https://www.youtube.com/watch?v=neXhD9qyQmo
But, to obtain the same for a 16:1 MUX you'll need to make a lot of modifications. Like if you draw the truth table and analyze (compare it with the above 8:1 MUX design), you'll require two enable pins for each MUX, each with different options. For example, the first MUX needs to be enabled only when the two enable pins(say, e1, e0) are low, the second MUS should be enabled only when e1= 0 and e0=1 and so on.
As the size of the MUX increases, it'll become too complex to design using this model. Hence, the first approach is utilized; the one with a MUX at the end. There may be other designs, but this is my approach.
Comment: This thing i know. I am asking is it possible to make a 16:1 MUX without using that last single 4:1 MUX ?
Comment: Yes, it is. Check the edited answer.
Comment: Actually I watched that video before I asked the question here. Anyway thank you for the explanation part. I think I get it now.
Answer:
Q 16×1 mux by using 4×1mux
Ans:.  It contains four 4×1mux are used & it is a 16×1 mux
16 i/p are used  the selective lines are S0, s1 ,s2, s3 , and
4 not gates are used and o/p are "y".
See the given image to  verify the logical circuit
<code>               It is designed by "Krishna .ch"
</code>


What Is The Difference Between 「好きじゃないです」and 「好きではないんです」?

Question: I understand that they both mean I do not like, but I'm not sure what exactly 「好きではない」means. Moreover, does the particle 'では'make a difference, or could you have just used 'は'?
Comment: That is a tricky question with only one of the two sentences using a 「ん」.  That 「ん」 is important.
Answer: You seem to be asking two questions in one here, about the difference between では and じゃ and also about what the presence or absence of ん means.
Number 1, じゃ is a contraction of では, like how 'can't' is a contraction of 'cannot' in English. では can be formal, or it can also imply greater emphasis.
Number 2, ん is a contraction of の in the のだ・のです structure. 好きじゃないです (and 好きではないです) is a plain statement. 'I don't like it.' With ん, there's a bit of an explanatory nuance. Note that, directly following a noun or na-adjective, のだ・のです takes the form ~なのだ・なのです, or ~なんだ・なんです contracted. This form cannot directly follow a noun or i-adjective; 「好きではないなんだ」 is ungrammatical.
「今度、寿司を食べに行きませんか?」 'Will you go out for sushi some time?'
「遠慮しときます。魚は好きじゃないんです。」 'I'll pass. I don't like fish.'
As you can see, 好きじゃないんです explains why the person is turning down the invitation.
Comment: @vdegenne Maybe I'm misunderstanding you. You seem to be suggesting that the non-contracted form would be 好きじゃないなんです. That's not grammatical. Nor would be 食べたなんです, but 食べたんです is correct. I see no error in Angelos's answer.
Comment: @vdegenne 「好きなんだ」は「好きなのだ」で、「好きんだ」とか「好きななんだ」なんて言えません。[これ](https://japanese.stackexchange.com/questions/5398/what-is-the-meaning-of-%ef%bd%9e%e3%82%93%e3%81%a7%e3%81%99-%ef%bd%9e%e3%81%ae%e3%81%a0-etc)を見てみてください。
Comment: @vdegenne なんです is a contraction of なのです, the same as んです is a contraction of のです.  なんです cannot be used in the same places that んです can, so they are clearly not equivalent.
Comment: I do not know where you learn that ん is a contraction of のだ but it's not. it's a contraction of  なん
Comment: んです has the same connotation as のです but it doesn't mean it is a contraction from. んです is the contraction of なんです which you will see being used interchangeably if you read a whole story book. The same goes for のです and なのです. (and please use English, it's a stack exchange to learn Japanese, not the other way. Thanks.)
Answer: Actually they are equal --> じゃ(JA)=では(DEWA)Not only you may find 「じゃ、では」ないです, but also「じゃ、では」ありません and their level of formality differs:
じゃない → most informal
ではない → more formal
じゃありません → more formal
ではありません → most formal
では is used in more formal situations. It really depends on the context, who you're speaking to, and how formal you want to be.
For more information on their usage, you can visit [this page]
Comment: Read more closely. He's asking the difference between 好きじゃないです and 好きではない**ん**です.
Answer: 好きじゃないです is
すき(like)+じゃない(not)+です(is)
=do not like
好きではないんです is
好き(like)+ではない(not)+[な]んです(is that)
=do not like
In other words, they are the same.
I would say じゃない is more colloquial though.


Misaligned Mirror on Michelson Inferometer

Question: If one of the outer mirrors on a Michelson interferometer was to be misaligned by a small angle of theta, what would be the shape of the interference pattern in the detector plane? What would happen to this pattern as the other mirror moves?
Answer: You would see more fringes across the detection plane as the angled wavefront interferred with a slight phase difference across the plane.
Comment: Thanks. What do you think would happen to this new pattern if the other mirror was to move as well?
Comment: I'll give you a hint.  It does matter which mirror is misaligned.
Comment: As far as the shape goes, I think that instead of circular fringes, straight parallel fringes will be observed, with separations determined by the angle of tilt of the mirrors. However, I'm still not too clear on the exact nature of that separation effect in regards to the independent movement of each mirror.
Comment: Oops!  Sorry the above comment should read "doesn't" NOT "does".  Fat fingers.
Answer: Misaligning one of the end mirrors will produce a set of vertical or horizontal fringes at the detector plane (depending on the misalignment of the mirror).
The number of fringes is proportional to the misalignment angle of the mirror and inversely proportional to the wavelength of the light. When first setting up the alignment of the interferometer, this effect can be used by adjusting the alignment until the number of fringes is reduced.


How to get a circular layout in codenameone?

Question: If I want to have the layout which has the buttons in the circular form,
how can I achieve that? We don't have circular layout in cn1 and using other
layout managers I don't know how to get the designated design as in the image
below:
Answer: I recall that a while back someone built a circle layout class and posted it but I couldn't find it. You can probably implement it by using the guide for creating a custom layout manager here.
However in this case unless the layout changes it looks like you can reach it with a simple 3x5 table layout with some creative spanning/alignment.
I'm not sure which solution will be harder to implement though, building a layout manager isn't very difficult.


Effects of Active Virus Scanner on WebApp for XS Azure VM

Question: Suppose a public WebApp is hosted on an EXtra Small (XS) Azure Virtual Machine (VM).   What benefits and/or performance problems might visitors experience if a Memory-Resident Virus Scanner is run on that VM?
Answer: they would experience a detriment to response time relative to your VM resources. Beyond that its a guess question. "Some detriment, what specifically is unknown without VM environment specifics"
Lousy albeit concise answer. If you would like a more concrete answer: avail us to more concrete server resource information :D
Good luck sir or madam ! :D
Comment: ok so the assumption at this point is your user's submission will interact with a servlet or something similar which will invoke validation methods / processes. With the assumption that you are using your own antivirus exam OR an external (3rd party) exam - the important part is to acknowledge to the user that the file has been received and is "being processed" (not much unlike Youtube's ) --- therein fork processing to a lesser priority and user experience is maintained as well as security. Threading is important to robust applications
Comment: if you properly fork the processing of files, then you can additionally send the "confirmation" note to end users once the file is processed. In the case of an "image" that seems unnecessary - but if you are dealing with large files in varying formats - you should really just create a trigger to an antivirus application on submission of said file(s) and its actually quite lean on server resources (prioritization is key) .
Comment: Right now, the Azure Price calculator seems to imply that an XS Azure VM behaves like a 1GHZ GPU of unknown architecture with 768 MB of RAM.  The WebApp would be MVC and probably use few resources, but I might be tempted to load the XS VM down with an instance of SQL Server 2008 Express with no reporting services.  I'm wondering if I manually scan most of the content before making it publically available, do I really need the additional overhead of a Virus Scanner to protect visitors.
Comment: ok ambiguity question : "I'm wondering if I scan most WebApp content " --- do you mean "each request processed by the webapp" or is there some form of user submission process you are particularly interested in ?
Comment: If a user *legally* submits a picture or MP3 file to me that she/he created, then perhaps I can scan it on a workstation before allowing everyone else to access it on the server.  I would really like to avoid scanning every file access on the webserver via a modern day Virus Scanner since I *suspect* that would choke an XS Azure VM instance.
Comment: I think you have a good point.  I would probably need to find an Anti-Virus product that allowed me to schedule the scan for a later time and then accept/reject the file.  Thanks for this tip.  If I perform a scan of the entire machine during off peak hours, and scan every content file before it is offered to the user, then I suppose the user is reasonably safe.  In this way, I can probably avoid the overhead of a Virus Scanner that might try to annoyingly run on every Web Request.


Does the structure of water change when a drop of color is added?

Question: If I add a drop of color to water, would it change its structure entirely?
Comment: Can you please clarify and add some specifics? How much water are we talking here? What is the drop comprised of (oil, dye, etc.)?
Comment: There are similar questions about dissolving non-polar molecules in water.
Answer: No it does not change the structure of water.
Yes the H-bonds between water molecules are broken to accomodate the dye molecules. However, liquid water does not have a set shape or fix molecular arrangement. So what happens is,
The dye molecules simply diffuse out all throught and among the water molecules. The dye molecules become hydrated to some extent, that is, the charged groups and areas on the dye molecule interact with water to form H-bonds or polar bonds which allow the molecule to remain suspended among the water.
Source, General chemistry course work.


How to export data from saga or tas into excel?

Question: I want to derive terrain attributes from DEM with saga and whiteBox GAT (SAT). I have problem  in exporting data into excel.
would you help me?
Comment: Can you elaborate on your post a little? Do you want to export your entire DEM raster to Excel or some distribution of derived terrain attributes (e.g. slope)? What exactly is it you're looking to do? Excel is for spreadsheets and so not normally used with raster data. That's why I wonder if it's simply the distribution of an attribute that you're after.
Comment: I want to work on terrain attributes and used them in Spss. so I guess that I should bring them on Excel. Am I right?
Comment: But surely you don't mean that you want to bring an entire raster of an attribute (e.g. slope) into a spreadsheet. Are you aggregating the data in some way, e.g. the average slope for a group of drainage basins?
Comment: yes I want to bring the entire raster attribute
Answer: Okay, here is a solution that will allow you to easily import Whitebox binary raster files into Excel. First, export the raster using the Export ArcGIS ASCII Grid tool (in fact any of the ASCII raster export tools will work fine).

Next, launch Excel and open the file, which will have the same name as your Whitebox raster file but with a .txt extension. A dialog will be displayed like the one below:

Be sure to select 'Delimited', press 'Next', and check the 'Space' box, as in below:

Press 'Finish' and you should be presented with a spreadsheet like the one below.

You can optionally delete the header part of the file contained in the first six rows of the spreadsheet. Please note that if you are working with a larger sized raster, working with the data in Excel may be extremely cumbersome and perhaps even impractical. Furthermore, depending on the version of Excel that you are using (pre-2007) you may be restricted to 256 columns and 65,536 rows.


How to recover files from dead windows using dos?

Question: I am using windows 7. My windows is not loading. I want to recover some files using dos commands, Is that possible anymore?
Comment: Please provide more information.
Comment: I suspect you are trying to boot Windows 7 straight to "DOS", i.e. before loading the GUI, like you used to with Win31, in the hope of using command line tools ("DOS commands") to recover your files. If that is the case, I got bad news for you: Windows doesn't boot DOS and then the GUI since WinXP—some 15 years ago—i.e. your Windows GUI is no longer a DOS application: there is no DOS under Win7.— Even your filesystem (NTFS) is unreadable for DOS.
Comment: @Shiran Maor: If one of the answers was helpful to you, then please consider marking it as the [accepted answer](http://superuser.com/help/accepted-answer) so others may more easily find it in the future. This is also a polite way to thank the person answering your question for helping you out.
Answer: A practical way to do this is to physically remove your hard drive from the PC and temporarily install it in another working PC.
If the hard drive is still intact, you'll be able to navigate and copy all of your files (to perhaps a USB flash drive).
Files in your "My Documents" folder will require that you "take ownership" of that folder, before it lets you copy them.
So, the "down side" is:
1) You need to "borrow" somebody else's PC, who will let you open the case and install your drive
2) If the drive was the cause of the original problems, you might not be able to recover any data
Answer:
I want to recover some files using dos commands, Is that possible anymore?

Yes, that would probably be possible. The creation of a DOS disk which supports NTFS partitions has been discussed in this question. You could use such a disk to boot your computer and then use DOS to access the partition and copy files.
Quoting from Batch file to copy directories recursively (answer by lc.):

To copy all the files and subdirectories (including any empty subdirectories) from drive A to drive B, type:
xcopy a: b: /s /e

However, in my opinion that would be a bit cumbersome. For this reason, I would like to suggest an alternative approach.
Just use Linux :)
As with many of the most common Windows problems, Linux saves the day. You can use UNetbootin to download and install your distro of choice on a USB drive:

For this task, I suggest you go for the lightweight Xubuntu. Reboot your computer and push the appropriate key to show the one-time boot menu. The key varies depending on your BIOS (it might be e.g. F10).
Select the entry referring to your USB key and press Enter. When the live Linux system boots, you will see the drives on your desktop (on many distributions, including Xubuntu) or in the file manager (on basically all of them).
You can double click a drive to open it. Back up the files you need by connecting an external drive.
Bonus tip: you can use the same drive to install Linux and get rid of Windows.


Can I have the same military grade security standards with Fedora than Red Hat?

Question: Can I have the same security Government Standards with Fedora than with RedHat?
Comment: It's hard to say if Fedora is more or less secure than RedHat. RedHat is made from Fedora, so in Fedora you have all functionality of RedHat.
Answer: First, there is no such thing like "military grade security" except for marketing. And since this is not a protected phrase you'll find this claim often in products which primarily consist of shallow claims without providing adequate security.
My guess is that the "government standards" you refer to are actually certifications like Common Criteria or the approval for use inside a specific classification level like NATO restricted, top secret or similar.  And this case the answer is that these certifications and approvals are only apply to the specific tested product version and do not apply to similar products. This means that any certifications for RHEL do not apply for CentOS although it is mostly the same and do not apply to Fedora which is already very different from RHEL.
And even if you use a product which got specific certifications or approvals you have to carefully read what is actually covered and how the product should be used in a certified/approved way. Usually only some functionality of the product is covered and only when used in a specific way or specific environments.
Answer: In addition to the other answer, "Military grade" security often refers to set the configuration settings of the machine to specific approved settings "hardening". Given the military context, my guess is a requirement for FISMA configuration hardening. There are a number of different security benchmarks available. DISA and NSA are examples of agencies with their own configuration standards.
NIST's webpage "Managing Security Risk by Using Common Security Configurations" contains a number of different Federal security configurations that you can implement.


Large loft area cooling

Question: I believe the dimensions of the room are about  36' x 12'.  It is the upstairs room, and has a loft looking out to the front room.  In the summer it is almost impossible to cool down, the air vents are in the floor.  Does anyone have any recommendations on cooling this room off?  I do own the condo, and there is a small window at one end of the room.  We have two ceiling fans in the room, but they don't seem to do much to help.
Comment: What sort of climate are you in, and is there insulation above the ceiling of this loft space?
Answer: You need to raise the returns to near the ceiling and possibly add more supplies and returns. A picture of the return and supply registers would help determine just how hard it will be to raise the  returns. Also, can this room be isolated from the lower level or is just an open stairway. In some of the condos near where I live it is not possible to maintain a comfortable temperature in these upper rooms without a 2nd dedicated unit due to the homes construction.
Comment: Sorry, I didn't intend to downvote, and it's not letting me reverse it.

Large loft area cooling


Arbitrariness and coinages

Question: What is the relationship between arbitrariness, as a property of language, and coinages? Because coinages are compound not-arbitrary words, do they not correspond to the particular property of language?
Comment: Welcome to Linguistics SE! *Arbitrariness* refers to relation between sound and meaning, and from this point of view compounds are just as arbitrary. What is (more or less) regular about them is the rules of combination and semantics of the relation between the parts.
Comment: Thanks for the information! I thought compounds were not arbitrary! So, motivated words are considered to be arbitrary?
Comment: What is a 'motivated word'?
Comment: A motivated word is a new word or a new sense of an existed word. For instance, the word ''google'' which is now used as a verb.
Answer: This is a good question because it reveals the problematic nature of the arbitrariness axiom in modern linguistics.
The relationship between sound and meaning is indeed arbitrary when you look across languages. What is dog in English is hund in German. What is 'pig' in English is 'Schwein' in German. There is no inherent relationship between them. When you put them together you get 'pigdog' and 'Schweinhund', and because the relationship between sound and meaning is arbitrary, you get a pig hunting dog in English and an insult in German. (Although calling someone a 'pigdog' in English is also insulting, it's not a very common one.) But even in the case of perfect calques, e.g. Czech časopis [magazine] is formed exactly to follow the form of the German Zeitschrift (lit. time-writing), the relationship between the sound and meaning is arbitrary cross-linguistically or even intralinguistically. The sound for magazine in both languages could have been totally different. This holds even for onomatopoeic words which are motivated by the referent but still fairly arbitrary across languages (e.g. compare the word for cock crowing across languages).
However, while this principle is obviously (axiomatically) correct, it is not very informative. Even Saussure (who first proposed it) noted that native speakers often associate the sounds with meanings as if they were natural. This was later confirmed by various research in phonosemantics. The logical arbitrariness co-exists with universal tendencies in sound meaning as well as language-internal processes of aesthetic associations between sounds and meanings. This is much more interesting and useful to study than the relatively uninformative arbitrariness axiom. Of course, it is important to remember that it was established in a context of theories proposing essentialist connections between sound and meaning which are easily disproven by the data.
The sort of thing you're describing is not usually a case of sound symbolism but simply the semantics of compounding which will always be somewhat motivated (although in many cases, the original meanings will be opaque to most speakers).
Comment: People view the link between the sound and meaning as natural because they've been trained to do so since the childhood. As linguist Pavel Eisner wrote in 1946, at the beginning of "Temple As Well As Fortress", we intuitively think that everyone has to speak Czech. After the folks in Paris and London fulfill their daily quotas of the difficult speech in French or English, they return home and begin to talk Czech like everyone else. ;-)

Arbitrariness and coinages


Java process, swap (/proc Solaris10) memory highly utilized

Question: How can I analyze high swap memory utilization of Solaris 10 for Java processes?
Answer: A good way to start is start looking at Using DTrace for Solaris 10

http://dsc.sun.com/solaris/articles/java_on_solaris.html
http://www.solarisinternals.com/wiki/index.php/DTrace_Topics_Java
http://blogs.oracle.com/jimlaurent/entry/solaris_faq_myths_and_facts
http://blogs.warwick.ac.uk/chrismay/entry/solaris_10_memory/
http://www.solarisinternals.com/si/tools/memtool/vmsizing.pdf
Answer: You will propably have to look at what the garbage collector is doing.
SDN has a nice technical article about it (and how to enable debug for gc).
A nice practical approach is described here. We normally use the mentioned gcview for this task (on Linux, but OS should not matter in this case).


How to find the front-to-back ratio given an antenna radiation pattern diagram?

Question: I know that the front-to-back ratio is 18dB in the below antenna radiation pattern diagram, but I don't know how to read the diagram to obtain this result. How does one read and understand such diagrams?
Answer: The diagram is a polar plot where 0 degrees (the 0 on the right-hand edge) corresponds to the front of the antenna and 180 degrees corresponds to the back.
Within the diagram, a logarithmic scale is utilized to represent radiation strength. This is in addition to the fact that the Decibel is a logarithmic unit. (The diagram really should explicitly list its units, but for the application of antenna radition, the unit is typically dB.) You can tell that a logarithmic scale is in use by observing that the distance between the $-6$ and $-12$ lines is the same as that between the $-12$ and $-24$ lines, so it's obviously not a linear scaling.
For the front-back ratio, we look at the values indicated on the plot for 0 and 180 degrees. In this particular instance, the value at 0 degrees is $0$, and the value at 180 degrees is approximately $-18$.
Since logarithmic scales transform division into subtraction, we calculate the ratio front to back by subtracting the logarithmic back value from that of the front.
Since $0 - (-18) = 18$, the answer is 18dB.
Comment: If the scale is non-linear *in decibels*, wouldn't that make it a log-of-log scale (however you actually call that)? A log scale marked in decibels should have evenly spaced numbers, no?
Comment: Excellent answer, I would upvote but the system won't allow me  to.
Comment: @KevinReid You're right that the overall representation is actually a log-log scale once you factor in that dB are already logarithmic. However, the scale of the plot is relative to its units, so the plot is merely logarithmic, while the overall representation is log-log.
Comment: The scale looks anti-log to me. That is, if we move 5mm away from the origin, maybe the value changes by X. If we move another 5mm away, the value changes by *less* than it did the first time. This is the *opposite* of a log scale. This serves to cancel the logarithm of the decibel, meaning this is actually a *linear* plot. A F:B ratio of 2:1 would mean the back is twice as far away from the origin as the front, as measured by a ruler.


Airport transit visa requirement for a Bangladeshi national flying from London to Toronto over Paris

Question: I am a Bangladeshi national traveling from London to Toronto, Canada through CDG Paris, France by Air France. My transit time at CDG is 4h55m. Do I need an airport transit visa for this travel?
Comment: `ATV` = airport transit visa?
Comment: What sort of visa do you have for Canada?
Answer: All the rules are explained in Do I need a visa to transit (or layover) in the Schengen area?
Citizens of Bangladesh do require an airport transit visa (ATV) in France and elsewhere in the Schengen area but since you are traveling from the UK to Canada, it's safe to assume that you have either a residence permit or a visa for each of these countries and any one of these documents would exempt you from the ATV requirement. If that's indeed the case, you don't need a visa for this connection.


Why can't I move object?

Question: I'm beginner and I don't know what I clicked to make it happens.
I can't neither move nor scale object, but the orange dot at the center of object.
Help please
Answer: Uncheck "origins" (which is to move the object's origin only, the orange dot is the origin):

When objects have this colored X/Y/Z arrows that means this option is activated.
This options corresponds to the Ctrl. shorcut.
Comment: Thank you so much! Perhaps I used the short cut.

Why can't I move object?


How can I disable or shorten cut sequences in FIFA 13?

Question: One thing I've noticed in FIFA 13 is that the duration of cut sequences when you change a player is really long. This is really getting on my nerves. I don't want to watch a guy holding up the numbers or player walking around for 5 or 6 seconds, especially in multiplayer. Is there a way to configure the duration of these sequences, or turn them off entirely? I haven't found any settings for this yet, but maybe there's some sort of hack to disable them. Any help is appreciated.
Comment: Actually, there are other things in FIFA 12 that got a lot more annoying in 13, like the news pop-ups in career mode.
Answer: Sadly (although annoying) you can't , they need these long cut scenes to load the player models in subs etc.. Or else it would just be a black screen for a few seconds. Frustrating I know.. I found if you make 3 subs at a time , it usually just loads for a second without showing the cut scene.
Comment: This sounds reasonable, although it takes like two seconds on my box to start a game, where it loads the stadium, the players and all the textures. FIFA really isn't heavy. Look at stuff like World of Warcraft instances or even cities. There's far more things to load and that is fast as hell on a decent machine. I feel this is just really annoying. But it looks like we can't do anything about it. Thanks a lot for your thoughts!


Roots of not-necessarily reciprocal polynomials

Question: Consider (irreducible) monic polynomials with integer coefficients which satisfy some fixed linear condition $L$ (for example, the coefficient of $x$ is $1,$ or something more complicated). The question is whether the set of real roots of such polynomials is dense in $\mathbb{R}.$ My previous question is for a particular such $L.$ For simple conditions like $a_0 = 1,$ or, indeed, any fixed subset subset of the coefficients fixed, it is known (by the work of S. D. Cohen)  that the Galois group of such a polynomial is the full symmetric group, but this is almost certainly completely irrelevant.
Answer: In general, the answer is yes (unless the linear condition is like $1=0$).
We want to a find an irreducible polynomial $f(x)=\sum_{k=0}^N a_kx^k$ with a root in the interval $(\alpha,\beta)$. Without loss of generality $\alpha,\beta$ are algebraically independent over $\mathbb{Q}$ (else change them a bit). We try to choose $f(x)$ so that $f(\alpha)<0$, $f(\beta)>0$. Note that $f(\alpha)$, $f(\beta)$ are linear forms in coefficients of $a_0,\dots,a_N$ with linearly independent coefficients. For such forms the pairs $(f(\alpha),f(\beta))$ are dense on $\mathbb{R}^2$. We should also care that $f$ is irreducible. This should be doable by a priori fixing all coefficients modulo some $p^2$ ($p$ is prime) and using Eisenstein criterion for irreducibility.
Well, let me now be more specific.
Claim. Assume that numbers $a,b,c,A,B,C,1,aB,bA,aC,\dots$ are linearly independent over $\mathbb{Q}$. Then the subgroup $G:=\{(ax+by+cz,Ax+By+Cz),x,y,z,\in \mathbb{Z}\}$ is dense in $\mathbb{R}^2$.
Proof. Note that all points $P(x,y,z)=(ax+by+cz,Ax+By+Cz)$ are mutually different. Choose large integer $R>0$. There are $R^3$ such points for $0<x,y,z\leq R$, and they lie inside a circle of radius, say, $10R$. Thus there exist two points which we are $O(R^{-1/2})$-close. So, our subgroup $G$ contains arbitrarily small vectors $v_1,v_2,\dots$, $\lim \|v_i\|=0$. Next, we may assume that directions of $v_i$ converge to direction of some unit vector $u=(\alpha,\beta)$. It follows that the closure of $G$ contains the whole line $\mathbb{R}\cdot u$. Now consider $G$ modulo this line, that is, consider the set $M:=\{\beta(ax+by+cz)-\alpha(Ax+By+Cz))\}\subset \mathbb{R}$. It suffices to prove that it is dense in $\mathbb{R}$. Indeed, this would just mean that the closure of $G$ contains a dense set of lines parallel to $u$. $M$ is not dense in $\mathbb{R}$ if and only if numbers $\beta a-\alpha A$, $\beta b-\alpha B$, $\beta c-\alpha C$ have rational mutual ratios. In other words, $\beta a-\alpha A=\lambda q_1$, $\beta b-\alpha B=\lambda q_2$, $\beta c-\alpha C=\lambda q_3$ for rationals $q_1,q_2,q_3$ (not all of $q_1,q_2,q_3$ are zero) and some real $\lambda$. Regarding this as a linear system on $\alpha,\beta,\gamma$ we see that a determinant $\det \pmatrix{a&-A&-q_1\\b&-B&-q_2\\c&-C&-q_3}$ does vanish. This contradicts to our assumption on linear independence.
Comment: I think you're assuming that the class of polynomials has at least two degrees of freedom. The values aren't always dense, but do reach each quadrant because they are a subgroup of $\mathbb R^2$ not contained in any line. If there are three degrees of freedom it will be dense.
Comment: Why is the statement about pairs of linear forms being dense in $\mathbb{R}^2$ true?
Comment: But notice that requiring Eisenstein mod a FIXED prime kills another degree of freedom. Presumably, being able to vary the prime gets around this, but this  is not 100% obvious.
Comment: I think, it does not kill degree of freedom, because you fix only remainders, while partial quotients are free integer variables. In any case, if I understand the question correctly, we have as many degrees of freedom as we need.
Answer: If being monic is not required, then the real roots of  cubic polynomials with coefficient of $x^2$ zero will be a dense set in real numbers.
Just take  one irreducible cubic polynomial $f(x)=x^3+px+q$ with one real root $b$, and two (possibly complex) other roots $\alpha,\beta$. The the set of
polynomials with roots $rb,r\alpha, r\beta$ with $r$ running over all the rational numbers will have minimal polynomial of the type $f_r(x)=ux^3+vx+w$, for some integers $u,v,w$. As the set of rational multiples of a fixed non-zero number is a dense set we are done.


Multiple instances of custom View with onClickListeners, general feedback

Question: I've got an activity with several instances of a custom View. This custom View is passed an object, and the contents of this object will decide how the View is displayed.
Also, when the View is created, an OnClickListener is added to it. The previously mentioned object is passed on to this onClickListener through a contructor and private variables, and inside the listener I've got a switch statement which will handle the OnClick differently depending on the object-data.
Is there anything fundamentally wrong with my approach? Would it be better to have several OnClickListeners, and add the correct one from the View, instead of evaluating the object inside the OnClickListener, thus reducing the size/memory footprint? I'm guessing all the onClickListeners will be loaded as objects in memory once the activity loads?
Maybe I should access the object and context through the view that is passed to onClick instead of passing them as arguments (and duplicating them?), however I'm struggling with acheiving this...
I'm basically looking to optimize CPU and memory usage. The program runs fine as is.
Answer: You may check this out:
How to test the performance of an Android application?
For memory:
Try to avoid (lots of) "new ..." calls. The more u create the more the GarbageCollector has to clean up afterwards. This create/cleanup needs a lot of performance.


launch orientation of iPad is incorrect for landscape orientation (upside down)

Question: I read a few different posts on the orientation on launch, but I'm still unsure how it works.  We are only supporting landscape orientation.  In didFinishLaunchingWithOptions, I do:
    HomeController *myHome = [[HomeController alloc] initWithNibName:@"HomeController" bundle:nil];
    myHome.navigationItem.title = @"Your Dashboard";
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myHome];
    [myHome release];

    self.navigationController = navController;
    [navController release];
    self.window.rootViewController = self.navigationController;

In my HomeController class:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

When I start the app however on the device, it can start upside down.  How do I avoid that from happening?  I saw some posts on people detecting for the status bar orientation in didFinishLaunchingWithOptions.  If I do this after the self.window.rootViewController = self.navigationController; code:
NSLog(@"%i", [UIApplication sharedApplication].statusBarOrientation);

I always get 3.  From there, I'm not sure what I can do to fix the upside down issue.  Thanks.
Answer: I think you need to specify the supported orientations in your Info.plist.  See the Supported interface configurations and Supported interface configurations (iPad) in your Info.plist.