How does Ubuntu get away with reading FAT32

Question: I read here that Microsoft makes $5 to $15 on every Android device sold because Android can read the FAT filesystem.  Ubuntu can also read the FAT filesystem but no payment history to Microsoft exists.  What is the difference?
Answer: This is more of an issue with exFAT, not FAT.

exFAT is the Microsoft-owned proprietary filesystem that Android (and any other device) need to license from Microsoft in order to support.
FAT (eg FAT32 + VFAT) is free to implement and implemented pretty much universally, including in Ubuntu.

One of the notable benefits of exFAT over FAT is its support for individual files larger than 4GB, an essential feature for video recording applications.
The most notable drawback, obviously, is its proprietary nature, giving a Microsoft tax to every device that implements the standard.  It is an essential part of the SDXC standard, meaning that devices that support SD cards over 32GB have to pay money to Microsoft.

Edit: after reading the actual article, I realise now that the article itself suggests that vendors are paying to use even FAT (not exFAT).  Sorry for assuming that was your own confusion.
However, the point muru made in his answer still stands: the free software implementations of FAT (including the implementation in Linux, the kernel used in Android) are not subject to Microsoft patents because they don't implement the patented algorithm for maintaining long filenames and 8/3 letter filenames side by side.
The article even admits it can only speculate, and I think it's probably wrong, for the above reasons.  Or, at least, perhaps it does not have the full story: it's possible that these vendors are licensing other technology from Microsoft and the contract they have with Microsoft just happens to also bundle in some FAT technology even though they don't need a license for this.
Comment: How can Linux/FOSS not maintain long filename and short filenames side by side? The long filename entries do not contain any information about the size, date, or starting cluster of the file. Long filename matching works by scanning for a sequence of long filename fragments, which are followed by a short filename for the same file which contains all of the metadata and a short version of the filename.
Comment: Microsoft's implementation keeps the short and long filenames in sync, so the short filename is based on a truncated form of the long one.  However, the short filename is not used anymore except in obsolete operating systems so the Linux implementation simply does not generate meaningful short filenames.  I don't know if this means they leave the short filename blank or put a meaningless code there.
Answer: More specifically, the exFAT filesystem. That's because exFAT is part of the SDXC standard, and device vendors have to support it if they are going to allow external memory. The FAT patent that the article talks of only ever came into play against TomTom, IIRC. Linux in general is able to avoid the FAT patent on a technicality, according to this linux.com article.


How can I check the origin of a Token?

Question: A smart contract minted a Token and send it to my wallet, after a time has passed how can I check if that smart-contract in specific did mint the token?
Answer: the token is present in your wallet as "<policy-id>.<token-name-hex-ascii>"
if you want to check only for a specific smart contract (minting policy) to be the one which minted the token just get the hash of the smart contract and compare it to the "<policy id>"
if the minting policy hash corresponds to the policy id then that's your smart contract
if that is not the case but you still want to know which smart contract was used you could do the following:

check the transaction that sent you the token

if that transaction did not mint the token then that token must have come from somewhere else

(go to 1) going back you'll find a transaction that minted the token and in that transaction, the smart contract (minting policy) must be included in order to be executed. here is your smart contract

How can I check the origin of a Token?


When onAfterElementSave is called check for save as draft or publishing?

Question: Is there a way to detect if a entry is being saved as a draft vs being published so when onAfterElementSave is called, so I don't save data to the database when it is a draft.
Answer: Actually, onAfterElementSave doesn't get called at all when saving a draft, so there's nothing to worry about.
When you load a draft in the CP, your field type will be passed in a $value based on the POST data for the field back when the draft was last saved (which is the same thing that happens when saving an entry fails due to validation errors).
Comment: @aran Is that for a brand new entry? In that case it will get called, but it won't matter because the entry will be disabled and there's no chance you'll be overwriting existing data for the entry.
Comment: For some reason that method is being called in my plugin when I save the entry as a draft. I am using "Craft Pro 2.2.2596".


Duplicates in feature matrix

Question: I have several points which appear duplicates in the feature matrix (same values for the features). These points may have different values of the target variable. What is the appropriate way to handle this case during train test split? Should I just ignore the problem and go on with random split or remove duplicated points ?
Answer: It depends on what does a duplicate mean in your data.
If your features contain identification variables (for example, transaction number, student ID, etc), then duplicates are just copies of a same sample. In this case, if their target values ($y$) are the same, you should remove the duplicates. If they have different $y$'s, then this sample is problematic, and you should probably consider removing them altogether.
If your features does not contain identification variables, then it is totally possible that samples with the same feature values are different samples, and therefore possible to take different $y$'s. In this case, you don't need to do anything special.
Comment: Good suggestions for dealing with original data. It should be noted that in bootstrapping (often a better way to proceed than with the separate training and test sets proposed by the OP) you will necessarily end up with many "duplicate" cases in each bootstrap re-sample, duplicates that are _not_ to be removed.
Comment: In my case duplicates come from the fact we only partially observe the data: (for example another feature or an id which would help differentiating the rows has been omitted) in such a case I was wondering if removing duplicates may speed up training ...

Duplicates in feature matrix


How to create PRJ file for selfmade polygons in ArcMap?

Question: I have made a floodmap in ArcMap 10.4 and I would like to export it to ArcGIS Online. I tried, but it keeps saying ....shp can't be exported because it has no prj file. How do I create a prj file from normal shapefiles?
Answer: The .prj file will be created automatically if you define your shapefile's coordinate system, either by

opening its properties in ArcCatalog/Catalog window: Double-click the shapefile to open its properties, click the 'XY Coordinate System' tab and select the appropriate coordinate system.

or by using the Define Projection tool.

Both methods require you to know what the coordinate system of your shapefile is, of course.
Comment: and of course, assume that the user knows what coordinate system the data is in!


Manga/Manhwa where the female lead is either transported into a novel/game she read before or or goes back in time on repeat

Question: During the novel there's a scene where a male character tries to help her increase her power ability and during that, he has to snap her out of it because her ability is unlimited which is dangerous, her hair turns white during this scene. She had brown hair if I'm correct. This all happens at a school in the story too if that helps
Comment: Hi, welcome to the site. Was this in full colour or mostly black & white? Was the story set in the modern world or centuries in the past? And can you tell us anything else about the plot, or any other characters?
Answer: This is I'm No Heroine!, aka I Will Politely Decline the Male Lead!.

A girl obsessed with a novel suddenly finds herself transported into the thick of the plot. The problem is, she has taken on the role of the villain in the story. And she knows how this ends…it's off with her head! Maybe she'll just let this play out and wake up back in reality… But after a few too many deaths to no avail, it's finally time to go off-script. She's going to have a little fun with this tale. She's made up her mind…to live!

The cover image shows her normally brown hair. The main character reincarnated in a book she read and decided to act out her role as a villainess. She dies at the end, as in the original story, but returned to the start of the story instead of returning to her own world. Then she dies again, and the comic takes place in her 3rd life within the story.
The scene with the white hair is in chapter 10. A mage from the tower is helping her tap into her magical potential for the first time in her three lives. It turns out that she has no restriction on the amount of her magic she could draw, while most people will stop before it causes physical problems.


Did the "Last Emperor" really find a live pet cricket when he returned to his throne in the Forbidden City?

Question: In the 1987 film The Last Emperor, Pu Yi is removed from power and taken away from the Forbidden City. As a child, he had a pet cricket that he kept in a tiny cage in a secret compartment in his throne. Pu Yi returns as an adult and finds the (60 year old!) cricket alive and well in the secret compartment in the old throne. How did that work? Did he imagine the cricket to be alive, or was there somebody behind the scenes that maintained the old throne and its tiny resident(s) so that there was always a live cricket in the cage inside the throne? Or is there another explanation?
Comment: Are you sure this isn't just a device? Logically, there is no way a cricket could survive, as @Liath explains. It would make more sense that the cricket living symbolizes the emperor living on. Just a thought.
Comment: I believe crickets only live a few weeks, also it's my understanding that they reproduce sexually so unless their were a pair it couldn't be a descendent.
Comment: Unless it's REALLY REALLY cold in the throne room!
Answer: Crickets are not long-lived, with a lifespan of only around three months. The use of the insect is symbolic. The cricket was kept as a pet in a cage, a situation not unlike Pu Yi's, as he was caged within the Forbidden City. The symbolism of the cricket in the final scenes could be interpreted in a multitude of ways:

The release of the cricket is a metaphor for the freedom that Pu Yi enjoyed as a simple gardener unfettered by the weighty duties of Empire. It provided him with some closure.
The fact that he proved to the boy that he was indeed the Son of Heaven by showing him the secret compartment, indicates a vain yearning for days of glory and power. The presence of this flicker of nostalgic yearning is confirmed by the fact that the cricket is still alive.
The release of the cricket could also symbolise the release provided by death, accentuated by the sudden disappearance of Pu Yi from the room. The visit as a tourist was something of a final goodbye.
By handing over the cricket to the young communist guard, the Last Emperor is handing the baton of power (and all that comes with it) to the next generation.

It's up to the audience to decide which interpretation is the best fit. But what is certain is that the scene is symbolic.
Answer: This is only a guess, but I think the cricket (kept in a box by Henry Pu Yi) was a metaphor for China. Even though Henry Pu Yi's life was transformed by the end of the monarchy in China...and China was transformed...my interpretation of the cricket scenes at the beginning and the end of the movie is that the cricket represents China...specifically China's transformation into Red China. Even though China went through political upheavals, a devastating civil war, World War II's carnage, China survived. The cricket is China itself.
Answer: Quite what the makers of The Last Emperor intended to symbolise by the cricket I shall leave for others to dwell on, but it's worthy of note that The Imperial City was lousy with insects and the real Pu Yi developed an interest in them at an early age, as he mentions in his autobiography, From Emperor to Citizen: The Autobiography of Aisin-Gioro Pu Yi, on which the feature film was based.

Up to the age of ten I was far more interested in a big cypress tree
that grew outside the Yu Ching Palace than in my books. In summer
there were always ants crawling up and down this tree. I got very
interested in them and would often squat by their tree so absorbed in
watching them or feeding them crumbs of cake and helping them to move
their food that I would forget my own meals. Later I developed an
interest in crickets and earthworms, so I had many an ancient
porcelain bowl and urn brought over for me to keep them in. I was
never very keen on my schoolbooks, and when reading them became
intolerably tiresome my only thought was of going out to see those
friends of mine.

