MVC 3 Partial View and what I need to send to it?

Question: I am wondering about a couple variations of forms and partial forms.  The submit is on the parent page and I have varied what I pass to the partial view.  I have a parent view with a related HomeViewModel (which has public properties Name and public Person Employee {get;set;}
1.) Scenario 1: The main view has something like the following
<code>@model MasterDetailSample.Models.HomeViewModel

@using (Html.BeginForm()) {
    <div>
        @{Html.RenderPartial("_PersonView", @Model);}
    </div>
    <input type="submit" value="Save" />
}
</code>
In this scenario I am passing to the partial view _PersonView the entire HomeViewModel.  Within _PersonView partial view I have to reference a property of the HomeViewModel i.e. Person object via @model.Employee.Name (in this scenario the submit is on the parent form (not within the partial view))
When I hit submit on the form (POST) in the controller i have to access the property of Employee "Name" via the following model.Employee.Name
This seems to work however notice the following variation scenario 2 (where I only pass to the partial the Employee object)
2.) Scenario 2
In this scenario I only want to send the Employee object to the partial view.  Again the begin form and submit is on the parent form.
So from the parent form i have
<code>@{Html.RenderPartial("_MasterView", @Model.Employee);}
</code>
and so within the partial view i reference the Name property of the Person object via @Employee.Name  Now when I submit the form within the controller the Employee object is not available from the auto model binder.  I can access the properties via formcollection but not from the model parameter
i.e.
<code>    [HttpPost]
    public ActionResult Index(ModelViewModel model) {
        **//model.Employee is null!**
        return View();
    }
</code>
Why? (is model.Employee null)  I would like my partial view to only accept an object of type Person however after submitting from the parent page, the Employee property is null.  On the partial view I am using the following on the @model line
<code>@model MasterDetailSample.Models.Person
</code>
I would like the partial to only need a Person object to be sent to it, but I would like the submit on the main form.  If i do it this way I can re-use the partial view in a few situations however IF i must send HomeViewModel i have significantly limited how I can use this partial view.  So, again, I only want to use Person as the model with the partial view but I need to be able to access the properties when submitted from the parent view.
Can this be done? If yes how?
thx
Answer: You have a couple of options:
1) One I recommend -> Dont use partial views, instead use EditorFor and create an editor template for Person. With partial views the context is whatever model you pass into the view, this is why your example (1) works and (2) not. However with editor templates the parent context is taken into consideration with the html helpers and will generate the correct input names. Have a look at Darin Dimitrov's answer to a similar question.
2) Use your second example as is, but change the post action to look something like this:
<code>[HttpPost]
public ActionResult Index(ModelViewModel model) {
    TryUpdateModel(model.Employee);
    **//model.Employee should now be filled!**
    return View();
}
</code>
3) Use custom html helpers that accepts prefix for input, see this answer I posted a while back for example code. You could then use this inside your partial view.


How do I play Urban Terror with bots?

Question: I'm loving urban terror, but sometimes I just want to play it "offline." Is this possible?
Answer: Yes there is. To add bots to a game:

First tell the server to allow bots, press tilde (~) to open the console and type:
/bot_enable 1 and start the server through the appropriate menu choices
If the server is already running, type:
/reload then you can start to add the bot(s):
To add a bot, use the command:
/addbot <type> <level> <team> <ping> <server nick>

The <type> should use one of the following bot file names:

boa
cheetah
chicken
cobra
c ockroach (<== space between the C and the O added to pass BB filters)
cougar
goose
mantis
penguin
puma
python
raven
scarab
scorpion
tiger
widow

The <level> should be an integer between 1 (n00bish) – 5 (malevolent)
The <team> should be either Blue, or Red
The <ping> is just a placeholder, put 76 in
The <server nick> should be what you want to name the bot

To recap, the following would add a level 4 bot called "ThePuma" to the blue team:
/addbot Puma 4 Blue 76 ThePuma
Each bot type has it's own weapon load out – Puma for example uses a LR300ML + Spas + Baretta combo. By making sure at least 1 bot has the same weapons as you, you'll never run out of ammo.
Tactically, the bots are not very bright, and you can't give them orders like q3 bots, however they do use the same evasion techniques (varying levels of crouching, bunny hopping and strafing) as live players, with varying levels of aggression.

Bot configuration files

If you want to add more than one bot at a time, you might want to make a .cfg file which you save to your q3ut4 directory

/====== sample_bot.cfg======

addbot C ockroach 4 Blue 76 =lvl4=C ockroach

addbot Cheetah 4 Blue 56 =lvl4=Cheetah

addbot Cobra 4 Blue 45 =lvl4=Cobra

addbot Penguin 4 Blue 89 =lvl4=Penguin

addbot Puma 4 Blue 89 =lvl4=Puma

addbot Puma 1 Blue 89 =lvl1=Puma

/====== sample_bot.cfg======

Get the server to load this by simply typing:
/exec <filename>

Note while the example above tries to add bots to the blue team – the server will spread them evenly on both teams – so add an even number or face the chagrin of continually getting pwned at spawn, by bots.
As mentioned before, the bots mimic certain aspects of real life, in teams they will mimic certain aspects of team life, like occasionally tking you for no reason, ignoring calls for backup or medic, and appearing to be AFK at spawn.

Removing bots:
          /kick <nick>

If you have more than 1 bot, or you can't be arsed typing whatever l33t nick you gave that 1 bot you added, you can use this to take all bots off the server:
/kick allbots

though be warned the server checks for nick matches in the player list first, so player 'allbots' would probably not be too happy with you, having been bumrushed off the server for no apparent reason.

Maps for running bots

Not every map in UT4 has bot support, the following do, sort of:

Abbey
Algiers
Austria
Dressing room
Firing Range
Mandolin *
Riyadh
Prague*
Toxic*
Uptown

Some maps work better than others – the maps marked with an asterisk are maps where the bots have trouble getting out of the spawn points.
The maps found most useful in upping my game are :

Firing range - good for close quarters practice
Riyadh – add several bots for sniper target practice
Algiers – for finding sweet spots on the map to fire from cover
Dressing room – for mixed terrain levels + varying range battles – though bots will fall into the river in the middle and remain in there.