Crickets are, as has been noted, not long-lived. Any that he found in childhood would have long since died.


MarkCompactCollector: young object promotion failed Allocation failed

Question: I have cloned a git repository containing a Vue project locally using git clone.
I then ran npm install to install the dependencies and got the node_modules folder.
On running npm run serve I get the following error:
[11920:03BEA178]   321556 ms: Scavenge (reduce) 429.1 (464.7) -> 429.1 (464.7) MB, 37.7 / 17.8 ms  (average mu = 0.980, current mu = 0.932) allocation failure
[11920:03BEA178]   321643 ms: Scavenge (reduce) 429.7 (465.2) -> 429.7 (465.2) MB, 61.2 / 0.9 ms  (average mu = 0.980, current mu = 0.932) allocation failure
[11920:03BEA178]   321765 ms: Scavenge (reduce) 432.2 (467.3) -> 432.2 (467.3) MB, 22.1 / 0.0 ms  (average mu = 0.980, current mu = 0.932) allocation failure

<--- JS stacktrace --->

FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! email@example.com serve: `vue-cli-service serve --open`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the firstname.lastname@example.com serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\sagar\AppData\Roaming\npm-cache\_logs\2020-12-10T09_32_00_595Z-debug.log

Also, my node_modules folder is about 8GB in size. I'm running this on a convertible with 2GB RAM.
Answer: The way I managed to get past this error was by turning off minimization for TerserPlugin in webpack.config.js as follows:
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
optimization: {
    minimize: false,
    minimizer: [new TerserPlugin()],
  },
};

This might not work for everyone as, in my opinion, this error occurs when the RAM isn't sufficient. I didn't have to set minimize to false when I ran the app on a laptop with 4GB RAM with much more hard disk space. You can set minimize to false in the development stage and set it back to true when the app is production ready.


In MVC3 where does the Add View dialog get its model classes?

Question: Stumbled up one curiosity that i researched upon but found no exact answer whatsoever. I was adding a view to my mvc project when i noticed that when mentioning the model for the view lots of classes appear to wich i have no reference in a direct way. For example i can see in the add view dialog all the ClosedXml classes for excel but that dll is referenced in my Bussines Logic project, not in the web project for sure. So 1. why does it appear in the models dropdown in the add view dialog? 2.Should this list not be composed only of classes from the models folder? Sorry if this is a silly question but nevertheless no one could give me a straight answer.
Answer: All public classes that are part of the current solution appear in this list, not only those that are declared in a Model folder in the current assembly. Even classes in referenced assemblies will appear. Some classes will be filtered out though:

Types ending in Controller (to avoid seeing your controllers in the list)
Types declared in the System or Microsoft namespace
Comment: Thank you, the documentation is theoretically zero on this question.
Answer: Besides of the answer of @DarinDimitrov

For example i can see in the add view dialog all the ClosedXml classes for excel but that dll is referenced in my Bussines Logic project

It seems Visual Studio iterates over all your references, so I assume you do have a reference to your business component in your MVC project
Now the reason?, well that's because you could practically use any public entity as your model

2.Should this list not be composed only of classes from the models folder?

NO
A model in MVC is a simple class to represent your view, please do not get confused about your current Domain Model. They used the same term but a model in MVC is just that, a simple class to represent your view and NOTHING MORE
With that in mind, you could use any public class as your model.
I think that's the reason behind although, I rarely use that option in Visual Studio because often it takes too much time to display the content of the list, so I prefer to set the model manually


is sharing a paid product that I got for free from someone and again sharing/leaking that same product with someone/everyone else haram?

Question: this is a digital downloadable product. Like a cracked file/product.
Comment: Try rephrasing questions like this in simpler English, such as "*Is it wrong to receive and pass on stolen property?*".  When euphemisms, such as "that I got for free" are eliminated, the answer will usually become much more obvious.
Answer: We read in the Holy Quran (An-Nisa 29)
يَا أَيُّهَا الَّذِيْنَ آمَنُوْا لَا تَأْكُلُوا أَمْوَالَكُمْ بَيْنَكُمْ بِالبَاطِلِ إِلَّا أَنْ تَكُوْنَ تِجَارَةً عَنْ تَرَاضٍ مِنْكُمْ
"O you who believe do not consume wealth between you through falsehood; except, that it is trade/commerce which you are mutually satisfied with."
By this, we are bound to a commercial treaty that is fair and voluntary. In the case of a software, where the developer would grant a paid licence, using the software without that license is not a trade or commerce both are mutually satisfied with and it's thus haram.


Any way to set profile pic using FB  for Android App (1.8.1 on ICS)?

Question: I've resorted to the FB Mobile site which isn't a bad compromise really, but I was going a little crazy trying to find the option within the FB App, just wondering if it exists?
Comment: The Facebook app has been completely re-written and is now on version 2.2.1. Is this question still relevant?
Answer: Yes, there is a way to do so in the mobile app.
I am using Facebook App Version 1.8.1 on a Motorola Droid 3.
The process I did to set a picture as my profile picture was as follows:

Started Facebook
At the top left there was an icon with 3 horizontal dashes that brings up the different sections of Facebook, I browsed down to the "Photos" section under Apps.
I selected a photo out of my list of Photos (It would not let me select the option on anyone else's photo; so I assume it must be one uploaded into your account).
I used my phone's physical Menu button to open the Facebook menu.
I hit the "More" arrow button to list more options in the menu. One of these extra options was to "Make profile picture"

It  may be slightly different on your device; however it is possible to do this in the latest Facebook version on the desired photo.
Comment: Hmmm thanks for trying :) - I don't appear to have the "Make profile picture" option in #5.

I'm running it on ICS however which I suppose could be the difference although it is still 1.8.1.
Comment: That is odd, works on gingerbread and honeycomb...
Answer: For honeycomb you could go into pics on your phone and hit set as and Facebook profile was an option. Now that my phone has ICS, it only gives me the option of setting as wallpaper or contact photo. With ICS you can only set profile pic from pics already on Facebook, but not upload from pics on phone. It's very annoying.
Comment: Once you have added a photo to Facebook it's very easy. Just open the photo (in Facebook), tap the "More" menu, and choose "Set as profile photo".


How to change Drupal's default language programmatically?

Question: I am trying to change the Drupal's default language programmatically  but haven't found the codes/function. Any suggestions?
Comment: At a guess... `$langs = language_list('enabled'); variable_set('language_default', $langs[$some_langcode]);`
Comment: @Clive, close, but not quite.  See my answer for the correct code.
Answer: Here is a corrected and tested version of the code posted by @Clive in a comment to the OP:
$langs = language_list(); // Note: No argument
// debug($langs, '$langs');
$langcode = 'en';
variable_set('language_default', $langs[$langcode]);

The code snippet above assumes that the two-character code that you assign to $langcode is enabled.  Uncomment the call to debug to see the languages that are enabled on your site and what array indices they use.
Note that the setting will not take effect until the next page load.
Answer: I have found the code and its pretty simple .
//Set Default language
    $default_language = array('language' => 'en-US',
                            'name' => 'English',
                            'native' => 'English',
                            'direction' => LANGUAGE_LTR,
                            'enabled' => (int) TRUE,
                            'plurals' => 0,
                            'formula' =>'',
                            'domain' => '',
                            'weight' => 0,
                            'javascript' => '');
variable_set('language_default', (object) $default_language) ;

Answer: By implementing the following hook: hook_language_negotiation_info()
and here is a full example
http://tassaf.moriamedia.com/drupal-7-default-language-after-translation/
Answer: Just setting the variable is not always enough. By the time you've done so, the Drupal language negotiation function may have already run, and it will not react to this variable change. The proper way to do this is as follows:
// Get the list of languages
$languages = language_list();

// Set up the new language code
$new_lang_code = 'fr';

// Make sure the required language object is actually set
if (isset($languages[$new_lang_code])) {
  // Overwrite the global language object
  global $language;
  $language = $languages[$new_lang_code];
}

This has been documented in other questions such as:
function to change language object
An additional option is to write your own custom language negotiation hook:
https://api.drupal.org/api/drupal/modules!system!language.api.php/function/hook_language_negotiation_info/7


Visa or not visa uk 2020

Question: I would like to know if  people need visa  to stay more than 3 months in the UK during the transition period.
My friend is  planning to travel there for 6 months.
He is spanish.
Answer: No.
An EU citizen wishing to travel to and remain in the UK for any period of time may do so during the transition period (currently until the end of 2020) in the same way as when the UK was a full EU member.
https://www.gov.uk/guidance/visiting-the-uk-after-brexit says

If you're an EU, EEA or Swiss citizen What you'll need to enter the UK
  will not change until at least 2021.

You can always use the following website to check if you need a visa or not (for any nationality)
https://www.gov.uk/check-uk-visa
Comment: In case you get a visa even if you are eu national

Visa or not visa uk 2020


Use Apple Watch as a handheld Keynote remote?

Question: I have to give a 5-minute Keynote presentation from my MacBook Pro in a few days, and while I'd love to not carry my phone around as a remote, I'm also not a fan of the idea of tapping my wrist every time I need to change slides. Is there a way to use my Apple Watch as an always-awake Keynote remote that I can hold in my hand rather than needing to keep on my wrist?
Answer: You'll need to set up the iOS version of Keynote on your iPhone to be a remote control for Keynote on either another iOS device (such as your iPad) or your Mac. To do this, perform the following steps:

On the device that you'll be using to present from, open the remote control configuration:
On iOS, this feature is located in Remote | Devices | Add a Device
On OS X, this feature is located in Keynote | Preferences | Remotes (Ensure that the Enable checkbox is checked)
On the iPhone paired with the Apple Watch, open Keynote and select Remote | Devices | Add a Device
On the Mac or iOS device you'll be presenting from, select the Link button beside the remote device that you wish to use to control presentations
Verify the code shown on the screen, then complete the setup

Once this initial setup has been completed, open the Keynote app on your presenting device and begin a presentation.
On the Apple Watch, launch the Keynote app. Once the app launches, it will search and connect to the paired Mac or iOS device used for presentations. You'll get a Ready message (Figure A) when you're ready to control a presentation. When you see this message, it means that you can open the presentation on your Mac or iOS device that you'll be presenting.
http://www.techrepublic.com/article/pro-tip-how-to-use-the-apple-watch-to-control-keynote-presentations/
Comment: Thanks for your answer, but the question was not about setting up the watch to use as a remote, but rather to use it in the hand instead of having to keep it on the wrist.  The watch will lock if not on the wrist so the OP is looking for a work around.


Creating icons for QGIS plug-in

Question: I have developed a plugin for QGIS. It has two buttons and I have to add custom icons for it. How can I create custom icons for this?
Comment: Thank you Kadir for editing,
Answer: It should be rather easy to create custom icons for your QGIS plugin: It is common to create them as SVGs as they are vector graphics and scale with the resolution of the monitor. You can use OpenSource tools such as Inkscape and also proprietory software like Adobe Illustrator to create the icons.
In a second step you just have to include the svg files in your plugin directory (I put it into the folder 'icons'). Then you register the specific svg file in your algorithm by implementing this method:
<code>    def icon(self):
        return QIcon(os.path.join(pluginPath, 'PLUGIN_DIR_NAME', 'icons', 'icon.svg'))
</code>
Comment: Thanks for your ans root676,is there any open source repository for generic svg icons.
Comment: I don't know any OpenSource platforms but you could try www.thenounproject.com - they offer (mostly) free but also Creative Commons licensed icons. But they have a huge library.

Creating icons for QGIS plug-in


How can I test my policy? What after generate Balana jar files?

Question: I have installed Balana correctly and run mvn clean install with no error,
How can I get benefit from Jar file?
How can I test the policy that I have written in XACML?
Answer: Balana is just the engine. Once you Balana compiled (and presumably jarred), you need to start it and pass it the XACML policies you wrote. Now, at start-up, Balana should validate that the files are valid XACML 2.0 or XACML 3.0 files.
What you want to do next is send an authorization request using a tool e.g. SoapUI or Postman to the endpoint Balana exposes (if any that is). That will help you validate the endpoint.
PS: I have limited experience with Balana. I work mostly with Axiomatics Policy Server (disclaimer: it's where I work).
PS2: if you want to stay down the path of open source, check out AuthZForce. It's much more active.
Answer: When WSO2 Implements open standard protocols like XACML, SCIM they do not tightly coupled implementation with WSO2 platform components. For EX: Balana for XACML [2], Charon for SCIM [1]. Inside WSO2 Identity Server [3] you will find two artifacts org.wso2.balana_1.1.5.jar, org.wso2.balana.utils_1.1.5.jar which are relevant to WSO2 XACML implementation. If you want to make use of Balana artifacts pls refer [4].
[1] https://github.com/wso2/charon
[2] https://github.com/wso2/balana
[3] https://docs.wso2.com/display/IS570/
[4] https://docs.wso2.com/display/IS570/Working+with+XACML


I need to mow a lawn filled with Rocks galore

Question: I need a lawn mower that can handle rocks and tall thistle bushes. I go through a lawn mower a year it seems. 90% of our ground is granite with a shallow ground covering. Any suggestions?
Comment: How about a goat? The one power in the universe that can reduce any vegation to nothingness regardless of the terrain.
Comment: How much yard? How fast do you need to do it? are you going through blades or are you actually killing the engines?
Comment: lawn mowers are for lawns...not rock-strewn praries. ;) Look into a brush clearing tool of some sorts such as this one: http://www.drpower.com/field-brush-mower.aspx (link is merely an example, I don't know anything about that particular product)
Answer: You've basically described what I have in my lawn and fields, except that I have blackberry instead of thistle.
What I use:

For my lawn I use a self-propelled walk-behind Toro purchased from a big box store several years ago. The blade is in horrible shape (I should replace it), but I sharpen it with an angle grinder a few times a year and it keeps doing the job. This machine has been thoroughly abused: I knock down heavy weeds (small brush) with it, it has had numerous encounters with rocks, uneven ground, etc.
Another tool that is very useful is a scythe. I use this in areas where the mower can't go, or there are just too many rocks and the ground is too uneven for the mower. Just be careful to mow high with the scythe or you'll ruin the blade on the rocks.
I've used a string trimmer ("weed whacker") in the past, but sharp rocks tend to eat up string really fast, and they don't work well on thick, woody weeds (e.g. blackberry). I've seen some that have a blade instead of a string, but hitting rocks with a blade seems
At a larger scale, I recently got a field mower attachment for my tractor. This is used on a couple acres of horse pasture. (Yes, up until this summer, I used the little Toro to knock down brambles in the pastures.) It easily handles small brush, and the blades will give way if they hit a rock. (Though I have already had to replace a shear pin when it hit a rock that was too big.)
I have not used them, but I know people that have the DR brush mowers as mentioned in a comment on the question by @DA. You may want to consider something like this.

For any solution, it's helpful to:

Remove as many rocks as possible from the area to be mowed. This avoids damaging equipment, and potentially throwing rocks that could injure people or damage property (e.g. your living room window).
Mow high. Set the blades high to avoid hitting shallow ledge outcroppings that you simply cannot remove.
Lower your expectations. With the conditions you've described, you're not going to have a golf course lawn. If that's what you want, you're going to need to have many tons of screened topsoil trucked in to cover the rock.
Consider alternative landscaping. Some areas just don't need to be mowed. You may be better off deciding against a lawn in a problem area.
Learn how to maintain the equipment yourself. At the very least, an investment in a vise and angle grinder, and time to learn how to sharpen a mower blade can pay off over the course of a summer.
Comment: If you get a rock jammed up between blade and housing, it will usually bend the crankshaft, which is a ~$150 repair if it doesn't total the mower altogether.  So don't do that (like I did).
Answer: I mow 3 acres using a DR walk behind string trimmer. It takes about 2.5 hours. Here is what I tried:

A lawn mower at the highest setting: The blades will deteriorate real quick. The mowing deck will keep breaking.
A DR tow behind brush mower. It does work, the lawn does not look pretty because it is a rough mower. Also because the grass is tall, it grows back real quick. One time, I found 1.5 foot weeds ONE WEEK after I mowed. If it gets stuck, it is a heavy machine and it is a pain to get it out. It is also a big pain because you have two engines to worry about. That of the lawn mower which is barely enough to pull the brush mower and that of the brush mower itself. If you have an ATV, this may be an ok option. It also uses a lot of gas. I would say about 2-3 gallons.
The string trimmer works pretty well. It is fairly consistent and straightforward especially if you keep it mowed. Every 2 weeks is ideal. Every 3 weeks is pushing it. I look at it as a form of exercise and it is very easy to get started. By the time you figure the amount of time to set up the tow behind and add gas and tune both engines, this turns out to be the faster alternative (in my case). I go through about 1 set of strings every time I mow. It is also helpful to keep a belt handy just in case. I would say on average it costs about $5 in belts and strings and gas (less than a gallon).

Good luck!
Answer: Call a landscaper and have them fix it. They can remove rocks or bury them with dirt and leave you with something you can maintain (you could do this yourself, but considering your request for advice, I doubt you are able to tackle something like that (and they have heavy equipment)). Fix it once and it will save you months of frustration on a yearly basis, a very sound investment in time and sanity.
Answer: I would suggest a large weed Wacker and a helper
Answer: Many moons ago I recall a blow lamp type device that burnt the weedy grass. It was mounted on a stick and blow torch fed a nozzle mounted on the axle.


Find the secret message

Question: The word under secret means something. What does it mean? (Find the secret message.)
Comment: The puzzle is good (+1 from me), but the presentation could be a bit better. It actually turned me away from it at first glance. Maybe it *is* worth spending a bit more time on creating the images for puzzles...
Comment: It would be arguably easier for me to make "nicer looking" images but I like imagining the scenario of a "childish" image hanging on a popular wall where no one pays attention to it, yet it contains the secret to a treasure. I see your point though and will consider making some polished image puzzles in the future.
Answer: The solution is:

 gibberish

These were my steps to find the answer - first, I:

 Got the RGB ASCII values for every color.
 These were, For the word secret:
 31 41 59, 26 53 58, 97 93 23, 84 62 64, 33 83 27, 13 37 0
For the text at the bottom:
22 9 7 5 14 5 18 5 20 (Only the 'red' bit of the color had a value other than zero).

Then, by realizing that:

 The numbers for the top section correspond to the value of PI

And that:

 The numbers 22 9 7 5 14 5 18 5 20 when turned into letters, A=1, Z=26 correspond to VIGENERE(T)

You find that:

 That vqqjtzxaw decoded via the Vigenere cipher with a key of PI yields gibberish.