and again:
Basic tutorial on bot setup, detailed bot info and gear, and setting up configs(easy bot addition).
Comment: This answer looks to be plagiarised from [here](http://www.urbanterror.info/forums/topic/6906-running-bots-in-ut4/) without attribution (including the changing spelling of cockroach to bypass filters we do not have here). Content like this should be attributed.
Comment: I did tha("\addbot Penguin 3 Blue 10 firstbot"), but it says the bot name is not defined. It's the same with other names :(
Comment: @madTux it should be /, not \ before addbot
Comment: @AshleyNunn The first link I attributed links to the urbanterror forums

How do I play Urban Terror with bots?


When Does the Blood Arcanist Gain the Arcanist Exploit Class Feature?

Question: The Blood Arcanist loses her Arcanist Exploits at the 1st, 3rd, 9th, and 15th level.  My question is if this also means that the Blood Arcanist does not count as a character that possesses the Arcanist Exploit class feature until 5th level.  I ask because I was considering taking Extra Arcanist Exploit at 1st and 3rd level, but I wasn't sure if doing so would be legal.
Answer: I don't think that's legal by the RAW.  The rules on archetypes specifically say that:

A character who takes an alternate class feature does not count as having the class feature that was replaced for the purposes of meeting any requirements or prerequisites.

The wording of the blood arcanist ability states that:

This ability replaces the arcanist exploits gained at 1st, 3rd, 9th, and 15th levels

At 1st-4th level you have not been granted the arcanist exploit class feature, you don't qualify for the feat.
So RAW I don't see much wriggle room.  But since the Blood Arcanist does eventually get exploits, and they function off your full, normal arcanist level, I don't think there'd be any balance reason to enforce this rule.
Comment: Not sure the Blood Arcanist is considered as losing the Arcanist Exploit class feature. It is modified, but he technically still has the feature.
Comment: I can also technically retrain whatever feats I get at 1st and 3rd level when I reach 5th level, yes?
Comment: @user3735278 I suppose so, although that sort of [general retraining](http://www.d20pfsrd.com/basics-ability-scores/more-character-options/retraining) is an optional rule, and so entirely up to the DM.  (Some classes, like the fighter, specifically let you retrain your bonus feats as part of their core functionality, but the general rules are optional.)
Comment: ...Corroborating evidence *for* "if you lose a feature like this you don't have it": Havocker Witch.  Evidence against: ...I'm not sure that RAW you *couldn't* pick up exactly one Witch Hex if you gained a feat w/ your Witch 1; it says "from second level on" in the text of what's being replaced.


Do you need to re-install a Windows service after rebuilding

Question: If I rebuild a Windows Service after making changes, can I just copy and replace the old assembly / .exe files to get those changes to run or do I need to re-install the service? Also do I have to first uninstall the service before installing the new version?
Comment: No, it's not needed to re-install. Just copy the files. And if you install the files from the Bin directory of the Visual Studio, just a build will update the service already.
Answer: You don't have to uninstall and reinstall the service since this only adds registry info regarding the executable path and launch options. Just stop the service, copy your assemblies and restart it
Comment: When you installed the service, you installed it from a directory. This is the root of your directory structure so you should copy your assemblies there. To find out what directory your service was installed from take a look at its properties: `sc qc SERVICE_NAME` and look for the BINARY_PATH_NAME property
Answer: You do not need to uninstall the service just make changes in your files after stopping the service and then start again it will consider your changes..
I would suggest you to use Topshelf for service hosting.
Comment: What is the advantage of Topshelf? Also I have no config files, I was more talking about rebuilding so that there are changes to the actual application/assembly
Comment: I meant for the files you need to replace not just config file sorry for that @Dan and for topshelf I said because I am using it in many of my services http://www.christophdebaene.com/blog/2011/03/16/create-a-net-windows-service-in-5-steps-with-topshelf/ and http://www.codeguru.com/columns/dotnet/services-made-easy.htm


What is this plant with ivy-like leaves and pink flowers?

Question: Can you help me identify this plant? Is it a vine?
Comment: Does look similar to a geranium.
Answer: This plant is a Pelargonium Peltatum / Ivy-Leaved Pelargonium. It's closely related to the zonal pelargoniums. (And hence often somewhat mixed up)
Typical characteristics are

waxy, ivy-shaped leaves
long distances between the leaf nodes and thus
trailing or hanging growth, suitable for window boxes, hanging baskets or similar
often, but not always with flower clusters that apperar more sparse or "thinner" then their p. zonatum relatives.

In Central Europe (where I live), Pelargoniums are "the" plant for window boxes etc., so I've seen my share of them. Especially the ivy-leaved P.s (simply called "Hängegeranie" / hanging pelargonium here) can look spectacular.
Comment: This answer is correct, point given - there's one on my balcony as I write, struggling to survive the winter, very common in Europe
Comment: I jest a bit - its in a sheltered corner, growing up a wall, out of the rain, and has been there 4 years, is currently 4 feet high. It's the wet cold that kills them, keep 'em dry and they survive up to 10 degrees of frost. It currently has eight flowers out!
Answer: This plant has a common name of zonal geranium or pelargonium. They are native to South Africa but are more commonly seen as outdoor bedding plants where they are treated as annuals.
To positively identify this plant there should be hairs on the underside of the leaves and the flower should be similar to this:

and the leaves should be similar to this
Comment: Pelargoniums come in many varieties - sometimes with smooth, glossy, sometimes with fluffy leaves. OP's picture shows a variety that tends to have long stems between the laeves (often the smoother-leafed varieties), which are often left to hang/trail over balconies or from hanging pots. @kevinsky's pictures show a "upright" variety that doesn't need support.
Comment: I don't see any points on the leaf margins of the plants you pictured, or any gloss. It doesn't look right.


official github windows command line client

Question: Does GitHub offer a Windows command line client any more? I remember using one a few years ago but https://desktop.github.com/ is all I can find on their website and it looks like a GUI only tool.
Answer: It looks like GitHub doesn't have their own command client for Windows any more (or at least not one that they package up and advertise on their website).
https://gitforwindows.org/ seems to be the closest thing as out of the (as of August 2019) six maintainers, two work for GitHub and two work for Microsoft: https://github.com/orgs/git-for-windows/people
It's also the version of Git available on Git's website at https://git-scm.com/


How can I install Uplay on ubuntu?

Question: As stated in title, how can I do it? When I start Uplay it gives me an error and it's all.
Answer: You can't yet , there are still alot of bugs needed to be fixed
Check out this link for more information
http://www.winehq.org/pipermail/wine-bugs/2012-May/322485.html
If you really need to use this on Ubuntu , there is still one way , Install Windows 8 ( Free Version ) in Virtualbox and through that , you play the games.
you can also check out another game client that runs nativly on Linux
DESURA
http://www.desura.com/
Answer: Of course you can install Uplay in Wine and play Windows games. For me the simplest way was to install Lutris. See https://lutris.net/
There is a script which helps you install Uplay https://lutris.net/games/uplay/
Also Lutris helps you istall Steam in Wine to play Steam games for Windows
Answer: My experience on Ubuntu 20.20 is that for Steam, you don't need Wine or anything, it'll install all the necessary things on its own. As for Uplay, I managed to get it working with Wine-staging and Lutris with the help of this guide: https://www.lifewire.com/how-to-get-gog-galaxy-on-linux-4689192 (I didn't need GOG so I summarized the whole process here: https://edison23.net/blog/uplay-on-ubuntu/ ; not much new there compared to the original guide, just less explanations of what Lutris and Wine are).

How can I install Uplay on ubuntu?


When does the computed field get calculated?

Question: I don't understand when a computed field computes. Does it compute when the fields it draws on are updated or when someone views the node it's used in?
Answer: From  Computed Field Module:
Computed Field is a very powerful CCK field module that lets you add a custom "computed fields" to your content types. These computed fields are populated with values that you define via PHP code. You may draw on anything available to Drupal, including other fields, the current user, database tables, you name it. (Feeling the power yet? :) ) You can also choose whether to store your computed field values in the database with other content fields, or have them "calculated" on the fly during node views. (Although you should note that Views use requires database stored values.) This field is literally the Swiss Army knife of CCK fields. So start cooking up your PHP based values!
In the documentation page ( http://drupal.org/node/126522 ) it also says:
When is the field actually computed?
If you wish to store the values in the database then you have to update or re-submit the node to compute the value of the field.
If it is not stored in the database then the value computes when the node loads and only when the node is loaded. The field will not work in views nor will it function properly if it depends on other non-stored computed fields.
More information from drupal.org and what appears to be a good page of snippets is http://drupal.org/node/149228
Comment: If save the fields on the database but need the computed fields to be recomputed when the node is loaded, without re-saving the node, use the computed field tools module (http://drupal.org/project/computed_field_tools).
Answer: These days (more then 3 years after this question was asked), there is a NOT commonly known/used alternative available for the Computed Field module, i.e. the (fairly new) Math Field module (for D7). Some more details about this module (from its project page), which also details when the calculations actually happen:

The Math Field module defines a new field type to dynamically calculate values on entity forms. This is an alternative to Computed Field
  that does not require the use of PHP Filter.
Math expression fields are dynamically updated via ajax on the entity form as soon as all necessary fields are populated. If JavaScript is disabled, the field will be evaluated when the form is submitted. The result is stored in the database when the form is submitted.

For more details (step-by-step instructions), refer to either of these links:

the (amazing!) Community documentation about the Math Field module.
the interesting article about Introducing the Math Field module, which also includes some screenprints to see it at work (such as the the add/edit form example).

Known issues
As this is a fairly new D7 module, there are still a few (known) issues with it, as mentioned also on its project page:

The cTools math expression library causes an error when using function that take more than one parameter. This effects pow(), min(), max() (#1958538: Improve math expression engine).
Math Field does not yet support multivalue options fields (checkboxes, or multiselect) (#2483453: Add aggregate functions for multivalue fields).
Math Field does not yet support Field Collections (#2573643: Support the Field Collection module).

Bonus: you would not need the "PHP filter" (IMO only that should be a valid reason to investigate this alternative) ...


Will a computer fail sooner the more you use it?

Question: Is a computer like a car in the sense that the more you use it the quicker it will break down? Assuming that we have a regular computer with SSD that is running 24/7 versus a computer that is run everyday for only 8 hours. Which computer will fail faster?
Comment: The SSD is perhaps the most use (writes) sensitive component with wear levelling being implemented to spread usage across the whole device. High temperatures degrade many components faster  and some more critically so. Electrolytic capacitors have a finite design life. If the system is run at designed temperatures you should typically exceed design lifetime. Higher temperatures than designed are destructive.
Comment: I'm very inclined to see this as a design question and not a usage question. People are welcome to seek to convince me that it should not be reopened - or that it should be.
Answer: There's no simple answer to that. There are different types of stresses that may all contribute to the lifetime of the parts a computer is built from.
Some types of stress are directly related to operating hours. For example, some chips can be degraded over time by electromigration effects in the silicon crystal. Basically, atoms may move in the crystal lattice because they are under the effect of a high current density, or a high electrical field strength. In most cases, however, it takes decades until this leads to a defect.
Some types of stress are related to switching the circuit on or off. For example, this can be related to inrush currents when switching on, which can degrade certain components, predominantly in the power supply.
Some types of stress are related to temperature. For example, aluminum electrolytic capacitors degrade faster in hot environments. Leaving the computer on may expose them to higher temperatures on average, hence shorter lifetime.
Some types of stress are related to temperature changes. For example, mechanical stresses due to temperature gradients may affect the reliability of solder joints, and can eventually lead to contact failure. Those types of stresses are best avoided by keeping temperatures constant, which would mean to leave the computer running.
Some stresses are associated with usage of a component. For example, SSDs rely on NAND flash chips, which consists of memory cells that degrade whenever they are reprogrammed. Therefore, an SSD has a limited lifetime in terms of write operations.
Some stresses are related to mechanical wear-out. For example, bearings of motors, for example of a fan, eventually fail after a certain amount of time due to mechanical wear.
You see: The various types of stresses are in conflict regarding how to avoid them. This is why there's no easy answer.
However, in server applications, where the computer usually runs 24/7, it is typically the power supply that fails, which is why many servers or network switches have redundant power supplies that can be exchanged while the system keeps running. The same may apply to fans, which sometimes can be exchanged during operation, too.


How to lock the pdf document In salesforce?

Question: I am sending an email with PDF Attachment through a workflow. The user should not able to Edit the document which he received by email. He should open and download and review but should not Edit the document before download it. Is there any option to lock the email document?
Comment: Did he able to edit PDF?
Comment: Yes. Now he is ablet to edit PDF
Answer: I don't think its possible without using any third party API. Once user receive the PDF at there end they can do anything they want.
Password Protect A PDF Via API For example you can use these API to prevent any modification (It looks like a paid api you can try google to find any free api).


Uncountable subsets of $\mathbb{R}$ is bijective to $\mathbb{R}$

Question: The context of the question is the following: We can show that the cantor set is uncountable by showing it is non-empty, perfect, and complete. What I'm not clear on is, to show that it has the same cardinality of $\mathbb{R}$, do you have to invoke some extra axiom into set theory? Please forgive me if the question is very niave, but this is something I've just used intuitively and never really given it much though: the continuum hypothesis says that there is no set whose cardinality is between the cardinality of the integers, and the cardinality of the reals. Wikipedia says that the continuum hypothesis is independent of ZFC, so does that mean that the result (there is a bijection between cantor set and reals) if we adopt the continuum hypothesis, and the proof is not sufficient if we reject the continuum hypothesis? Thanks.
Comment: From a set theoretic point of view, the Cantor set is $\{0,1\}^{\mathbb N}$ (and from a topological point of view too, using the product topology). Can you show this set has cardinality continuum? Consider the binary representation of numbers.
Comment: @PedroTamaroff Hi Pedro. I have seen that proof before. I guess I'm not trying to find "a" proof, but just trying to understand what exactly makes the one I mentioned work.
Comment: @user124910 I don't think you're think of the same proof as Pedro. You're thinking of a proof that the Cantor set is uncountable; he's thinking of a way of setting up a bijection between $\mathbb{R}$ and the Cantor set.
Answer: With the Continuum Hypothesis, the fact that the Cantor Set has the same cardinality as $\mathbb{R}$ is trivial; without the Continuum Hypothesis, it's no longer trivial, but it's still true. PedroTamaroff has suggested a good approach to the proof in the comments. In fact, though, it's provable in ZFC (that is, without appealing to the Continuum Hypothesis) that all "easily definable" sets of reals (for a particular technical definition of "easily definable") are either countable or of the same cardinality as $\mathbb{R}$. This is actually proved by demonstrating that uncountable "easily definable" sets always contain copies of the Cantor set.
Comment: Ok yes, I think I understand. I guess what I was trying to ask is, if you're only given ZFC, then is it true that the argument I suggested is no longer sufficient? Pedro provided an argument that does not require one to accept or reject the continuum hypothesis.
Comment: The argument you suggested is missing a massive part. You're relying on the existing fact that perfect sets of reals are uncountable; this is true, but requires its own proof. A simple diagonalization argument is enough for that, but doesn't show anything more. If you start from the theorem that perfect sets of reals have cardinality equal to that of $\mathbb{R}$ (which is provable in ZFC using Pedro's argument, not diagonalization) then your argument shows in a straightforward way that the Cantor set has that cardinality.
Answer: No extra axioms other than those in ZFC are required to prove that there is a bijection from the Cantor set to the set $\mathbf{R}$.
Consider the following facts:
It can be proven (in ZFC) that a Cantor set has the same cardinality as the set $\{0,1\}^{\mathbf{N}}$.
This set of all countable sequences of $\{0,1\}$ can be show to have the same cardinality as the set $\mathbf{R}$.
Therefore it can be proven that there is a bijection from the Cantor set to the set of reals within the ZFC axiom system. The Jech book contains the details of the proofs.


How do I save my Xbox Live Profile to a USB drive?

Question: I want to take my profile and save it to a removable USB drive. How do I do this?
Answer: First you'll have to format the USB drive so that your 360 can use it to store data. Here's a page on Xbox.com that walks you through the process, but the basic steps are:

Plug in the flash drive
Go to System Settings under My Xbox
Select Memory, then select USB Storage Device
Choose whether you want to use the entire drive for Xbox storage (up to 16GB), or only a portion of the drive (leaving the rest for files from your PC or whatever)

Now that the drive is set up, you can move your profile to it:

From Memory, select your hard drive and then choose Profiles.
Select your profile, and copy it over to the USB drive.

If your goal is to be able to take the flash drive with you when you play elsewhere, you might also want to move your saved games over as well. I keep my Rock Band save data on my removable drive so I can use my characters and bands at my friend's house, for example.
Answer: From the (now defunct) Amazon discussion boards:

Plug the flash drive in, go to your
system menu and then go to memory.
Configure your flash drive to create
an Xbox partition. Now your flash
drive will read as a memory unit. Copy
your gamertag over.
Also, make sure that you've downloaded
the latest Xbox system update to your
Xbox so that the option to use a flash
drive is enabled.


Force.com Sites, how do I get login credentials for a page

Question: I have created a visualforce page for a force.com site. I want to have authentication using the standard force.com sitelogin visualforce page. What credentials are used to get into the site? I want staff who don't have Salesforce user licenses to be able to see the content.
Answer: To have non SFDC users login to a community site, please check:
From https://help.salesforce.com/HTViewSolution?id=000006778&language=en_US
Guest user licenses are required for force.com sites.
EE/UE orgs are allowed to create up to 25 sites hence the 25 guest user licenses.
Each site has a special user with a user type called guest user type
Guest users have no password, no role and have no API access on their profile.
You can't login or do client side api call (only within apex code).
If you need
API access for guest users, the  "Guest API Access Enabled" org permission needs to be enabled.
There is no session for guest browsing
Each guest user (site) has a unique profile (public access settings)
These profiles are associated to guest user licenses which give the ability to read/create on standard objects and full CRUD on custom objects.  However, by default no CRUD is given.  Admins needs to enable the right level of access based on their flow
We advise private sharing for the objects that are enabled for sites
Guest user licenses can't be used for any other purposes other than Force.com Sites.


MediaWiki extension to support taxonomy by genus and species

Question: I'm trying to build a MediaWiki-based website for a very specific purpose. Namely, I would like to create a field guide for a specific group of animals (reptiles and amphibians). Since the people I would want to generate content on the website aren't necessarily techies, I'd like to make things as easy and painless as possible for contributors.
Now, in most groups of animals, taxonomic designations are fluid, and change all the time. As an example, consider the following:
A species used to be called Genus1 species1. It was then called Genus2 species1. As of now, this species has been split into several species, say Genus2 species1, Genus2 species2, Genus2 species3, etc. In the worst case, anything about the nomenclature and classification of the species could change, including, but not limited to, the species being moved, split or merged with any other species.
For users, these changes should be transparent. That is, on typing in http://url_of_wiki/wiki/Genus1_species1, they should automatically be redirected to the lowest taxonomic group (in this case Genus2) that is non-ambiguous. Essentially, if a page is redesignated (moved, split or merged), I would like to automatically create all new pages and redirects required.
I should be able to implement this as an extension quite easily. However, I've read the MediaWiki documentation on extensions, but haven't been able to figure out just what part of MediaWiki it would be best to target.
So, the question is, is this type of extension best implemented as a parser extension, by adding new tags, or a user-interface extension, or a combination of the two (a user-interface extension backed by a parser extension)?
Answer: Nice challenging problem! If it were up to me I would solve it in a different way:

use page level for genera and
sub page level for species.

This will automatically take care of renaming since redirects will be made.
Alternatively:
 - use page level for species and
 - categories for genera.
Then use an if pagename template (see Wikipedia example) to change the category based on the page name.
Or possibly combine these methods.
(See also Wikis and Wikipedia)


Rewrite MFC DLL with C#?

Question: I have a plugin DLL that I've written in C++ MFC loaded by a 3rd party application presumably written in C++ with MFC.  My DLL has a GUI interface and is based on CWinApp; I guess somehow the message pump of my plugin cooperates with the message pump of the main app (?)  I believe my DLL is probably loaded via LoadLibrary and started via a call to an exported function in my DLL.  My plugin calls functions and classes that the 3rd party application exposes via a static lib that my DLL links against.
This is fine but working with MFC/C++ is frustrating as compared to working in WinForms and C#.  So I'm wondering if it would be possible to have my DLL not use MFC but instead use winforms and C#?  Is there some way this could work?  I'm imagining I guess the DLL written in C# that exports a function that is called from the 3rd party app and then this starting a winforms app?  Also my DLL needs to link to a static C++ library in order to interop with the 3rd party application.  Would that be possible to access from C#?  Or if not directly possible maybe I can write some kind of wrapper?
Answer: The easiest way would be to wrap your C# dll with a C++ dll.  Just create a shell in managed C++ that accepts whatever calls need to be handled from the main program.  It can then call into the C# dll and let it handle all the work.

Rewrite MFC DLL with C#?


Is Haki based on anything real?

Question: In One Piece series, there's this 'will' technique called Haki. Is this based on anything real, all three of them?
Comment: Anime is far from reality, imagine the disaster if such cases is for real. Perhaps, we human being only have natural instinct, and that is the reality.
Comment: http://onepiece.wikia.com/wiki/Haki has some info on it but not much. It's under the trivia part
Comment: I wouldn't say Haki is real but i think its the closest to severe and thorough Martial arts body condition training. We have seen people punch through several bricks, or Muay Thai fighters break an entire opponent's arm and part of the ribcage by just a kick... its body conditioning through vigorous training for years.
Answer: I am not entirely sure about the credibility of this but it does make sense and the only info I could find. Taken from the wiki under Trivia and from this answer

Haki appears to be similar in principle to common types of Qi (Chi)
  found in various other anime and manga series; which is based on the
  concept of "qi" (or "life-force") in Chinese philosophy.
The concept of Kenbunshoku Haki, known to Skypieans as Mantra, is
  loosely based on the style of thinking in Hinduism, which goes by the
  same name.

The original Japanese term is ki (pronounced the same as "key", written as 気). It can also be spelled chi or qi. The same term is used for a concept in martial arts.

Is Haki based on anything real?


The measure generated by the Cantor staircase and the intersection of the Cantor set with its translate

Question: Suppose that $T$ is the shift $\bmod 1$ of the Cantor set by an irrational number $\alpha\in (0,1)$. Consider the measure $\mu$ on the interval $[0,1]$ generated by the Cantor staircase. I'd like to know whether (if it is known) $\mu(T(C)\cap C)=0$.
Comment: but the irrational shift (mod 1) does not preserve the cantor set
Comment: I think that this is going to depend on $\alpha$. You can work out a partial result from the fact that the Cantor measure is Haar with respect to its natural group structure, though.
Comment: Haar concerning what?
Comment: Think of the Cantor set as $\sum_{k=1}^\infty \frac{2x_k}{3^k}$ where $x_k \in \{0,1\}$. This identifies the set with the compact group $\mathbb{Z}_2^{\mathbb{N}}$. The Cantor measure is a Haar measure with respect to that group structure.
Comment: Sorry, yes I was not reading carefully enough.
Comment: don't worry Chris
Answer: Yes, $\mu((C+\alpha)\cap C)=0$ for all irrational $\alpha$ and for most rational $\alpha$. This can be inferred from the description of $(C+\alpha)\cap C$ on page 57 of [DH95]. I offer a translation of their terminology  ("(1,1)-string sequence", etc). Assume $\alpha$ is not a ternary rational (i.e., does not admit a finite ternary expansion). In the ternary expansion of $\alpha$, the following digits are restrictive:

all digits $1$
digits $0$ that are preceded by an odd number of digits $1$
digits $2$ that are preceded by an even number of digits $1$

Each restrictive digit of $\alpha$ forces the corresponding ternary digit of every element $x\in (C+\alpha)\cap C$ to take a particular value, $0$ or $2$. (As opposed to being free to choose between $0$ or $2$.) Thus, every restrictive digit halves the Cantor measure of the intersection.
It is easy to see that every number that is not a ternary rational has infinitely many restrictive digits.
For a more elaborate investigation of the Hausdorff measure and dimension of the intersection, see [PP13].

[DH95] Davis, Gregory J.; Hu, Tian You.
On the structure of the intersection of two middle third Cantor sets.
Publ. Mat. 39 (1995), no. 1, 43–60.
[PP13] Pedersen, Steen; Phillips, Jason D.
On intersections of Cantor sets: Hausdorff measure.
Opuscula Math. 33 (2013), no. 3, 575–598.


A higher odds ratio but a broader confidence interval

Question: I have derived two logistic models. one has just the predictor. Other has the predictor adjusted for few co-variates. The odds ratio of the predictor in the first model is 4.6 (1.39-16.70) and the odds ratio of the same predictor from second model is 8.23(1.56-56.7). Now how should I interpret these odds ratios? Is it better because OR increases or the second OR not reliable due to broad CI?
Comment: Considering your ranges, the two are not very different. It appears that your sample size is small and hence the confidence intervals are very wide. However, the factor seems to be a significant predictor of events with OR of at least 1.56 (very likely more) after correction for covariates. OR after correction of covariates is generally considered a more precise indicator.
Answer: The one that has been adjusted by including other covariates and confounding variables is the so-called better one. Just the magnitude and width of 95% CI tell very little as the original estimate could have been biased upward or downward.
Also, don't be distracted by the "broader" interval. OR operates on a log scale and the CI will appear much wider just because the point estimate is higher. When the actual mean and its 95% CI are expressed in logit (by taking a natural logarithmic transformation), the widths of the CI actually aren't terribly different:
1.53 (0.33, 2.82), the width is about 2.49
2.10 (0.44, 4.03), the width is about 3.59


Can I say two physical systems are isomorphic?

Question: I wonder if it makes sense to say two physical systems are isomorphic to each other. Say if I have a system of electron spins in a magnetic field, and another system with an ammonia molecule. Since both systems have two basis quantum states (or by approximation), can I say the two systems are isomorphic to each other, or there's an isomorphism of their eigenstates?
Comment: [Maybe useful?](https://physics.stackexchange.com/questions/590471/in-what-way-are-the-hilbert-spaces-of-non-interacting-quantum-field-theories-dif)
Answer: Based on the example in the question, I'm interpreting physical system to mean mathematical model of a physical system (also called a theory). That's important, because isomorphism is a mathematical concept — but I'll bend that rule a bit at the end of this answer.
An isomorphism is an invertible map between two things that preserves the structure(s) of interest. The same two things can be both isomorphic and non-isomorphic to each other, depending on which structures we want to preserve.
If the Hilbert space is the only structure of interest, then for any given $N$, all system with $N$-dimensional Hilbert spaces are isomorphic to each other.
For physics, we also care which operators represent observables, and we care about time. At a minimum, for each time-interval $T$, a model should specify which operators $\Omega(T)$ represent observables at those times. (I'm using the Heisenberg picture, which is usually the best picture for conceptual clarity even if it's not always the best picture for calculation.) A more refined concept of isomorphism is one that preserves this structure. Explicitly: An isomorphism between models $1$ and $2$ is a unitary transformation $U$ from one Hilbert space to the other, such that $U\Omega_1(T)=\Omega_2(T)U$ for all time-intervals $T$.
In quantum field theory (QFT), we care about the association between observables and regions of spacetime, not just time-intervals. An even more refined concept of isomorphism would thus be to require $U\Omega_1(R)=\Omega_2(R)U$ for all spacetime regions $R$. Assuming that spacetime has some geometric symmetries, like Poincaré symmetry, we could improve this concept of isomorphism by allowing $U\Omega_1(R)=\Omega_2(R')U$ where $R\to R'$ is an isometry of spacetime.
In mathematical physics, especially in the study of 't Hooft anomalies, a different definition of QFT is often used. Roughly, a QFT is a functor from a category of structure-preserving bordisms, such as spacetime-metric-preserving bordisms, to a category of Hilbert spaces. (I listed some references in another question.) In this formulation, we could call two models isomorphic if the functors are naturally isomorphic, using category theory's off-the-shelf definition of natural isomorphism.
If a theory is meant to be applied to the real world, then its postulates must specify some kind of association between elements of the mathematical structure and elements of the real world. In quantum theory, this means specifying which operators represent which real-world observables (measurable things). We might try to use a definition of isomorphism that enforces that association, but that's going beyond the scope of pure math, so making it precise is probably difficult. On the other hand, such a concept of isomorphism probably isn't needed, because two models that are isomorphic in that sense are really the same model in absolutely every way that matters for physics, so we might as well just call them same instead of isomorphic.
Comment: @LiliFN That's not what I meant to say. If two mathematically-identical theories are associated with different real-world systems, then they are different theories. They are isomorphic mathematically, but different physically. If two models have the same mathematical structure and also have the same physical interpretation, then we might as well just call them the same, without any qualification. That's what I meant to say. The word isomorphic is normally used when they are the same in some ways but might still be different in other ways.
Comment: Thanks so much for the great explanation:)
Comment: @Chiral Anomaly thanks for clarifying!
Comment: I have a question about the distinction between equivalence of theories vs.  "objects"? For some purposes, all gases of particles with 5 degrees of freedom can be put into one equivalence class, yet you wouldn't say a gas of oxygen molecules is the same as a gas of nitrogen molecules - because there exist other theories in which they would not be put into one equivalence class. When you say there is no point in specifying what real-world systems the "isomorphic" theories are associated with, is that meant for the fundamental theory rather than  effective theories, e.g. statistical physics?


To kill or remove an Indestructible

Question: Will the following cards kill something with "indestructible"?:

Swords to plowshares
Terror
Wrath of God
Answer: Indestructible means the permanent cannot be destroyed. Something would be destroyed if something says to destroy it, or if it takes lethal damage (e.g. a 3/3 takes 3 damage, or is dealt damage by something with deathtouch).
Terror and Wrath of God don't do anything to it. An indestructible creature isn't regenerating from destruction, it just isn't destroyed in the first place.
The common ways we remove an indestructible permanent are:

Put it into any other zone:

Exile it. This means Swords to Plowshares works.
Return it to its owner's hand (known as "bouncing" it): Drag Under, Peel from Reality, and others.
Put it back into its owner's library (known as "tucking" it): Condemn, Chronostutter, and others.

Make its controller sacrifice it.
If it's a creature, reduce its toughness below 0, such as with Tragic Slip.

There are some oddball other methods, such as making it a non-issue (Song of the Dryads) or unable to participate meaningfully (Claustrophobia, Arrest), or making it lose its abilities (Snakeform, Gift of Tusks), or just lose indestructible specifically.
Comment: There's also the option of using something like Claustraphobia or Arrest (similar to the aforementioned Song of the Dryads): you're not removing it, per se, but you're making it unusable.
Comment: @JohnDoe Thanks for bringing that up, I'd forgotten about that category. :)
Comment: you may want to add that the old keyword bury also means destroy.
Comment: @NeilMeyer It also sometimes meant sacrifice, so it's a bit messier than that. I'd rather not go there & just stick with recent rules concepts; all the cards here have errata anyway.
Comment: You can also gain control of it ;)

To kill or remove an Indestructible


How can I have the HOME directory for one user on an external drive?

Question: I want to have the HOME directory of one user on an external drive and the HOME directories of all other users in the usual place.
Answer: As the user, or as root, you can use "Users & Groups" settings dialog (search for it using the dash) to accomplish this:
Users & Groups --> Select the user --> Properties --> Advanced --> Home Directory

Note that you must move/copy the data to the external drive manually first, and then use the settings dialog to point it there.
You can also achieve this using usermod on the command line (as root or the user):
usermod --home /path/to/external/drive --move-home USERNAME

where USERNAME is the name of the user whose folder you want to move. Note that --move-home moves the data of the folder for you, so unlike the method using the settings dialog, you will not have to do this yourself.
Comment: @AlbertoSalviaNovella /path/to/external/drive is the mountpoint that your external drive is accessible on. If you mounted the drive manually, then this path is just the mountpoint you specified. You can take a look at the output of lsblk if you don't remember. If the drive was mounted automatically, you may want to mount it manually and permanently (esp. if it is going to contain a home folder). Have a look at https://help.ubuntu.com/community/InstallingANewHardDrive
Comment: Please, could you give me an example of "/path/to/external/drive"?
Comment: The real problem I'm having is with knowing which path is this!


VMware Printing vs Hyper-V Printing

Question: In VMware once you connect to your virtual machine, you can access the printers from your host machine. This is a very nice feature, you don't have to setup the printer for your virtual machine. I was wondering can I do the same thing in hyper-v? I have a hyper-v virtual machine setup, but it doesn't show the host printers on the virtual machine.
Comment: Its possible if they are visible to the network and/or you share the printers to the network.
Comment: @Ramhound they are visible to the network. I just don't want to have to install each local printer driver for each and every user.
Answer: The official Microsoft method
You can do this with Hyper-V with "Enhanced session mode"
https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/learn-more/use-local-resources-on-hyper-v-virtual-machine-with-vmconnect
The quick and dirty method:
You could connect to the Hyper-V guest VM via Remote desktop,enabling  the "Remote Resource" Local device printers.  This would forward your print jobs to your Hyper-V host.
Answer: If you have a virtual machine setup you can modify the base image to include the printers and printer drivers, on deploy they will all be setup.
Another option would be to manage the machines with puppet, this would avoid having to modify the image every single time the configuration changes. It's then possible to update the machines dynamically.
Finally it's also possible to control printers with Group Policies, as shown here: How to use Group Policy settings to control printers in Active Directory
Comment: What is puppet, can you be a little more descriptive?
Comment: The community edition is free, the enterprise edition can be used with up to 5 machines. The difference is a fancy user interface.
Comment: My apologies, I've added the link to the answer. _Puppet helps system administrators automate every phase of their IT infrastructure's lifecycle._ Which means that you can control your infrastructure from a central platform.
Comment: Puppet looks really good, however I am looking for a free way to solve my issue.
Comment: @DaniëlW.Crompton, Nicer GUI... That's all?
Comment: Basically! http://puppetlabs.com/puppet/enterprise-and-open-source
Comment: Puppet is a tool for automation. They can't create a printer manually, let alone with complex automation overhead.

VMware Printing vs Hyper-V Printing


$C(n,p)$: even or odd?

Question: Can we determine if a binomial coefficient $C(n,p)$ is even or odd, without calculating its value?
($p\lt n$, $p$ and $n$ are positive integers)
Comment: http://en.wikipedia.org/wiki/Lucas'_theorem
Comment: Know someone say who is the author of the work contained in the file below?
http://www.cs.columbia.edu/~cs4205/files/CM4.pdf
Comment: @PauloArgolo Jonathan L. Gross
Answer: There is a beautiful result of Kummer that says that if $q$ is a prime, then the largest power of $q$ that divides $\binom{m+n}{n}$, $m$ and $n$ nonnegative, is the number of carries when $m$ and $n$ are added in base $q$.
As a corollary, we get the Theorem of Lucas mentioned by Michael Lugo: we get a carry in the addition if and only if there is a $k$ such that the $k$th digit of $m+n$ in base $q$ is smaller than the $k$th digit in the base $q$ expansion of $n$, so $\binom{m+n}{n}$ is divisible by $q$ if and only if there is a $k$ such that the $k$th digit of the base $q$ expansion of $m+n$ is smaller than the $k$th digit of the base $q$ expansion of $n$.
Thus, to determine if $\binom{n}{p}$ is odd, you just need to know whether there is at least one carry when adding $p$ and $n-p$ in base $2$; you get a carry exactly when the $k$th binary digit of both $n-p$ and $p$ is $1$.
So just write $p$ and $n-p$ in binary, one digit at a time (from least significant to most significant digit), until you get that both are $1$; or write $p$ and $n$ one binary digit at a time, until you get a $1$ in $p$ and a $0$ in $n$. If this happens, $\binom{n}{p}$ is even; otherwise, it is odd.
Andrew Granville's paper Arithmetic properties of binomial coefficients is chock full of interesting stuff about binomial coefficients and their divisibility. The proof of Kummer's Theorem can be found there. There are also other formats available.
Comment: Nice! In C-style languages, then, it's just:  if (p & (n-p))
Comment: in C-style languages, 'if (a & b)' evaluates to 'true' whenever a and b have at least one bit in common.
Comment: @TonyK Can't we just do `if(p & n)`? As $\binom{n}{p} = \binom{n}{n - p}$
Comment: @TonyK: I don't think that's quite right; the bit-wise comparison would only give true if *all* bits are 1 in both, wouldn't it? You would need to do a disjunction of all the individual bit-comparisons. I recall you can easily extract the last bit, and shuffle to the right, so a simple loop-with-escape will do it.
Comment: @RezwanArefin That's wrong. Even if you use that formula (`C(n,p) = C(n,n-p)`) and replace `p` by `n-p`, then you will get `if((n-p)&(n-(n-p)))` that is just same as what TonyK told. In your suggestion you forgot to replace the first `p` in the expression.
Answer: Yes.
We only need to know how many powers of two appear in the prime factorization of C(n,p). The number of powers of two that appear in the prime factorization of $n!$ is $\lfloor n/2 \rfloor + \lfloor n/4 \rfloor + \lfloor n/8 \rfloor + \cdots$ -- count all the multiples of two, of four, of eight, and so on. This turns out to be $n$ minus the number of ones in the binary expansion of $n$.
It turns out that this reduces to the following: C(n,p) is odd if and only if every bit of the binary expansion of $p$ is less than or equal to the corresponding bit of the binary expansion of $n$. This is due to Lucas.
Answer: I already commented with one Wikipedia link above, but I just want to add that if you run the Pascal's triangle recurrence $\bmod 2$ what you get is a sequence of approximations to the Sierpinski triangle.  So the result that comes out of Lucas' theorem is an explicit nonrecursive algorithm for plotting the Sierpinski triangle.
I also want to take this opportunity to mention a paper which discusses generalizations of this problem, and which is both quite entertaining to read and perhaps has one of the strangest titles of any math paper: Granville's Zaphod Beeblebrox's Brain and the Fifth-Ninth Row of Pascal's Triangle.
Answer: Motivated by a duplicated question that has been asked today, I'd like to offer an alternative approach to the problem.
Let $C_n^r$ be the set of subsets of $\{1,\ldots,n\}$ that have cardinal $r$. Define the function $\sigma:C_n^r\to C_n^r$ given by
$$k\in\sigma(A)\Leftrightarrow n-k\in A$$
Let $S_n^r$ be the set of the fixed points of $\sigma$ and $T_n^r=C_n^r-S_n^r$. It is clear that $f\circ f=id$. Thus, $|T_n^r|$ is even and $|C_n^r|$ and $|S_n^r|$ have the same parity.
Let's study the parity of $|S_n^r|$. Represent each element of $A\in S_n^r$ with a binary word of length $n$ whose $k$th digit is $1$ if $k\in A$ and $0$ otherwise. So, the elements of $S_n^r$ are the symmetric words. For each of these symmetric words:

If $n$ is odd, there is a central digit. If $r$ is odd it must be $1$, otherwise $0$. Any case, the word is determined by the $\lfloor n/2\rfloor$ first digits and $\lfloor r/2\rfloor$ of these digits are $1$'s. Therefore,
$$|S_n^r|=\binom{\lfloor n/2\rfloor}{\lfloor r/2\rfloor}$$
If $n$ is even, $r$ must be even and there must be $r/2$ of $1$'s each side. Then

$$|S_n^r|=\left\{
\begin{array}{cl}
\binom{\lfloor n/2\rfloor}{\lfloor r/2\rfloor}&\text{ if $r$ is even}\\
0&\text{ otherwise}
\end{array}
\right.$$
Thus, we have a method that allows to obtain the parity of $\binom nr$ in at most $\log_2 r$ steps.
Example:
$$\binom{1000}{376}\equiv\binom{500}{188}\equiv\binom{250}{94}\equiv\binom{125}{47}\equiv\binom{62}{23}\equiv 0\pmod 2$$
Answer: I'm surprised that noone mentioned this.
Here is a plot of the parity of ${n\choose p}$ for $n,p\le256$. Black is odd.

You get a pattern that is exactly the Sierpiński triangle. Analyzing this pattern leads naturally to a way to compute directly the parity of ${n\choose p}$.
Answer: If $n$ is even and $k$ is odd, then $\binom{n}{k}$ is always even, without any additional calculation or condition, see my proof at the and of this article.

$C(n,p)$: even or odd?


Where can I find open swaption implied volatility data?

Question: Anyone have a good place to find interest rate swaption implied volatility data? Does Bloomberg's python API allow access?
Answer: CME publishes its volatility surface daily on their FTP: CME Vol Surface.
Unfortunately I know of no open APIs that would get you historical data. I'd recommend looking at Barclays Live or Morgan Markets if you don't have access to Bloomberg (volatilty data quality is higher on these dealer sites anyways).
Answer: Bloomberg's VCUB screen provides swaption normalized vol for options with maturities from 1M - 25Yr for underlying swaps ranging from 1Yr - 30Yr for a large number of currencies.  It also allows you to change the tenor of the Index and the strikes.  You can export the data and tickers to excel.
Answer: I am using FinPricing data service API for both swaption implied volatility surfaces and cap implied volatility surfaces. It supports both C# and Java. They use SABR model for calibration and generate so fine-granular data grids that users can use linear interpolation directly without arbitrage. Data are updated every day.
Answer: The BBerg NSV screens are a good place to start.  They present atmf implied vols for a variety of developed markets in a cube.  Each element of the cube has ticker.  These tickers move throughout the day in response to trading activity.  The tickers should all be available via the BBerg data products which has an assortment of API's depending on what flavor of code you are using on your end.


How To Convert Imported Identical Meshes to Instances (Duplicate Linked)?

Question: I was wondering if there is a way (or python script) to convert multiple identical meshes into instances? - where all other identical meshes are referring (instanced) to the first identical mesh e.g., BALUSTER.001.
The file was imported from ArchiCAD via FBX
Answer: As long as the origins of the various objects are in correct relation to each object, there is a simple way to do this. Select all objects that are supposed to share the same mesh data, then - in the 3D View - hit Ctrl + L to open the link menu. From there, choose Object Data:

This will re-use the mesh data from the last selected object on all other instances. You can tell that they are instances in the mesh data tab of the outliner. The user count (number next to the data name) should have appeared and increased to reflect the number of meshes that re-use the data:
Comment: Thanks. This saves me a lot of time.
Comment: I now also realize that a python script would save me "even more" time. Since the first identical mesh has a "- 001" suffix and the identical copies have "-001.001, -001.002, -001.003...suffix sequence.

Any pointers on how to achieve this with a python script that checks the whole scene and links object data to each "-001" in a hierarchy?
Comment: @SimonGaitara I have provided a second answer showing how to do this with Python. I do take a few assumptions and shortcuts, so be careful to save your imported scene before running this, and carefully check the result afterwards
Answer: An alternative answer to the same question using Python works as follows: I assume that the objects coming in are consistently named, and the restrictions of origin placement are the same as with the other answer I gave. With consistent naming I mean this:
my_obj_01 is supposed to share the data with my_obj_01.001, ..., my_obj_01.015, ...
my_obj_01 is NOT supposed to share the data with my_obj_02

If this is the case, then the following script will do what you request in one shot for the whole selection. So make sure to select the items you want to operate on first. If that's the whole scene, then so be it:
import bpy
import os

# purpose of this script is to link object data of objects by name
# the pattern used is that if an object name has duplicates following
# Blender's .001, .002, .003 syntax, the mesh data will be linked
# between them

# consider only mesh objects
objs = sorted([x for x in bpy.context.selected_editable_objects if x.type == 'MESH'],
            key = lambda x: x.name)

# get a list of the names of the objects above, stripped from any .001, .002 etc
# this will create duplicate name entries enabling us to find the elements we want to link
obj_names_stripped = [os.path.splitext(x.name)[0] for x in objs]

# now iterate over the name list.
# Getting an enumerator here too to be able to index the object later on
for i, obj_name in enumerate(obj_names_stripped):

    # check for i=0 to skip the very first item
    if i != 0:
        # check if the current item has the same name when stripped
        # than the previous item
        if obj_name == obj_names_stripped[i-1]:
            # link the object datas of obj[i-1] and obj[i]
            objs[i].data = objs[i-1].data

A few notes

I am abusing the os module here to strip the .001, .002 etc that Blender adds when importing. However, be warned: I currently do NOT check if you have an object called my_obj.test. My script then would force such an object to share its mesh data with my_obj.other_test, as all I do is strip anything behind a dot.
I am using the trick to sort the list of objects you have selected using the sorted(list, key=function) method that Python provides. By doing so I only need to sequentially iterate over the whole object list once, and compare an item with the one before it. If their names are identical, I link the latter item to the one before, effectively daisy-chaining the mesh data of the first object found through to all copies
I use Pythons enumerate function to provide me a tuple of index and object from the name list, so I can access the mesh object from another list that has the same sorting as the name list


What causes a cross shaped diffraction pattern with two sets of double slits?

Question: I am a retired computer programmer very interested in physics and in particular wanting to find out about Young's double slit experiment at home. I have used a small pen laser and shone the light through double slits formed from very fine wire and black masking tape. This gives the classical bright central dot and a series of bands stretching out on either side. However, if I incorporate a second double slit between the first and the screen and this one's orientation is at right angles to the first I observe a cross-shaped pattern with dark bars running vertically and horizontally throughout it. This is particularly pronounced in the bright spot at the centre. Both sets of slits are longer parallel to the slits than across, but the cross pattern still seems to persist when the second one has this reduced so that both vertical and horizontal lengths are the same. My question is what is causing the vertical and horizontal banding? I thought that a second slit would simply form a new fainter pattern which was entirely independent of the first one.
Answer: I'm not exactly sure what you saw, but for 2 orthogonal double slits, a pattern like the following is expected:
(laser wavelength 600nm, diameter 3mm, slits distance 0.5mm, slit width 0.1mm, distance of the two double slits 5mm, image at 50cm)
The single double slit has already an inner structure (see the upper left image). If you add another double slit, it will add the same structure in the other direction, and you are right, it is basically independent from the first direction. That combination will give you a cross pattern.
With a commercial double slit, you can usually see (or at least guess) the darker regions in the first maximum with the naked eye (the axis here are in mm), while the cross pattern is actually easier to spot. Since you built your own double slits, your image might not be clear enough to see the inner structure in the first, just the second image.
Comment: Thanks for your answer. What I saw was like your bottom image (vertical bands with additional horizontal bars across) but there was also a large scale vertical component  also with vertical and horizontal banding.


How Can I Format My Internal Storage?

Question: I Have A UBISLATE 7C+ (EDGE). One Day, I Formatted Its Internal Storage With My PC. But I Saw None Of The Files Were Deleted From The Internal Storage. From That Day Onwards, Its Internal Storage's Data Is Not Getting Erased And I Am Also Unable To Save Any File Into It. PLEASE, Suggest Me Some Ways To Make It Normal! Is There Any Way ?
Answer: If you are rooted and have a custom recovery, then you can format data from there

How Can I Format My Internal Storage?


PC Power Supply Amperage

Question: I have a 450 watt power supply that I am trying to use as a DC power supply to learn about electronics.  I watched some videos that show grouping the red, yellow, black wires so I did that but when I test the output, the group of red wires shows 5 volts but only about .2 amps, the group of yellow wires shows 12.18 volts but only about .5 amps.  The power supply shows DC output of 22 amps for the yellow and 25 amps for the red.   What am I doing wrong?  Thanks
Comment: how are you measuring the current?
Comment: Measuring the current by shorting out the power supply through your meter will tend to damage the meter and/or power supply.  If your meter still works, consider yourself lucky and don't do that again.
Comment: May I suggest _not_ using a 450W power supply to learn about electronics. It's a question of safety in case something goes wrong. You can do a lot with just 1 amp of current at a low voltage and you'll be dealing with a lot less power.
Comment: I put the red wire from my meter on the group of yellow from the power supply and the black from the meter to the group of black from the power supply with DC amps selected on my tester.  it shows about .5 amp.  I also connected the power supply to a car amp and the meter shows the same even when connected to the car amp.  the car amp will turn on and work but with very low sound coming from the speaker
Comment: Thanks.  I will remember that.
Comment: the videos made it look easy but I guess its not.   thanks
Answer: The way you measured current did short out the power supply via the meter, so the meter fuse should have blown.
Voltage is measured by putting meter in parallel with output, current is measured by putting meter in series with output (and load, so without load it is in series with a short circuit).
If the meter has no fuse it is dangerous, I don't even dare to think what could have happened if you had shorted out a 12V car battery (melting wires?) but fortunately the PC power supply has overcurren protection, so it detected the short and shut down.
Also note that PC power supplies are not that great for general purpose power supplies. If you only load the 12V output, and have no load on other outputs, they may have trouble keeping the output voltage at 12V or they might shut down easily under variable load, especially if the load suddenly is disconnected. So don't expect it to work great with your car amp.
Comment: This may be a dumb question but here it is. When an amp meter is added in series with a load to complete a circuit, isn't the meter shorting out the power source? What is the difference in completing a circuit and shorting it out.  I understand a little about parallel and series circuits but can you explain more when you said " Voltage is measured by putting meter in parallel with output,  current is measured by putting meter in series with output (and load, so without load it is in series with a short circuit).   Thanks
Comment: No, when measuring current, the meter leads can be thought as a piece of wire that completes the circuit from supply to load so you can measure current that flows. The meter only short circuits the supply when there is no load, and there is no load when you stick current measurement leads directly into power supply.

PC Power Supply Amperage


how to sign into google mail in one step

Question: I only have gmail, but last week my mail opened with an extra step, by asking me to choose an account. I clicked on the gmail with my name on it, and then the password request came up. How do I eliminate this new step and go back to just the password request window? I only have one gmail account, so this is a mystery. Thanks. I'm afraid if I click on anything I won't be able to get into my mail.  Below shows the  new choices that I pasted in:
Choose an account
(NAME)@gmail.com       Signed out
Use another account
Remove an account
Answer: Just follow the below images:
Step 1
Click the "Remove an account" button.

Step 2
First press the minus sign and then the "Done" link


Google maps: "conversing" with forms

Question: I have a form that is meant to interact with a Google map.  At this point, I have one field for that will autocomplete with a business (using Google Places autocomplete).  What I need it to do now, though, is take that information in the autocomplete and re-draw the map to show the neighborhoods in that area (pointing out the 3 closest neighborhoods).
My question is, then, how do I take the information from the autocompleted field and "reuse" it to re-draw the map?  I've tried various ways but my second map doesn't ever render - let alone give me the 3 closest neighborhoods to an address form the autocompleted field!
Thanks in advance.  I've been searching high and low for this solution for weeks & need help getting it figured out.
Answer: Use the place_changed event. You can then use the getPlace() method to get a PlaceRestul object which will have an appropriate center point and possibly viewport.

Google maps: "conversing" with forms


Get print from hp printer using iOS

Question: I am trying to get a print of a pdf file from my iPad app but i am unable to find any thing around. I have check apple air printer sample code but it is not finding my HP printer 2100. my printer is in LAN. can anyone help me? I am stuck badly so please help me
Comment: can u find the printer and get a print with other apps such as safari?
Answer: The only solution for printing in iOS is using the AirPrint API, and having a printer that supports it.
If this is for your own use, you can look at running a PC-based AirPrint server, e.g.: https://stackoverflow.com/questions/12821703/how-to-use-linux-to-set-up-free-airprint-server-for-any-printer-from-ios-devices (closed question, but some info in there)
Comment: I've successfully printed on a receipt printer from an iPad using NSURLConnection/WLAN. The printer is attached to a unix desktop via serial line - so no AirPrint API.
Comment: Well yes, but that is a bit of a work-around. I mean that there is no way to print to a regular networked printer, or a Windows shared printer, the same way that you can from a desktop OS.

Get print from hp printer using iOS


2 different alert sounds playing at once in Ubuntu 17.10

Question: I used the default alert sound in Ubuntu 17.04. When I upgraded to 17.10, the same sound played. When trying different sound settings, I clicked on a sound and now I hear that sound + the old one.
If I set "Alarm volume" to OFF, there's obviously no sound.
If I set it to ON, I hear 2 sounds.
Comment: I don't remember having the problem in 17.10, but I clearly have it with 18.04.
Comment: This problem is addressed in https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1827842.
Answer: I'm not sure how reproducible this is but I was able to disable the default sound in 17.10.  Here's what I did:

Change the sound theme to gnome using the dconf-editor (under org.gnome.desktop.sound).
Under Sound Effects in the Sound Settings (shown in your picture), disable alerts.

For good measure, I also logged out and logged back in between steps.
Now, I still get the alerts (at least, I do when I test it at the terminal), but I don't get two alert sounds.  It is also worth noting that I upgraded from Ubuntu GNOME, so I may have different sound themes available.
If you want a different alert sound than the GNOME default, you will probably need to make a new theme.  My themes were in /usr/share/sounds (each folder contains a theme).  You should be able to copy a theme, change the name in the new index.theme, and then add the alert sound you like (as described in this AskUbuntu post).
Comment: What I did is simply set default value to ON under `org.gnome.desktop.sound` (but left  "Alert" on) and now I only hear the default alert sound.  Thanks!
Answer: @desilvai's answer didn't work for me, but it helped me find a workaround.
In dconf-editor, I changed org/gnome/desktop/sound/event-sounds to OFF.
Now I only hear one sound. The drawback is that I can not customize which sounds it plays, but at least it is less ugly than having two sounds...


PorterDuff.Mode.MULTIPLY - the sence of this color transformation in Android

Question: Under default Android theme I have three custom colored buttons by means of
button.getBackground().setColorFilter(customColor, PorterDuff.Mode.MULTIPLY);

buttons http://img94.imageshack.us/img94/1723/themew.jpg
When I switch to Theme.Holo by means of /values-v11/styles.xml


How do I show that if $m^2 + n^2 + p^2 \equiv 0 \pmod 5$ then at least one of them is divisible by $5$?

Question: How do I show that if $$m^2 + n^2 + p^2 \equiv 0 \pmod 5$$ then at least one of $\{m,n,p\}$ is divisible by 5?
Comment: At least one of *what* is divisible by $5$?
Answer: This is quite standard. The only squares mod 5 are 0, 1 and 4. Then if you have that the sum of tree squares that gives 0, at least one of them has to be zero (just check all posibilities $1+1+1=3\neq 0,1+1+4=1\neq 0$ and so on).
Finally the only number with square 0, is zero
Answer: If $k \equiv 0,\pm 1, \pm 2 \pmod 5$ then $k^2 \equiv 0,1,-1\pmod 5$.
So none of $m,n$ or $p$ are divisible by $5$ then none of $m,n,p \equiv 0 \pmod 5$ and none of $m^2, n^2, p^2 \equiv 0 \pmod  5$.  So all of $m^2, n^2, p^2 \equiv \pm 1 \pmod 5$.
So $m^2 + n^2 + p^2 \equiv \pm 1 + \pm 1 + \pm 1$. The only possible values for those is $-3,-1,1$ or $3$.  So $m^2 + n^2 +p^2$ being divisible by $5$ is impossible unless one of $m,n$ or $p$ is divisible by $5$.


Annoying "unzoom" when browsing text

Question: The following happens in various applications such as more than one type of web browser and Adobe's PDF reader. I'm scrolling through text at a comfortable zoom level, and then suddenly, I touch the screen the wrong way, and it zooms way out.  How can we prevent this UI behavior?
Answer: This feature is known as double-tap zoom. In the stock browser, it can't be disabled, but it can be adjusted in Settings -> Accessibility -> Zoom on double-tap. According to this answer , Dolphin Browser HD supports disabling it.
Comment: I can't find this menu item on my device.  I'm looking to disable UN zoom, not zoom.  As far as I can tell, I'm not double tapping anything when this happens. I'm not aware of any kind of double tapping on the phone. Everything everywhere, like launching a program, works by single tap. An alternate action is indicated by a long press. Double tap is a desktop/mouse thing.
Comment: There is no such thing like "UN zoom". You either "zoom in" or you "zoom out". And double-tap is something very practicable on every touch sensitive device, if configured correctly (i.e. the time frame between the taps must be set up correctly: make it too short, and it never works -- make it too long, and it fires too often).
Comment: I experimented with this double tap and see that it does zoom in and out. But I do not double tap when it zooms out by accident. It seems to be something akin to switch bounce. I would ideally like to disable double tap entirely, or configure it so that it is more difficult to execute. I don't think that double tap to zoom in and out is a useful feature, because it zooms all the way in or out.
Comment: Sometimes it can happen if you're holding the phone and touching part of the screen without knowing it; you then drag (perhaps with a finger on the other hand); the combination is a zoom in or out.

Annoying "unzoom" when browsing text


What happens to files restoring from case-sensitive to case-insensitive?

Question: If I have IMPORTANT-RESOURCE.jpg and important-resource.jpg on a case-sensitive file system, I do a Time Machine backup, then wipe boot volume, and create a case-insensitive volume, then restore from Time Machine, what will happen to the duplicate file?
Comment: If you use `cp` to copy both the first will define what the name looks like, the second the data is.   It is impossible to have both on case-sensitive.  I don't know what Time Machine would do - warn you it is impossible hopefully - but  both would remain on the backup.  Are you actually planning to do such a thing?  See [this question](https://apple.stackexchange.com/a/111774/115093) too.
Answer: Time Machine by defaults formats the backup disk as case-sensitive, even when the original source disk is case-insensitive. This means that in any case, the file names are preserved when backing up.
If you when restore files from a backup made from a case-sensitive file system to a disk with a case-insensitive file system, Time Machine detects conflicts. The first of the two (or more) conflicting files will be copied over as normal. For the rest of the conflicted files, you'll get a popup stating that the destination disk already contains a file of that name. The popup allows you to either keep only the first file, keep only the second file - or keep both, where it automatically renames the second file to include "copy" in the name.
In general I would say that you should never do this with a complete system backup. Always restore a case-sensitive backup to a case-sensitive file system. If you have a limited number of files and expect a low number of conflicts, it could be done ofcourse - but it probably more work than justified.
In fact by default, if you wipe the volume completely and let Time Machine do a full restore, it will create a file system with the same case-sensitivity setting as the original source volume. I.e. if the backup was created from a case-sensitive disk, it will format the volume as case-sensitive during restore.
You can change by altering the com.apple.backupd.VolumeIsCaseSensitive"extended attribute on the top folder matching the name of your source volume. below your computer name in Backups.backupdb.
Comment: It is not a file. it is an extended attribute on the folder that is named the same as your volume (for example Macintosh HD or whatever you named it).
Comment: I do not see `com.apple.backupd.VolumeIsCaseSensitive` in the directory of my TIme Machine Volume. Could you clarify that part please?


SOAP faults or results object?

Question: I was having a discussion about this with a co-worker and we couldn't come to an agreement, so I wanted to get your thoughts.  I have my own opinions on this, but I won't spoil it for you.
When should I be returning a SOAP fault and when should I be returning a result object that has error information?  Assume this is for a generic web service that can be consumed by various systems (.NET, Java, whatever).  The result object would have an isError flag, an errorType (similar to specific exception type), and a message.
Some points to consider:

Is a data validation error a fault?
Should there be a combination of faults (for very exceptional cases) and the results object (for "expected" errors)?
How would you group SOAP faults (critical [null reference] vs validation [zip code incorrect])?
Fail-fast vs having to remember to check for error
Best practices, patterns, standards, etc.

Links to articles are valid.  Even though it sounds like I want your opinion, please stick to facts (x is better because of y and z...)
Comment: Six years later I've learned something new with SOAP 1.2: https://www.w3.org/TR/soap12-part1/#faultcodes  A fault's `Code` element can have value `Sender` which is described as `The message... did not contain the appropriate information in order to succeed. For example, the message could lack... payment information. It is generally an indication that the message is not to be resent without change.`  That seems like data validation to me and thus an indication that faults should be used.
Answer: Most SOAP clients will convert faults into a runtime exception (if that is something the client language supports). With that in mind, I think you could rephrase the question as "When do I want to throw an exception instead of returning an error value"? I'm sure you can find lots of opinions about that API design in general and that topic in particular.
That said, returning an error is usually not helpful to the client:

The client needs to manually enumerate and handle your error codes vs. allowing the stub code to generate and throw an exception of the appropriate type. Using error codes  prevents the client from using object-oriented techniques like handling exceptions by superclass.
If you don't make your error codes part of the WSDL; the client will have no documentation on what they are or when they occur. Typed faults are part of the WSDL and therefore (to some limited extent) self-documenting.
Fault messages can contain fault-specific context that the client can make use of for error reporting and recovery. For example, throwing an input validation fault containing the actual invalid input element and a reason. If you return a result with an error code and an opaque string, the client has little choice but to pass your error message on to the user, which breaks internationalization, UI consistency, etc.

To answer your specific questions:

A validation error is a fault. Imagine if you invoke the web service from an AJAX client with limited error handling ability; you want the service to return a 5xx HTTP code, not a 400 success code with some unexpected response.
No. APIs should provide consistent error reporting interfaces. WSDL design is API design. Forcing the client to implement two distinct error handlers does not make the client's life easier.
Fault design should mirror your request/response model and display information appropriate to the abstraction of the service. Don't design a NullReference fault; design a XYZServiceRuntimeFault. If clients frequently provide invalid requests, design a InvalidRequestFault, with appropriate subclasses so that clients can quickly figure out where the invalid data is.
Comment: Good answer. Would just like to point out 400 code is a bad request response and 200 is a success response.
Comment: @yogibear If the web server throws the error it will be 4xx, if the application throws the error it will be 5xx, and success is 200.
Comment: I'm having a hard time deciding who to give the answer to...  @gibbss was first, the references by @Richard were good.  I think you brought up a good point with "forcing the client to implement two distinct error handlers".  Just because there is a results object that may have error information doesn't mean SOAP faults will never occur.  I'll mull this over a bit more...
Answer: A results object should only contain results. If your result object is providing a list of errors that have occurred on another system then that is an example of when you can have and "isError" flag; otherwise you can't because a result is either valid or not.
You should always be using a SOAPFault when an error occurs. Validation is an error, and it's the devils own trap to think of validation as being less severe than an inability to open a database. Both cases have the same impact - the operation cannot be completed as requested.
So you should use result objects for results and SOAP Faults for anything that prevents a valid result object; including but not limited to errors, validation failures, warnings, bus faults, etc..
In the days before exceptions there was no choice and as a result many APIs became inconsistent and most APIs differed on how to return an error. It was (and still is) horrible, confusing and often slows down development because you have to lookup how each API entry returns an error, and often how to decode or find out more about the error.

To handle validation with SOAPFaults / Exceptions is more logical when you think about it, and once you've thought about it is usually easier. You do need to design the validation fault class so that it contains sufficient information to identify the offending elements in a manner not necessarily requiring the original request. This way you can start to handle validation errors more generically.
If the results object contains errors they can only be within the domain of the results; for example Product out of stock because someone in the wharehouse can't count is within the domain of inventory control.
It is not wise to make the distinction between a critical error and a validation error, this to my mind isn't a valid comparison because any assignation of severity level is very subjective. For example in a system providing information about chemicals to a firefighter, critical probably means that the truck on fire is carrying UN 1298 & UN 1436 and not a null reference when attempting to load the warning graphic.
Design the faults in to allow them to be identified concisely and handled accordingly. Ensure that they convey sufficient information. Abritrary categorisation is something that is unncessary when you've got sufficient information because the Fault will allow itself to be indentified.
SOAPFaults turned into Exceptions are the surest way of having fail-fast.
Best practices, references etc.

Managing Exceptions in a SOA world: Ramesh Ranganathan
When Exceptions Are the Rule : Achieving reliable and traceable service-oriented architectures
Best practices on SOAP Faults
Use SOAP Faults to deliver the appropriate level of detail to the developer at development time, and to the customer while the Web service is in production.
Web services use SOAP faults to report fault cases back to clients. The faults can be generated from the SOAP framework in a case of invalid SOAP messages, invalid security tokens or they can be generated from the service business logic itself
If you send a message that was not successful for some reason, you may get back a response containing a SOAP fault element, which gives you status information, error information, or both. There can be only one SOAP fault element in a message, and it must be an entry in the SOAP body. Furthermore, if there is a SOAP fault element in the SOAP body, there can be no other elements in the SOAP body. This means that when you add a SOAP fault element, you have effectively completed the construction of the SOAP body.
SOAP fault messages are the mechanism by which SOAP applications report errors "upstream," to nodes earlier in the message path. It's the mission of this section to provide a full and detailed explanation of SOAP faults so that you can handle them appropriately in your own Web services.
Comment: Exceptions may, and should be identified, by type or class, e.g. ValidationFailure, SecurityFailure,RelatedKeyFailure. However these identities should not be grouped (or placed into categories) as it is this that is implying meaning when the handlers should decide on a per-instance basis. Whilst you may want to display validation failure if you are handling all exceptions then it is upto the handlers to differentiate between the exceptions based on their type.
Comment: On point #3, I may want to display validation errors (E-mail in invalid) and not any other types of exceptions.  I don't agree completely about not grouping them.  That is, after all, why we have so many Exception classes in .NET (IOException, ArgumentException, etc.).  Of course they are still Exceptions and not handled in a custom way, but they are grouped.
Answer: I think the short answer is use a soap fault, unless you know the client will be equipped to handle an error returned as the result. I was also thinking the analogy between exceptions and error results, as mentioned in the other answers.
There are grey areas that could both be reasonably treated as exceptions and as result errors depending upon the needs of the client. You might then provide a parameter to the service that alters how these types of error is returned. The default is to use a SOAP fault, but if the client sets the parameter to get error results, then it is indicating that it is willing to handle this as part of the result. For me, validation errors are in this grey area. For most clients they should be considered faults, but if the client wants to use the data to markup the UI with validation errors, then returning the validation errors as part of the result may be more useful.
Answer: The rule I follow in service design is:

business level response (even business exceptions) into response objects
technical/integration level faults into Soap Fault

The service consumer can rely that all kind of business response comes in response objects and presents it to service (business) users. The Soap Faults are used only when business response cannot be delivered.
The Soap Faults should trigger a support warning/action via monitoring.

SOAP faults or results object?


A puzzle of words

Question: What is the 3-word phrase I'm looking for?
Answer: I think the phrase is:

 parts of speech.

Each circle ...

 ... represents one major type of word. When the name of one type A is contained in another type B, the circle for A is drawn insode the circle for B. So we have: Verbs inside Adverbs, Adjectives, Conjunctions or connectives, Nouns inside Pronouns, Determiners (articles, prossessives, etc.), Interjections and Prepositions.

 The containment is strictly by strings of letters, not semantic: "verb" is a substring of "adverb", but verbs are not a subclass or a subtype of adverbs.

The title ...

 ... speaks for itself, I think.
Comment: I think you're spot on with the findings but that the 3 words may actually be rot13([cnegf bs fcrrpu](https://en.wikipedia.org/wiki/Part_of_speech))...
Comment: Well done! And yes, as @Stiv points out, that's the phrase I was looking for.
Comment: Oh, yes, that sounds better, familiar even. But the phrase didn't occur to me, so I used a literal translation from German, which usually isn't a good idea. (At least that odd wording served me as search-engine fodder to find out about that pesky "I".)

A puzzle of words


Charging my US iPad in Israel

Question: I brought my iPad charging wire to Israel along with the necessary plug adapter.  I have not been able to charge my iPad. I also tried to charge it off of my wife's MacBook.  No go.  I called the front desk and they said it was a common problem and had me bring my iPad to them for charging.  All of my other electronic devices (SONY camera, Olympus digital dictation device, BlackBerry) are taking the charge as did my wife's MacBook.  Any idea what i need to do differently or wire that I need to buy?
Comment: So they were able to charge it? What did they use?
Comment: I suggest you double-check your brick, that it is a OEM, or at least a good enough knock-off to be dual voltage. I haven't seen 110-only electronics for about 10 years, but you never know. I had no trouble in Israel with a Mac Desktop and several laptops, Apple and otherwise. The Israeli 3-prong pattern is unique. Are you sure your adapter is fitting in well?
Answer: Israel has 220v/50Hz power that's standard throughout most of the world, so if there are problems with using an iPad charger to charge, it would most likely be due to substandard local power and not some problem with your equipment.
Even in high power mode, charging from a MacBook Pro is not a good option to charge an iPad unless it's in AirPlane mode with the screen off or powered down entirely so that all the charge can go to the battery.

Charging my US iPad in Israel


Acquired an old bike with a house purchase; does it have value worthy of restoration?

Question: Just wondering if someone could help me out. I bought a house about 5 years ago and this bike was a feature in the garden. I've tried to research about it but nothing comes up for "copper city". Just really wanted to know if its worth anything and should be restored or is best left as is in the garden.
Comment: Great work with the photos!
Comment: Per the answers below, probably not worth restoring. Depending on the aesthetics of your garden, could be an interesting decorative item. Mount it to a wooden fence or side of garage and let it continue rusting. Or lean it against a hedge/ vine-covered wall/fence and let it slowly disappear into the foliage, which could be cut back periodically to keep it visible enough to be intriguing.
Comment: It's something of a classic.  Might be in the "English racer" category.  Probably dates from 1960 or earlier.  In very poor condition, though.
Answer: I can tell you a little about the saddle and the coaster brake.
It's a Brooks Hammock Saddle.
I found a collection of Brooks Saddle catalogs. The oldest catalog with that saddle type was 1912.

The newest catalog with that type of saddle was 1959

There is a gap in the catalog collection between 1959 and 2008. There was no hammock saddle in the 2008 catalog.
You have a Perry Coaster Brake.
Here is a link to the history of the Perry and Co.
There were different models and there are markings that can help identify the model. Knowing the model might help track down the year.
Here is a link to an article that tells a little about the hub markings.

My best guess on the model and manufacture date for this hub is that it is a B-10, made in 1955. The model "B" is stamped on the inside of the reaction arm, and 10-55 on the other. Some additional support for the 1955 date is the brake cylinder stamped "Perry 4-55." The later model 100 had "B-100" stamped on the outside of the arm, under the two stars. It also had a different brake cylinder design, using a spring running in a channel around two brake shoes as opposed to the v-split with internal spring used in the B-10.  All Perry hubs feature a "xx-yy" stamp on the shell which designates the number of holes and spoke gauge for that shell (in this case 36-13).
Comment: That is an awesome find - thank you.
Answer: I would call that a 70's bike at newest, and it may date to much earlier.
The saddle and its structure look very strange and may be the key to dating it better.  The leather top has perished and rotted, but the sprung wire frame is not your common saddle rails.
The bike would be a lot of work to restore, but not impossible if you had time.  One observation is the cranks appear to be crooked relative to each other, so there may be failed/broken internals.
I see cracks in the mudguards, so there would be welding or brazing required to fix them.
As for value, steel is around 5c/kilogram.  A steel bike is worth around 50c-$1 in scrap value.
The minimum you need will be new tyres/tubes, saddle, front brake, chain, and lots of lubricants.  Don't expect to break even if you're doing this with the intention of reselling it.
And do turn the handlebars back around where they go - as pictured they're likely to core-sample the rider.
Comment: Honestly that's one of the few cases which looks hopeless and beyond repair. So much rust, and definitely more than just cosmetic damage in several places. Many of the threads are probably rusted shut too.
Comment: re: cranks -- another possibility is that the cotter pins were installed incorrectly. I did that once!
Comment: Thanks for your help guys, I really don't know anything about bikes. I thought it might be worth something to someone but if it's only worth scrap it can go back in the garden.
Comment: @Jake it DOES have value! Not as a bicycle(never ever try to ride it!!); rather as a garden ornament. It is beautiful!
Comment: There was a reason it was left behind...
Answer: The bike as you see it there isn't really valuable as it is but you should bear in mind that it would have been a quality item when new and is fitted with some expensive components from well respected manufacturers (Brooks, Brampton; both well regarded).
The corrosion does not look particularly terminal to me. You obviously live in a dry environment. If that had been in a garden in Wales, there would be a pile of red dust after 5 years, not to mention the extra 50 years of life. You may find that a light restoration, to get it functional, plus some leatherworking to re-create the saddle, would make a nice bike for short rides or to run errands. It will certainly be quite cool and eye catching. This type of bike, when it looks smart, is often wated by the sort of retro-industrial stylist putting the finishing touches into a cafe or similar and that's where the monetary value is, if you can realise it.


Who designed the X-Jets, and where were they built?

Question: The X-Men's first Blackbird X-Jet was a modified, scaled-up version of the Lockheed SR-71 "Blackbird" spy plane, so it couldn't be a refurbished "war surplus" aircraft. It had to be specificaly manufactured. Who designed the X-Men's original Blackbird, and who designed the current X-Jet, and where were they built??  ?
Answer: The Blackbird/X-Jet from X-Men: First Class was designed by Hank McCoy (Beast) while he was working with Division X. Division X was funded by the government and had access to cutting edge technology of the time.
That portion of the film takes place during 1962 - at which point the real SR-71 Blackbird was in development. The Lockheed A-12, however, looks very similar and was already flying that year.
In the early comics, the X-Men traveled via private jet or helicopter. They were more advanced than normal aircraft, but they were not based off of the SR-71. In 1975, their jet was redesigned based off of the SR-71.
According to Marvel Wikia,

Professor Charles Xavier somehow gained at least one working version of the RS-150 Blackbird from S.H.I.E.L.D., after the X-Men's Stratojet had been destroyed by Count Nefaria.

And then

At some time, the Professor upgraded to the SR-71 Blackbird.

Since then, the original blackbird has been upgraded with Shi'ar technology and by Forge.
According to ComicVine,

Needless to say, the [X-Men] have gone through many of these jets with time, and the newer ones have been created and modified by Forge to have even greater capability.
Comment: I added an image of the current X-Jet.
Comment: @MajorStackings OK, I wasn't totally sure if you were asking about the jets in general or just the film version. I edited the answer to go more into the comics origins.
Answer: In the comics the X-men have flown two different base types of Blackbirds.  The first was the RS150 that was designed and built by S.H.I.E.L.D.  The second was built at Skunk Works a subsidiary of Lockheed Aircraft. After the Dark Phoenix saga the Blackbird was upgraded with Shi'ar tech by Forge.
Answer: The article you post strongly suggests that in the first few issues of the series, Xavier simply bought a 'standard' Jet. Later after it was destroyed and rebuilt various technologies went into the plane. It was possibly scaled up then.
As for the one pictured:

In X-Men: First Class the Blackbird (which Hank McCoy/Beast states that he designed) is strongly visually based on the SR-71, though its internal layout is very different. The film is set in 1962, when the real-world SR-71 was still in development, meaning it is most like an A-12 which was first flown in April of that year.


Entries with dates, loop through and make graph for each date

Question: I have 700 entries in a multiarray with a date on each.
I have to sort them into the different dates, so the 700 entries, there may only be only 15 unique dates.
The problem is that i do not know if there is 7 or 28 unique dates.
So how do i loop through all the entries and push them into a date specific array and afterwards foreach dates.
I know how to do it in PHP.
It would look something like this:
<code>$dates = array();
foreach($entry in $entries){
    $date = $entry['date'];
    $dates[$date] = $emtry;
}
foreach($day in $dates){
    foreach($entry in $day){
         echo $entry['title'];
    }
}
</code>
How do you do that in Javascript?
Because it is not possible to put characters as a array key..
Comment: var dates = [ ]; dates[entry] is valid in JS.
Answer: JS version would be something like this:
<code>var dates = [];
for (entry in entries){
    date = entry['date'];
    dates[date] = entry;
}
for (day in dates){
    for (entry in day){
         document.writeln (entry['title']);
    }
}
</code>