Comment: Wow that was fast, now I know I can make them less obvious. I was going to do something with the last letter (the 13 37 0 aren't pi) but thought it'd be getting too hard. I left the extra "T" though to "disguise" the cipher name.
Comment: 90 mins... that was relatively quick... +1!

Find the secret message


Is there any linux command to get number of context switches for a process?

Question: Is there any Linux command to get various information like context switches of a process? Any solution other than ps will be appreciated.
Answer: A context switch counters are in /proc/$$/status:
As an example:
voluntary_ctxt_switches:        230
nonvoluntary_ctxt_switches:     35
You can get this easily by doing something similar to:
$ grep ctxt /proc/1234/status
Comment: Interesting. I tried on few pid but they have no ctxt value. Will try on more pid. There is another command (#command pid) which shows useful information (context switch is one of them) just like the stat (#stat filename) command. It was a very nice utility which i forgot :(
Comment: If you want rolling stats, look at pidstat -w 1


How do I save Ashley?

Question: After the assault on the Citadel, I do my best not to shoot Ashley. However, the options for saving her seem to be grayed out.
Is there any way to save her? What actions do I have to undertake to make these options available?
Answer: There's actually a host of factors that influence the outcome of this interaction. What it comes down to is whether the Survivor trusts you. Whether you've built up enough trust with them will determine whether they will believe you outright when you confront them, require a hard, or possibly even max level Charm/Intimidation check to persuade (this appears to be what happened to you, but sadly, you don't have enough Paragon/Renegade points to make it through), or if you've been truly neglectful and/or hostile, they may be unable to be swayed.
These factors include:

Whether you saved the Council in the original Mass Effect
Whether you pursued a romance with them in the original Mass Effect
Your response in conversations on Mars regarding your prior work with Cerberus, and whether you can be trusted.
How many times you visited them in the hospital between missions, and your gift, if applicable.
If you romanced them in ME1, whether you pursued a different romance in ME2

If you did, whether you were honest and/or apologetic about that alternative romance.

Your use of Paragon or Renegade interrupts in the final conversation.
If Major Kirrahe or Thane Krios survived the first two games and saved the Salarian Counselor. If the Salarian died, Udina will show doctored footage implicating you, which makes the whole interaction much more difficult.
Comment: +1 good answer, starting with a new Shepard, how do those interactions default? I'm guessing no romance and no saving anyone.
Answer: Edit 2:
Finally going through this part of the game myself (Romancing Ashley in 1) I had a different set of dialogue choices that were Paragon/Renegade.  Going with the Paragon interrupt (have your squad stand down) and then choosing the Paragon dialogue option, I saved Ash's life.  I can only assume if I did not do the interrupt and/or chose the Renegade option, she would not have survived.

 Ashley is unaware that Udina and Cerberus are working together to lead the Councilors into a trap so Udina can take control of the Council. This puts Shepard and Ashley in conflict; Shepard must then convince Ashley into realizing the truth about what's going on and turning on Udina instead. If Shepard cannot persuade Ashley to back off, then Shepard can kill Ashley. If not, a squad member will shoot her.

Edit:

In this walkthrough, it shows that it seems the initial dialogue choice and whether or not you choose the Paragon interrupt determines if Ashley/Kaiden lives or dies during this encounter. This walk through also did not Romance Ashley in ME1, but Liara, which explains the different dialogue options than mine above.
Comment: is there a way in action mod? cause when i havent shot my squad shot her
Comment: TylerShads is incorrect in that this is the only variable. I just played the scene and chose the paragon action, but after that the voice overs are different than from this video. There must be something else.
Comment: Did you romance her in the first game?
Comment: @shahar1450 There is a Paragon interrupt you must do that tells your squad to stand down.

How do I save Ashley?


Running Docker containers with different storage drivers

Question: Is it possible to launch different Docker containers with different storage drivers? For example, container 1 with AUFS and container 2 with Overlay2?
Answer: If you look at the documentation, you'll see that the choice of storage driver is configured at the level of the Docker daemon. All of the containers and images managed by the same Docker daemon will share the storage driver.
This makes logical sense, once you understand how the storage driver works. Briefly, the concept is that the storage driver manages the interactions between the layers of a Docker image. When you pull down an image from a Docker repository, the storage driver configuration on your system determines how it will be stored and managed locally on your system. Different storage drivers handle the implementation differently, and the layers managed by one storage driver will be incompatible with another storage driver. The documentation also notes that changing the storage driver configuration on a system will render the existing containers and images inaccessible.
The choice of the storage driver is dependent upon several factors, such as the level of support offered by your system, as well as the characteristics of your workload.
For a more detailed explanation, see About storage drivers & Select a storage driver from the Docker documentation.
Finally, if you want to use different storage drivers for different containers, you can look at running multiple docker daemons, either on the same host or on different hosts. The image data and container data cannot be shared between such daemons, because the implementations are incompatible as noted above.
Comment: If you're looking for a way to preserve your images while you change the storage driver configuration, the documentation covers that too. You could use `docker save` to get a portable tarball of your image, or push it to an external registry.
Comment: Thanks...I have gone through the official docker documentation and your comment made this more clearer now. What i have understood is that switching docker storage driver will make my existing image and container incompatible hence it can be deleted. Is there any implementation, that can migrate the image and container from one storage driver to another?
Comment: Thanks again....
Comment: my further reading revealed that overlay merge image all image layers into lower layer using hard link implementation which cause inode overhead. Can you please explain this? As i know that creating hardlink does not create new inode.
Comment: @RajnishKumarSoni That query is significantly different from the current question. Please post that as a new question, and I will try to answer it if possible.


Automated/Simple Deletion of Apps from iTunes Library

Question: Is there an approach to querying the local iTunes library to remove apps that aren't currently installed on any of your devices?
Comment: Unfortunately I don't think there's a reverse lookup of installed apps from the local iTunes library. Apps on the device are referenced in the local library not the other way around.
Answer: I might suggest a really wild -- possibly dangerous -- approach. If you have a good backup, it is less dangerous, but until you have restored from that backup there still can be snags and problems in a restore that you want find until that point. The good news is you don't need the backup, it's just there I case a crash happens in the middle of this process.

First make sure you've got a good backup of your iTunes library.
Then delete all your apps from iTunes.
Finally, sync each of your iDevices and when it tells you it found apps on the iDevice(s) that were not in the library, make sure you tell it to restore them back to the library.

You should end up with only those apps that are installed on at least one iDevice!  (In theory, at least.) And if anything fails, restore the library from its backup.
Comment: Actually, you can connect each iDevice and **Transfer purchases** to iTunes.
Comment: I've done this already—I didn't do it quite correctly, and ended up losing a few hundred apps. Restoring from the backup restored the apps, but it took days to download them all and I lost a few apps' data.
Comment: @TimothyMueller-Harder - I've done the *delete all apps from itunes and transfer purchases from iDevice* several times and it worked flawlessly each time. However, if your try to sync, it will delete the apps from your iDevice.
Comment: @Vlad I didn't do it right. When I restored from the backup, I lost some data. I'm not blaming it on your method.
Comment: After a healthy round of backups for all devices involved, I tried this approach.  It worked just fine.  I would say that this approach is not for the faint of heart and if you're not familiar with backup/restore of devices, I don't recommend this approach.  That being said, I'm glad to see my app count down to 100 :-)
Answer: This worked for me without any issue:

Connect you iDevice to computer, let the sync complete (or cancel as per your choice)
In the iTunes app library, select all (CmdA) and delete. on the prompt select Move to Recycle Bin.
Do not sync now, go to Files>>Devices>>Transfer Purchase from "Your iDevice"
Comment: Since the question specifies ***any of your devices*** do you need to connect them all in step one and transfer them all back own step 3? Have you tried this on more than one or ten devices?


How do I repair a floor joist which has a hole drilled less than 2 inches from the bottom?

Question: I have three floor joists that have approximately 1/2 inch hole in them less than 2 inches from the bottom. Is there a recommended fix or approved method to correct this to meet code?  These joists are in excellent condition otherwise. Someone drilled through them years ago to run cable through. There are other holes above 2 inches on other joists.
Comment: The bottom of a joist is, under normal loading, in tension.  You should be able to repair it with a steel plate bridging the area with a hole in it.  However, you're going to need professional advice.  It's not explicitly to code, so you'll need an engineer to sign off on the fix.
Comment: replace them or get an engineer to spec a fix. metal plates or straps would probably be easiest.
Comment: Simpson have metal elements that would slp over that. Normally used for studs (so vertical) but probably would work for this application. Alternatively you could fasten a steel strap across the bottom edge to reist tension stress.
Answer: Replacing them? Getting an engineer? For a 1/2 hole in at least 8in joist? Seriously? I mean I'm sure the joist has lost some percentage of its strength. Like  pretty small percentage. I would speculate that the lost strength is within tolerance limits for wood, which is not uniformly perfect. Unless you plan on having sumo wrestlers fight on top of those joists, I would just let them be....
Answer: As Vitaliy points out, replacing the joists is completely unnecessary, however, I did look into it and came across this article: http://ifbholz.ethz.ch/natureofwood/pc/st/st5.html
Knots and holes do affect the strength of a joist but the three most important factors are: the dimensions of the lumber, the location of the hole, and the size of the hole. Best-case scenario is that you have a hole just big enough for the purpose needed, directly in the center of the joist. Worst-case scenario is that you have a hole that is too large and is located at the bottom of the beam (the tension face). As the article points out, a 1/2 inch hole in the tension face of a 2x10 joist can reduce the bending strength of the joist by as much as 9 percent!
Answer: Those holes are effectively notches. If they're in the middle third of the span, then the notches are out of conformance with the IRC. If they're outside the middle third of the span, then the maximum notch depth is 1/6 times the joist's depth for IRC conformance.
To repair them, you should look for notch repair kits, not hole repair kits. Alternatively you can remove the cable, sister the joists, drill conformant holes for the cable, and reinstall the cable. The specification for allowable holes and notches can be found under IRC R502.8. Note that the following section (R502.8.1) prescribes some constraints that aren't shown in the images, so be sure to read the fine print.


How do I make a DNS record for only one subdomain and forward the rest?

Question: I am using Windows server 2003. My primary domain controller is my DNS. I want to make an internal subdomain for my main website, like a staffpage.oursite.com . However I do not have a zone for oursite.com on our DNS and if I create a new one, the webpage oursite.com will use our DNS instead of our ISP's DNS. How do I make a subdomain and any records that are not held in my DNS to resolve using the ISP? we have a lot of A records on our host and I just want to resolve one cname internally.
Answer: You can use your internal subdomain as a parent for additional child domains that you create to manage divisions within your company.
For example, to implement an internal subdomain of the external domain example.com:

Configure the external DNS server with the namespace example.com. This server contains a static zone with only records for servers that are to be available publicly on the Internet. These records would typically include such servers as www.example.com, ftp.example.com, and so on.
Configure the internal DNS server with the namespace corp.example.com. Note that while the internal namespace is a subdomain of the external namespace, the internal zone is not delegated from the external zone. That is, the external server does not have a delegation record.
Register all hosts in the organization's internal network in the corp.example.com namespace, either in the corp.example.com domain or in child domains within that namespace. For example, a server for the sales department might have the fully qualified domain name of salesvr1.sales.corp.example.com.
Disable dynamic updates on the external server because no computers in the company's internal network should be registered in the external namespace.
Configure the internal DNS server to forward Internet queries to enable internal hosts to resolve external (Internet) names. You can do this in one of two ways:

Configure the internal DNS server to forward to the external server, which enables recursion on the external server. In addition, you can configure the internal server as a secondary server to the external server. This enhances the security of the internal network by ensuring that the internal server never makes a query directly on the Internet.
Configure the internal DNS server to forward queries to the Internet service provider's DNS server. This method enhances security on the external server because it makes it possible to disable recursion on the external server.

Instead of using forwarders, the internal DNS server may be configured simply to use the standard Internet root hints to resolve Internet names. The DNS server is configured with the list of standard root hints when the DNS server role is installed. This option is the least secure, however, because it requires the internal DNS server to be able to access DNS servers on the Internet.
Comment: Because of the additional fields that can be added to DNS responses, attackers could in theory send your internal computers bogus DNS responses that would cause trouble.  If you keep your internal DNS separated from your external DNS you in theory could mitigate some of this. Obviously, you need to pull from the public Internet at some point, but I think avoiding root hints limits one more attack vector.
Comment: I don't understand why using root hints reduces security (your last paragraph), could you please clarify? Other than that, helpful answer :-)
Answer: You can setup split DNS or you can just use your internal domain name to make things simpler. A less elegant solution would be to create an hosts file entry on all of your clients. The latter is a lot of work and headache, I would just use the internal domain name.


Inversions of a Permutation

Question: Show that the largest number of inversions of a permutation of $\{1,2,3,4,5,6,7,8\}$ equals $n(n-1)/2$. Determine the unique permutation with $n(n-1)/2$ inversions. Also determine all those permutations with one fewer inversion.
Comment: Your use of the imperative, and lack of any context or any displayed effort to solve it yourself, are considered impolite here.  I'm surprised your question was upvoted, and not put on hold.  There is a FAQ list you should read before you ask any more questions.  You are lucky that a few people were generous enough to answer.
Answer: For the first part, observe that the number of inversions cannot exceed the number of ways to choose two numbers (since each pair accounts for at most one inversion). Hence, the number of inversions cannot exceed $\binom{n}{2} = \frac{n(n-1)}{2}$.
As for the second part, how else would you make a permutation with a lot of inversions? Put everything in reverse order. You can see that in $\{8,7,6,5,4,3,2,1\}$ that every pair is inverted, and thus we have the full $\binom{n}{2} = \frac{n(n-1)}{2}$ inversions.
Lastly, suppose you started with an arbitrary permutation with one less inversion. I claim that the only inversion must be between two adjacent elements.

To see this, suppose we had $a < b$ and the permutation was something like $\{..., b, ..., a, ...\}$. If any element between $b$ and $a$ is less than $b$, then it creates another inversion with $b$. However, if it is greater than $b$, it must create an inversion with $a$. Any element in between can't be equal to $b$ either. Hence, we can't have an element in between if there's only one inversion.

The permutations with one less inversion are then the 7 permutations that are just like $\{8,7,6,5,4,3,2,1\}$, but with two adjacent elements swapped.
Answer: $\{8,7,6,5,4,3,2,1\}$ has $8(8-1)/2$ inversions.
The number of inversions is one less in the following permutations: $\{7,8,6,5,4,3,2,1\}$,$\{8,6,7,5,4,3,2,1\}$,$\{8,7,5,6,4,3,2,1\}$,$\{8,7,6,4,5,3,2,1\}$,$\{8,7,6,5,3,4,2,1\}$,$\{8,7,6,5,4,2,3,1\}$,$\{8,7,6,5,4,3,1,2\}$. There are no others because we need only one pair of numbers to be in correct order. If $i$ and $j$ are in correct order, any number located between the two has to be less than $i$ and more than $j$, which is not possible so $i$ and $j$ have to be adjacent. Moreover, they should be consecutive numbers because any number more than $i$ and less than $j$ cannot be located to right of $i$ or left of $j$.

Inversions of a Permutation


Hid Ribbon on Page, Now Ribbon on Forms is Gone

Question: I have used the ribbonrowhidetitle around my ribbon code in my master page, and this hides ribbons on pages as well as on forms, which means my users cant edit now. The reason I needed to hide the ribbon on the pages is I have users who know how to use the "Manage Content" item on the Site Action menu. I am trying to lock down my site. I have used the SPSecurityTrimmedControl2 with PermissionsString=ManageWeb which helps but does not remove the Manage Content option so I went with the above. Anyone know how to only hide the ribbon on the pages but not on the forms?
Answer: Normally your page uses one master for system pages (like list pages) and one for other pages.
Is this the case for your setup as well? If so, try removing the ribbonrowhidetitle from the system master and see how that turns out.


How do I return to the modeling view from the node view?

Question: I don't even know how this happened but my modeling view only displays my nodes and I can't find the button to return to modeling.
Comment: Your image shows that you are in the Shader Editor. Can't you just click on that icon, the one to the left of where it shows that you are in Object Mode, and change to the 3D Viewport?
Comment: Probably you pressed `Ctrl`+`Spacebar` to maximize the current window you're in. To get back just press it again.
Answer: There are multiple ways to get back to 3D-View.

Press Ctrl + Spacebar to reverse maximizing the current window. If that didn't do the trick, reverse this by pressing the shortcut a second time.

You can go to the button with the circle icon right next to the "Object" button. Click it. Now there should be a list of windows you can navigate to. Click on 3D-View and you are back.
Alternatively, press Shift + F5 to do that.

You can just create a new "Modeling" window on the top. Press the small "+" button next to "Scripting" and navigate to "General>Modeling", click that and then delete the old "Modeling" window by right clicking the tab and pressing "Delete".

You can revert your window back to factory settings. Go to "File>Defaults>Load Factory Settings". Remember to save your work before you do that.


What are these Income Dips?

Question: Every once in a while, my city income dips from like $1,250 to $32 Dollars P/H.
Then people get mad for high taxes, and move out...
What is this, Why is this, and how to stop it?
Answer: If you have high taxes people move out. If people move out you collect less from taxes (of course).
This explains the income variation.
You need to balance happiness with taxes. You can raise them for a while in crisis then lower them back. I've noticed that you can go to 12% for poor, 11% for medium and 10% for rich and not suffer major penalties.
In order to progress, I suggest not using taxes as your main income. For example you could rely on industry and export. The income from taxes may go negative, but the exports compensate.
The worst thing that can actually happen to you is for all the people to leave (this will lead to high crime rate, fires, abandoned buildings etc.), so you should take care of that.
Comment: Day/night cycle (I think shops don't pay taxes at night)? House upgrading cycle (while upgrading houses are empty)? Have no other ideas...
Comment: Sorry... can't think at anything else :). Anyway, 1k difference is small. If you focus on industry you can go up to a few millions/day by selling tvs or computers (is quite hard to get there though, took me a few games to get it right the first time). But, if you do that the environment will suffer (pollution will go up). If there are many cities around you could go for tourism (but if you play solo don't think is an option, at least didn't work so good for me).
Comment: But it flickers about every 10 mins from high to low and back- and my population isn't different at all. In fact my population is growing rapidly!
Comment: Thanks @zozo, but it flickers so constantly and changes so dramatically! The shops may slightly contribute, but I've found the tax dips are mostly on residential, my highest tax income, and not while they're upgrading.
Answer: It's hard to say why your city income dips since it is composed from many sources.
Here's a few sources to check.
RCI: upgrades, move outs, or lack of basic services (power, water, sewer, garbage).
I gathered tax data for many RCI buildings and found income per hour for each building is a flat amount * tax rate.  However, this amount can be reduced when basic services are missing.
Megatower apartments: income per hour is based on occupancy which can vary.
Tourism, Casinos, megatower malls and megatower offices: income per hour is based on utilization, which can vary to extremes.  Specifically, these income sources periodically reset to zero and then build up based on utilization after the reset.
Importing/Exporting: when deliveries are made varies.

If you don't have enough income overall, RCI is a great place to go because of its stability.  Just add more RCI buildings and keep them down at medium density to spread them out and maximize taxIncome/serviceCosts.

What are these Income Dips?


How to remote into a computer with no password

Question: I have a couple of computers with Remote Desktop enabled (the more secure choice), and an IT computer running Windows 7 Pro.  I would like to be able to use Remote Desktop Connection from the IT computer to the other computers without sacrificing security or speed.  What I had in mind was something that used IP or user-name.  There is no central server, just LAN.
Answer: You can set a firewall rule that restricts access to the RDP ports on those machines to only accept remote connections from a specific IP or range of IPs. You can go here for some more details on how to do this on Windows 7 firewall.
BTW. The default RDP port is 3389 and there should already be a rule accepting incoming connections from any source. You just have to modify it to accept connections from a specific IP.


Is the n-Queens problem only np-complete for the task of finding all setups or also for finding any solution?

Question: I have read on Wikipedia that the n-Queens problem is NP-complete when it comes to finding all possible solution implies it that finding one possible solution is also NP-complete?
Comment: So it would follow the problem to find a single solution is in $\mathcal{O}(1)$ ("These solutions exhibit stair-stepped patterns")? Would you like to formulate it in an answer, I mean I could also delete it but I think it could be very interesting to other people.
Comment: The article you referenced doesn't say what you claim.  There's a particular decision problem, whether you can complete a position in which some queens are already placed, which was shown to be NP-complete.  As a result counting all the solutions to the same problem is #P-complete.  This is different than the general n-queens problem where you have freedom to place all the queens.
Answer: The Wikipedia article states "If the goal is to find a single solution, one can show solutions exist for all n ≥ 4 with no search whatsoever." This means that it is easy to find a solution even though it is hard to find all solutions.


Should I install Mesa driver?

Question: I have AMD Radeon HD 6790 Barts. Will it cause black screen? Should I just install official driver from their website? Or should I not touch graphics driver at all, because Dolphin emulator works. But I want to try CEMU and RPSC3 just to test it.
Answer: You are asking for opinions. One will say yes, the other will say no. In the end YOU will need to decide yourself.
Advice: prepare for failure . Investigate how you can revert changes you made that made the system fail.
Anything can be reverted from a live session or from grub rescue prompt. Just make sure you know what to do (as you likely will not have an internet connection from that system when it crashes ;-) ).  When you are confident whatever option you pick you will be able to restore to a working situation.
Also another piece of adbvice: make backups. If you consider your personal data important you need to treat it as such, and the way to do that is to make backups at a regular interval. Incremental backups take little time to make.
Now back to your questions:

Should I just install official driver from their website.

If it aint broken don't try to fix it. But if you need it for a specific software that is a valid reason to try it.

But I want to try cemu and rpsc3 just to test it.

AMD Radeon HD6790 is an older card and had excellent support up to at least 16.04. So I would assume it is going to work.  So if you want to test those and need to 3rd party driver: go for it. It is likely to work. And if not it is always possible to revert back to the old driver. Find out how to do that before attempting to install the new one and you can play with it until you are satisfied.
As an alternative: you could create a dual boot with 2 Ubuntu systems and tinker in the 2nd one keeping you current one as is.
Comment: _"I would assume it is going to work"_ — I wouldn't generally. Intel GMA950 is an old GPU family, but both kernel and Mesa regularly break down with its drivers. Even newer ones, like the HD Graphics family have made me revert to older kernels (not Mesa though) more than once after Ubuntu dist-upgrades.

Should I install Mesa driver?


Layer Norm in a ResNet MLP

Question: Where do you insert layer norm in a residual block?
After the addition or before the activation function (RELU in this case)?
Answer: Two things:

Layer Norm wasn't invented before ResNet. ResNet still uses the regular Batch Norm.
The model to use Layer Norm is residual block is ConvNeXt. Based on this line, it applies LayerNorm after the first Conv layer, before the activation layer.
Comment: I am aware of (1), but I should have added that I cannot use batch-norm because of a gradient penalty, which penalizes the gradient with respect
to each input independently, rendering batch-norm ineffective.

Regarding (2), I am not using any convolutional layers, as I don't work with image data. Do you know of any ResNet implemenatations with MLPs that use layer norm?
Answer: Usually you insert the normalization layer (be it BatchNorm, LayerNorm or whatever) after the convolutional layer and before the activation layer, i.e. Conv + Norm + ReLU.
The original ResNet applies the addition (skip connection) just before the last ReLU, but this design was revised in a follow-up paper by the same authors. You can also see here for figures and explanations.
Regarding using skip connections with fully-connected layers, I think you can take a look at the transformer architecture. The transformer encoder (and decoder) architecture uses skip connections around fully connected layers. It also uses LayerNorm instead of BatchNorm. However, with this architecture there are again debates where exactly to place the LayerNorm layer. This paper suggests using Pre-LayerNorm instead of Post-LayerNorm, because it stabilizes the training of the Transformer model. You can also see here for figures and explanations.

Layer Norm in a ResNet MLP


How do I force the Raspberry Pi to turn on HDMI?

Question: I have a Raspberry Pi running Raspbmc connected through HDMI to a dumb HDTV. (Does not support HDMI-CEC).
If I power on both the TV (both at source and display through remote) and Raspbmc at the same time then it all works fine.
If I power on the Raspbmc and TV, but the TV display is not turned on. Sometime later I use the TV remote to power on the TV display, then I get a blank display on TV through HDMI. This is not the screensaver because using a XBMC remote does not change anything. The Raspbmc is active though, because I can ping it and connect to it using SSH.
Is there a setting in Raspbmc I can change so that it always turns on HDMI, no matter if the TV display is on or off?
Comment: This is regular behaviour; the Raspberry Pi can only drive EITHER the RCA analogue out, or HDMI, but not both at once. The presence of an RCA output cannot be checked electronically, so the default is to check HDMI, then resort to RCA if no HDMI device was found.
Comment: This is not working with a Philips tv.
Comment: Related - https://raspberrypi.stackexchange.com/questions/40164/how-do-i-get-rca-video-out-of-openelec-libreelec/40265#40265
Answer: Add these two lines to /boot/config.txt and reboot Raspbmc:
hdmi_force_hotplug=1
hdmi_drive=2

hdmi_force_hotplug=1 sets the Raspbmc to use HDMI mode even if no HDMI monitor is detected.
hdmi_drive=2 sets the Raspbmc to normal HDMI mode (Sound will be sent if supported and enabled). Without this line, the Raspbmc would switch to DVI (with no audio) mode by default.
Comment: `config.txt` is read by the GPU so it will work on every distro.
Comment: Dennis Williamson: Thanks, that worked. But audio was not working. I fixed it by adding hdmi_drive=2
Comment: @Gerfried: Take a look [here](http://raspberrypi.stackexchange.com/a/8722/1667).
Comment: Thank you, that works well. However when I switch on the monitor it is flickering - it seems to change between 1024 and 1920 resolution about 5 times a second.
Comment: This did not work for me. I uncommented those two lines mentioned in the answer and rebooted my pi. There is absolutely nothing on the monitor. I keeps switching to the PiTFT display not the monitor through HDMI.
Comment: @ThN: I don't know the answer to your problem, but it may be that the configuration that enables the PiTFT is taking precedence. Look in `/boot/config.txt`, `/boot/cmdline.txt` and at files in `/etc/X11/xorg.conf.d/`. Also, look in `/home/pi/.profile` to see what the setting for `FRAMEBUFFER` is. Also, check other questions and answers here concerning the PiTFT.
Comment: Does hdmi_force_hotplug increase the power usage of the RPI? if so, anyone knows how much?
Comment: @RomanGaufman: I seriously doubt that it would, but you should start a new question to ask that.
Comment: After fighting with a cheap splitter for 2 days, I'm glad to say this is the only thing that helped. I also had to set `hdmi_mode` and `hdmi_group`, but I can live with that.
Answer: Although this question is very old, I would like to post my answer that I found recently. I am running Raspberry PI 2 Model B with 2.8 PiTFT capactive display. Once I figured out how to get my pitft display to work with Raspberry PI, I could not get Raspberry PI to switch over to HDMI output no matter what I did. Then, I came across this information, which worked for me.
There's two ways to do it. In older Pi installs, use the fb0 framebuffer when you want to display stuff on the HDMI/TV display, for example:
FRAMEBUFFER=/dev/fb0 startx
will use the HDMI/TV framebuffer for X windows instead of the PiTFT
On Jessie Pi installs, run
sudo nano /usr/share/X11/xorg.conf.d/99-fbdev.conf
to edit the configuration file and make sure it contains:
Section "Device"
  Identifier "display"
  Driver "fbdev"
  Option "fbdev" "/dev/fb0"
EndSection

change the Option "fbdev" "/dev/fb0" line to Option "fbdev" "/dev/fb1" if you want the xdisplay on the PiTFT or fb1 to fb0 for HDMI output.
Update: If don't see the code above in the file, then simply copy and paste what is shown in this answer at the bottom of that file. If you can't find 99-fbdev.conf file in that folder, then there is probably another file with different name like 10-evdev.conf in the same folder which you will have to modify to make it work as described above.


How to stop get returned email from email address that never sent

Question: I am receiving tons of returned emails that I had never sent before. Is there any way to stop it? It seems that my email auto sent to some email address that block my email address.Thanks in advance.
Comment: http://en.wikipedia.org/wiki/Backscatter_(e-mail)
Answer: Most likely you receive bounces as a reaction to spam mails, that a spammer is sending with your email address as From: address.
For more informations see e.g. http://en.wikipedia.org/wiki/Backscatter_(e-mail) (as commented by ceejayoz ).
As a workaround you may:

use a filter rule in your Mail User Agent (e.g. Thunderbird)
use a sieve filter rule, if your Mail Delivery Agent (e.g. Dovecot) support this
use procmail to filter out this messages
Comment: Thank you so much.If I sent an email to firstname.lastname@example.com and it failed, so I get returned  email like that :[From]Mail Delivery System.....................This message was created automatically by mail delivery software..........How can I stop it in Cpanel. Thanks (I mean turn it off whenever my email sending unsuccessful)


inverse search does not work for some paper

Question: I installed texstudio on a windows 8.1 computer. I first installed Miktex, then Texstudio, all are in the latest vision. It confused me that when I run some texfile, the inverse search function is fine. That is, when I right click at the pdf, then there is "go to the source", and it works. But for some texfile, when I right click at the pdf, there is no such  "go to the source". Does anyone knows the reason  behind this?
Answer: This is a feature called synctex. The inverse search function relies on an auxillary file named [jobname].synctex (or [jobname].synctex.gz). If you delete this file, then you will unable to do an inverse search.
By default, TeXStudio will compile your document with the command line like
(pdf)latex -synctex=1 \jobname.tex

With the option -synctex=1, it will generate the file [jobname].synctex.gz for inverse search. However, if you compile the paper using command line directly, like
(pdf)latex \jobname.tex

Then no synctex file is created, so you can't do an inverse search.
More details can be found in synctex.man1.pdf, in your TeX distribution (MikTeX).
Comment: Then why does it work for some file not the others?
Comment: Have you ever deleted the synctex files unintentionally?
Comment: Thanks for your attention for my question. No, I did not delete the synctex file. Everytime I run the tex file, it would generate a synctex file. For some file, when i click left at the embedded pdf, there is the "go to source" option. But some tex file, no such option.  I found that the difference may come from the location of the latex file. The ones works are on the desktop, those do not work are in my D disk. So now when I want to edit some thing, I first put it to the desktop. This is not a good solution, But it seems that I have to go with it. Thanks again.


How would you write the years 1951 and 1964 in Chinese characters?

Question: I know how to write the normal way to write numbers in Chinese but I wanted to know how to write years can anyone help me out? I really like the idea of getting this tattoed on me and I would like to be correct before I go ahead and do so.
Comment: @dROOOze would changing the question to a more generic form be better, i.e. is _How to write year number in Chinese?_ ok? I'd like to think that there are differences between how you write normal numbers and year number, you would not write 2020 as 二千零二十, which is how you'd write them if it is just a number on its own.
Comment: Not only does this kind of question need far more effort on behalf of the asker, it tends to attract undue attention (we really don't need more than one answer for a question like this)...voting to close.
Answer:
go to Google Translate
select translate English to Chinese
input "one nine five one, one nine six four" --> Result = "一九五一,一九六四"
input "year" --> Result = 年

1951 = 一九五一年
1964 = 一九六四年
You can omit 年 if you just want straight translation of 1951 and 1964
Comment: Thank you so much!
Answer: In Chinese, the rule to write years is pretty simple and straightforward. When you encounter a year just translate each number respectively, for example

2020 is 二零二零 not 两千零二十
1234 is 一二三四 not 一千两百三十四

Just translate each number.
Answer: Here is a comparison table of Chinese characters and Arabic numerals. I hope it can help you.
--> 0.零 1. 一 2. 二 3. 三 4. 四 5. 五 6. 六 7. 七 8. 八 9. 九 10. 十 <--
We write in the same order as in English
For example : 1919 - 一九一九 | 2020 - 二零二零 | 2019 -- 二零一九
But most of the time, we like to use Arabic numbers
In general, the word "年" (year) can be omitted
Because this format is only used to represent the year

If we express quantity, we will add a quantifier after that
for example:
one hundred thousand 十万(it means ten ten thousand)
ten thousand - 万 | thousand - 千 | hundred - 百 | ten - 十

such as 1293(one thousand two hundred and ninety three) -- 一千二百九十三
Comment: Thanks so much, also would you write it vertically or horizontally?
Comment: @Dominique Amm , are you talking about the order of the sentences? We usually write vertically only when we are writing calligraphy works, usually we are horizontal, from left to right. If it is a man's stroke order, there are both vertical and horizontal, and each stroke order is different.
Comment: Zero is 零 when we talk about it otherwise. For years like 2020, we use 二〇二〇 NOT 二零二零
Comment: @Chrimpyslime There is no essential difference between the two, but the writing method is different. The first one is more commonly used.


what is a good public available iptables script for ddos mitigation?

Question: what is a good public available iptables script  for ddos mitigation?
Answer: Have a look at the questions on:

how a software application can defend against a DDoS attack
what techniques do advanced firewalls use

as the answers there will give some indication. Basically you can't do it in a device as the distributed nature of the attack means you need to have infrastructure which can cope, which is why DDoS protection services tend to be provided in conjunction with ISPs and depend more on active routing, path restrictions and upstream filtering.
Answer: Sorry, but you cannot effectively guard against modern DDoS attacks with a software firewall running directly on the server. The packet rates can get way too high and/or the packets come in on a valid port which your firewall permits through.
You can do basic rate limiting with iptables. But the first "d" in DDoS stands for "distributed". There are many hosts participating in the attack, and each host may contribute at a low rate, so rate-limiting may not help that much.
That said, if you want a management tool for iptables there are several options. Ubuntu ships with "ufw" -- uncomplicated firewall, and it lives up to its name. For slightly more complex solutions, I like Shorewall a lot. There are many others -- go to the support forums of your favorite distro, and you will find plenty of options.
Comment: the iptable maybe is not running locally in his server. maybe its a gateway, or even a router running Zebra or Quagga.
Comment: @VP01: Yes, you're quite right. It's hard to say precisely, since the original question is light on specific information, but in the majority of cases were iptables is run on a single gateway/linux router, it will be of little use against well-executed DDoS attacks. The packet rates overwhelm all on-the-server solutions. This answer describes what *good* DDoS protection looks like (it need to be done 'upstream' of the servers): http://security.stackexchange.com/questions/114/what-techniques-do-advanced-firewalls-use-to-protect-againt-dos-ddos/792#792
Comment: yes, upstream is the right place to do. But from his question we cannot assume that he is an end-user. Maybe he is a netadmin, under attack from a small ISP without no clue :-)
Answer: It's not iptables, but I like Roboo.
Answer: [Quot: Sorry, but you cannot effectively guard against modern DDoS attacks with a software firewall running directly on the server]
100% correct.
Deflation and Load-Balancing are the only 100% full-proof DDoS mitigation measures. Of course you`ll need a multi-server setup or Cloud CDN for that.
(For more info. check out this comparison review of Cloud security service providers)
Also I must say that limiting IP ranges is not only ineffective but also (potentially) damaging.
As mentioned, DDoS uses botnet - a network of PCs that can sometimes be a very large pool of an inconsistent IPs.
In this more and more commonly occurring scenario, blocking an "attacking" IP range can actually prevent access from legitimate visitors, while not preventing DDoS attack itself.


Android TextView Linkify intercepts with parent View gestures

Question: The problem is that if i Linkify the textView the underliyng ScrollView don't listen the sweep Gestures I've setted.Is there a way to have Linkify without messing with the underliyng view's gestures?
I tried to override ontouchEvent and return false to ACTION_MOVE but the scrollview's gesture needs the ACTION_DOWN and ACTION_UP event to function. Is there a way to achieve that?
Answer: Linkify applies to a movementMethod to the textView LinkMovementMethod. That movement method thought it implements a scrolling vertically method it overrides any other scrolling method the parent has. Although  touchEvent can be dispached to the parent, the specific parent ScrollView needed the whole sequence ACTION_DOWN , ACTION_MOVE, ACTION_UP to perform (sweep detection).
So the solution to my problem is after Linkify to remove the textView's scrolling method and handle the LinkMovementMethod link detection action in onTouchEvent of the textView.
@override
public boolean onTouchEvent(MotionEvent event) {
        TextView widget = (TextView) this;
        Object text = widget.getText();
        if (text instanceof Spanned) {
            Spannable buffer = (Spannable) text;

            int action = event.getAction();

            if (action == MotionEvent.ACTION_UP
                    || action == MotionEvent.ACTION_DOWN) {
                int x = (int) event.getX();
                int y = (int) event.getY();

                x -= widget.getTotalPaddingLeft();
                y -= widget.getTotalPaddingTop();

                x += widget.getScrollX();
                y += widget.getScrollY();

                Layout layout = widget.getLayout();
                int line = layout.getLineForVertical(y);
                int off = layout.getOffsetForHorizontal(line, x);

                ClickableSpan[] link = buffer.getSpans(off, off,
                        ClickableSpan.class);

                if (link.length != 0) {
                    if (action == MotionEvent.ACTION_UP) {
                        link[0].onClick(widget);
                    } else if (action == MotionEvent.ACTION_DOWN) {
                         Selection.setSelection(buffer,
                                 buffer.getSpanStart(link[0]),
                                 buffer.getSpanEnd(link[0]));
                    }
                    return true;
                }
            }

        }

        return false;
    }

This way i have the Link_Click detection (performed only with the user touches the link and not the whole textview) and i don't have the whole LinkMovementMethod.
Comment: The mentioned "remove the textView's scrolling method" is done via `textView.setMovementMethod(null);` and has to be called _after_ you've set the textView's text.
Comment: Nice solution, clear and not hacky. I had to move `return true;` into the positive branch of internal if though to let the span be highlighted on steady touch.
Comment: i'm glad it finally helped someone :D
Answer: @weakwire and @Ridicully answers are correct. I just created a small gist that you can re-use in your project.
This is the link: https://gist.github.com/amilcar-andrade/e4b76840da1dc92febfc
Comment: I have ported this class to Xamarin/C#: https://gist.github.com/pmachapman/a988348a93933ac359ebe0d6a5314467
Answer: There is a small bad thing that
TextView::setText(...) method utilizing autoLink flag,
if (mAutoLinkMask != 0) {
        Spannable s2;

        if (type == BufferType.EDITABLE || text instanceof Spannable) {
            s2 = (Spannable) text;
        } else {
            s2 = mSpannableFactory.newSpannable(text);
        }

        if (Linkify.addLinks(s2, mAutoLinkMask)) {
            text = s2;
            type = (type == BufferType.EDITABLE) ? BufferType.EDITABLE : BufferType.SPANNABLE;

            /*
             * We must go ahead and set the text before changing the
             * movement method, because setMovementMethod() may call
             * setText() again to try to upgrade the buffer type.
             */
            mText = text;

            // Do not change the movement method for text that support text selection as it
            // would prevent an arbitrary cursor displacement.
            if (mLinksClickable && !textCanBeSelected()) {
                setMovementMethod(LinkMovementMethod.getInstance());
            }
        }
    }

So I spent a time to understand,
why i'm disabling links in ListView item,
but it obtains a link sometimes!
You need to set that flag in needed value
and then call a setText(...)
Comment: It's a bit unclear what you're saying here. Is this an answer to the question or are you trying to ask a new question?
Comment: It's mostly a note, cause I found this topic when search for "Linkify textview in ListView" problem


Problem with iPhone starting up completely

Question: I went to turn on my phone and I got a black screen with a circle going round and round. The phone will not turn off and will not respond when pushing the home button. Can anyone help?
Comment: Can you hear alert sounds and/or charging sounds?
Comment: What phone do you have?
Answer: The steps to fix any iOS device that won't boot fully are the same and pretty easy to accomplish following Apple's support on how to restore a device.
Consider trying to make a backup or check if you have your data (programs, contacts, settings, photos) either synchronized or backed up before you restore - that irreversibly deletes everything you put on your phone as the first step of the restore:

https://support.apple.com/en-us/HT201252

At the bottom of that article are several that might need to be epxplored if the normal restore fails, up to and including calling for a hardware repair to an authorized (or unauthorized if you prefer) repair shop.


Are JKT and CGK the same Indonesian Airport?

Question: Is Jakarta Airport (JKT) the same as Soekarno-Hatta Airport (CGK)? If so, why is the code different? If the two codes means the same thing, why do some airport booking systems use JKT and some others CGK?
Answer: JKT was the first Jakarta's airport, closed in 1985 and replaced by Halim Perdanakusuma (HLP) and Cengkareng/Sukarno-Hatta (CGK).
JKT is simply a short for Jakarta as a destination; some booking site could be using it in case you simply want to fly to Jakarta regardless of the airport.
Another example, Milano has two own airports plus Malpensa, for a total of three: in some sites you can choose to fly to MIL, itself not being the code of any airport in Milano.
Comment: Probably similar to how MOW is used sometimes for either SVO or DME.
Answer: IATA is the governing body for the short codes for airports.
Jakarta International Airport (Soekarno-Hatta) is the main airport serving the greater Jakarta area on the island of Java, Indonesia.
Its IATA code, CGK originated from the word Cengkareng, a sub-district located to the northwest of the city, and the original name of the airport.
Today, CGK has been maintained as the base airport, and JKT (used to be Kemayoran, before Halim Perdanakusuma (HLP)) is used to refer to any Jakarta airport - both (JKT-CGK and JKT-HLP).
Another example: LON (London) can refer to multiple airports - Heathrow (LHR), City (LCY), Luton (LTN), Stansted (STN), Gatwick (LGW), Biggin Hill (BQH), and Southend (SEN).
Comment: @ChrisH By the IATA definition, OXF is not included in LON. That said, the IATA's definition is not the only one, or necessarily the most useful one. For example, Sabre (and apparently ITA) have a set of US city codes (QLA, QSF, QHO, QMI, QDF) that are handy, but aren't recognized by anyone else.
Comment: And quite possibly "London Oxford Airport" (OXF/EGTK) - at Kidlington.  (BQH is Bigg**i**n Hill btw)
Comment: @choster the city codes seem to mean whatever is most convenient for someone selling something IME, unlike the proper IATA airport codes (though I guess a Google search for "LHR parking" would give some rather optimistic results)
Answer: Practically, it's used for booking only, referring to all airports in Jakarta, as people usually don't care which airport they fly into.
It's like NYC as an umbrella for JFK, LGA and EWR, or TYO for NRT and HND. You are never going to fly into "NYC", as this airport doesn't exist. However, when you book a ticket to New York, you probably don't care much about whether you land in JFK, La Guardia or Newark. In this case, you would probably search for flights to NYC so that you would get flights to all three airports, instead of having to do three different queries.


How to get complement of path in Inkscape?

Question: I would like to get complement of this path in Inkscape.
So, black would become white and what is white would become black .
Also, circular shape should be preserved.
How to do this ?
Answer: In Inkscape, you can change the colours of the fills and strokes for any object to anything you want. Just select an object and change the stroke/fill attribute to the colour you want.
As for inverting the colours of an entire selection, simply select everything you want to invert and hit Filters > Colours > Invert
For the background, you can change it to white in document properties of Inkscape.
Comment: I want that complement of this path is also a path.  I did manage to invert it with Filters > Colours > Invert but I didn't get a path.
Answer: Create a circle and position it behind the path so that it perfectly covers it, then select both the circle and the path and choose Path>Difference in the menu.


even if editor said they are prepared to accept the manuscript. but still possible to be rejected?

Question: I submitted my manuscript this July and got comments from two reviewers and two editors. It seems like there was one reviewer no in favor of my manuscript although s/he did not directly say to reject my manuscript though. The other one was positive and said to accept mine with a minor revision. Overall, editors told me in the email that they are prepared to accept my paper. BUT it will be SUBJECT to how I revise the original manuscript. So since then, I have been revising the manuscript and responding to every single question that editors and reviewers raised.
I am trying to be meticulous and working on revising the manuscript thoroughly.
However, I don't want to get my hopes up. It's kind of self-defense mentality I guess.
According to the editors' comment, are there high chances that my manuscript will be accepted as long as I do my job decently? or I don't know, this is my first time to try to get a paper published, I have any idea on this. Is there still possibility of being rejected even if the revision is not so bad?
Answer: You're trying too hard to parse what the editor is saying because you think that an editor is some kind of black box that operates on its own rules. But in reality, an editor is just a person like you and I, and if that person says something in plain language, it's a reasonable approach to believe that what they say is actually what they mean. That is, if you got a reply that states...

that they are prepared to accept my paper. BUT it will be SUBJECT to how I revise the original manuscript

then that is exactly what you should assume: If you do a reasonably good job at revising the manuscript, then the editor will accept the paper. There is really not more to it than what it actually says -- read it as if your room mate said it.
Comment: Probably, I was trying too hard to understand what the editors said. But getting a paper published is very important and pretty hard in my field, which is why I am obsessed over tiny little things.. But thank you anyway
Answer: Yes, it is possible to still be rejected, but you are doing the right thing to make it less likely. "It ain't over 'til it's over" as Yogi Berra once said.
You are probably in good shape. Get a colleague to review your updates, perhaps for some advice on the overall product.
Comment: I will definitely hire(?) or ask someone to go over my revised manuscript. I am working on all cylinders so if it will be rejected, I am too depressed and frustrated. I hope that does not happen though. Thank you for your comment!


How do you import products into Magento 2 by using the category ID, instead of the path?

Question: The default Magento 2 product import feature only allows you to specify the category path string in the import file. How can I import product by using the category ID instead?
Answer: The extension in the link below allows you to import product into Magento 2, by using the category ID.
https://github.com/EnochDataSystems/ProductImportCategoryId
Comment: the module is not working and have issue in override
Answer: i have gone to same module before,but have some problem in di.xml,i have small and effective way to do it,it is simple
Just Override This File :/vendor/magento/module-catalog-import-export/Model/Import/Product/CategoryProcessor.php
and find function public function upsertCategories()
change whole code of this function like as below

in this sollution u can set category ids like below

it will accept category id as well as full category path as default.
Thanks


WPF, TreeView bug, can't select root item after item removed from treeview

Question: I have a very weird bug in a three level deep TreeView. It is intermittent and I can't find how to reproduce it consistently. After programmatically removing, adding then removing some third level items, when I click on the root item it isn't selected. It can still expand/collapse but can't be selected with a mouse click and it doesn't fire ItemSelectionChange event. You can click to select a second level or third level items and after that you're finally able to select the root item. I've tried to set IsSelected = false for all items after removing and tried to do a nice clean-up when removing items but it doesn't help. Did anybody run into that bug? Do you have any suggestions to remove this bug?
Answer: Happens to me after programatically settings the IsSelected to a node. Then I can't click to select the previous node.
[Edit]
Finally  figured out what was going on. Seems it's not enough to set the IsSelected property, because the tree internal logical focus remains on the old selected element.
The event was sent to the tree item, but because it already had logical focus internally, it didn't fire the focus change (from which I suspect the tree knows when to change the selected item).
If I call focus on the tree node for which I set IsSelected to true, it works fine.
====================
Do you set IsSelected on true for the new added elements? If so, also do a focus, like this:
<code>DependencyObject nodeVisualContainer = mTreeControl.ItemContainerGenerator.ContainerFromItem(nodeToSelect);
            if (nodeVisualContainer is UIElement)
                ((UIElement)nodeVisualContainer).Focus();
</code>
Note: This only does a logical focus on the element. Keyboard focus will not be affected.


Why can't I use gcsfuse command on a Google Instance with GPU and preinstalled TF and more?

Question: My goal is to mount a Google Storage bucket in my Google Compute instance machine.
I created a Google Compute Instance of type

c2-deeplearning-tf-1-14-cu100

It came with various libraries preinstalled, among others CUDA, CuDNN, TensorFlow, and (Python's) GCFSs.
After creating it, I followed the instructions for installation of gcsfuse command. No errors were thrown. However, upon any attempt at using gcsfuse command in bash I'm getting the following error:
: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudart.so.10.0
Traceback (most recent call last):
  File "/usr/local/bin/gcsfuse", line 7, in <module>
    from gcsfs.cli.gcsfuse import main
  File "/usr/local/lib/python3.5/dist-packages/gcsfs/cli/gcsfuse.py", line 3, in <module>
    from fuse import FUSE
  File "/home/user/.local/lib/python3.5/site-packages/fuse/__init__.py", line 3, in <module>
    from .defect_augment import DefectAugment
  File "/home/user/.local/lib/python3.5/site-packages/fuse/defect_augment.py", line 11, in <module>
    from gunpowder import BatchFilter
  File "/home/user/.local/lib/python3.5/site-packages/gunpowder/__init__.py", line 3, in <module>
    from . import nodes
  File "/home/user/.local/lib/python3.5/site-packages/gunpowder/nodes/__init__.py", line 3, in <module>
    from .add_affinities import AddAffinities
  File "/home/user/.local/lib/python3.5/site-packages/gunpowder/nodes/add_affinities.py", line 6, in <module>
    from gunpowder.ext import malis
  File "/home/user/.local/lib/python3.5/site-packages/gunpowder/ext/__init__.py", line 51, in <module>
    import augment
  File "/home/user/.local/lib/python3.5/site-packages/augment.py", line 181, in <module>
    def _surround(aux_fn, around=False, before=False, after=False):
  File "/home/user/.local/lib/python3.5/site-packages/augment.py", line 130, in decorator
    allargs, fn_name = _get_args_and_name(fn)
  File "/home/user/.local/lib/python3.5/site-packages/augment.py", line 37, in _get_args_and_name
    code = fn.func_code
AttributeError: 'function' object has no attribute 'func_code'

It appears not only when I'm trying to mount any bucket in my machine, but even upon calling gcsfuse --help.
My guess is, because the error is clearly Pythonic and not Go-like, maybe the preinstalled Python GCSFs somehow corrupted here. However, according to the documentation, the GCSFs also should enable using the bash gcsfuse command.
Any help greatly appreciated. Thanks!
Answer: I think https://github.com/GoogleCloudPlatform/gcsfuse/issues/331 may be of interest.  Users reported success qualifying the full path /usr/bin/gcsfuse.


What affects the lifespan of plasma

Question: When I was reading up ion thruster and ionocraft, I saw this concept of plasma lifespan. But I can't find any information or study done on what affect the lifespan of plasma. Is it pressure? Electric field strength? Or something else?
Answer: There exists three conditions a plasma must satisfy (taken from [1]) :

$\quad \lambda_D \ll L $
$\quad N_D \ggg 1 $
$\quad \omega \cdot \tau \gt 1$

Here $\lambda_D$ denotes the Debye length:
$$\lambda _D \equiv \Bigg ( \cfrac{\epsilon_0kT_e}{ne^2} \Bigg )^{\frac{1}{2}}\, ,$$
and L is the dimension of the system.
The second equation simple states that the density is high, so that the plasma cannot be treated as a simple Newton fluid of neutral charges.
And the third condition is the one you ask:
Here $\omega$ is the typical plasma oscillation frequency and $\tau$ is the mean time between collisions with neutral atoms. If this condition doesn't hold, it behaves like more a neutral gas rather than a plasma.
The plasma frequency is
$$\omega_p =  \Bigg ( \cfrac{n_0^2e^2}{\epsilon_0 m} \Bigg )^{\frac{1}{2}}\, ,$$
where $n$ is the electron density, $m$ the mass of an electron and $e$ the electron charge.
When an ion and an electron collides at a relative low velocity (you can take a Maxwell-Boltzmann velocitiy distribution), there exist a probability of recombining into a neutral atom. In case the loss of plasma by recombination is larger than the one of generation, the plasma will for short or long disappear. The loss of plasma can be due to radiative or three-body (a third particle is involved) recombination.
Or for instance if the magnetic bottle isn't strong enough to maintain the plasma. The plasma involves also a pressure which has to be taken into account. Hence when you cannot hold the plasma by an external pressure, the plasma will cool down and increase in volume, and the electrons and ions will recombine --> no longer a plasma.
Therefore the recombination rate (electron and ion) has to be at least equal or less than the generation rate (collisions of atoms lead to an (more) ionized atom and an electron).
BTW: There many good books concerning about Plasma Physics, but I like this the most:

[1] Introduction to Plasma Physics and Controlled Fusion,  3rd edition, by Franics Chen

What affects the lifespan of plasma