Has the MVVM pattern been adopted widely in real world Silverlight projects?

Question: MVVM pattern is a hot word recently and I am planning to learning and refactor my existing project into this pattern. I have no experience and foresight of the potential risk.
 Have you guys really get lots of benefit from the MVVM Pattern in real-world projects?
Is it worth refactoring an existing non-MVVM (mainly using Code-Behind files) into the MVVM pattern?
Comment: @MattyD - Silverlight's not dead - SL5 is coming out this year and it's the platform for WP7.
Answer: I've done 4 silverlight projects and 1 WPF project for customers and all of them were done using the MVVM pattern.  So to answer your question if it's widely adopted... yes.
Is it worth refactoring an old project to make use of the MVVM pattern?  That depends on the project.  Is testability an important factor of the project than without a doubt it is good practice converting the project.  If the project is in the begin phase then I would also recommend to make use of the MVVM pattern as it will encourage you to produce cleaner and less coupled code.  Is the existing project in an advanced stage and are there other patterns involved then it depends on the budget and time of the project whether it's worth converting it.
Just a little side node of myself.  The more I'm making use of MVVM, the more I'm starting to be bothered of the complexity a viewmodel can get and the less I am convinced of whether MVVM is THE way to go in Silverlight / WPF applications.  I find it irritating to have my Commands and data properties in the same place because there is no clean sepperation anymore between data and command. For that I would encourage people to also have a look at the MVVMC pattern that solves these issues.
Comment: but shouldn't the data be in the Model instead of the ViewModel? At least that was my understanding. Else you'd only have View and VieModel
Comment: *edit* I'm not very familiar with this and a quick glance indeed indicates the the VM is violating the SRP. Data is indeed supposed to be in the Model, but the transfer of data to the View is in the VM while at the same time command handling is also in the VM. You happen to have a nice example of using the MVVMC (pff what a name) ?
Comment: Yes the data should be in the model but because of the way databinding works in WPF and Silverlight this would mean polluting the model with INotifyPropertyChanged, IDataErrorInfo or others. /* edit yeah MVVMC... whats in a name :P */. I'll try to put a blog post up next week about MVVMC.
Comment: I have no problem putting `INotifyPropertyChanged` and `IDataErrorInfo` on my Models. I know it isn't the "MVVM-purist" approach, but I find it much quicker and easier to code like that. If this ever becomes a problem, I would probably make my Models into ViewModels of their own, so my properties would still be separated from the Commands and other logic. I'd also rename the original ViewModel something like `ProductPageViewModel` instead of `ProductViewModel`, since `ProductViewModel` would be my Model's ViewModel.
Comment: Yes I see what you mean.  The problem is that the act of using a viewmodel as a wrapper for you model so it can propagate changes to it's binding is a violation of soc.  Is the viewmodel supposed to interact with the model or is it supposed to expose details to the view?  Isn't it best to take the controller out of the viewmodel in this case?
Answer: I've found the article with good explanation when you should use the MVVM pattern:
http://neverindoubtnet.blogspot.com/2011/05/mvvm-backlash.html
According to the article there is only 3 real benefits of MVVM:

design time data
automated view testing
multiple views over the same view
logic

So if your code is clear and satisfactory, your team don't have designers, you don't write unit-tests - there is no point in changing the architecture.
MVVM itself has nothing to do with the code quality, it is not a magic wand. But if you start a new project, it can really help you.
Comment: 2018 and I can't live without ReactiveUI (a MVVM framework). I can't understand how people are still programming in code behind.
Answer: Yes, this pattern is a dream when building WPF and Silverlight applications. I've used it on many projects, including ones that are public facing production apps and I would use it again if I build another WPF/Silverlight app in the future (I'd even use it in Javascript pages via the knockout.js library).
Answer: The single greatest benefit of MVVM is that the complete separation of logic and data from the layout makes it testable. This is often not a concern to stand-along coders, but in the IT industry Test Driven Development (TDD) is now an expected skill.
We also find MVVM "just makes more sense" as code tends to be cleaner and we look at the problems from a broader perspective than the old "just double-click and add yet another handler".
Once you start working on very large projects, I highly recommend also looking at the PRISM framework/guideline as well. It adds yet another level of separation that allows 100's of modules to be developed by separate teams without them tripping over each other all the time.
The only additional thing I will stick my neck out about is: MVVM does not preclude the need for controller classes. We find they make the most sensible place to hang application response logic (not in code-behind, not in the ViewModel and certainly not in the DataModels). Maybe it should be MVCVM? :)


Rename Buddypress Profile Tab

Question: Without using a language file, which file would I go to if I wanted to rename profile tabs? For example, instead of the tab saying "Activity" I want it to say "My Activity". Instead of "Groups"  I would make it say "My Groups" etc. Thanks
Answer: Look at the source, you know that already. :)
I didn't but I bet there is a piece of code looking like this:
_e( 'Activity', 'buddypress' );

… or …
__( 'Activity', 'buddypress' );

Follow the functions, they are wrappers for the function translate() in wp-includes/l10n.php:
/**
 * Retrieves the translation of $text. If there is no translation, or
 * the domain isn't loaded, the original text is returned.
 *
 * @see __() Don't use translate() directly, use __()
 * @since 2.2.0
 * @uses apply_filters() Calls 'gettext' on domain translated text
 *      with the untranslated text as second parameter.
 *
 * @param string $text Text to translate.
 * @param string $domain Domain to retrieve the translated text.
 * @return string Translated text
 */
function translate( $text, $domain = 'default' ) {
    $translations = &get_translations_for_domain( $domain );
    return apply_filters( 'gettext', $translations->translate( $text ), $text, $domain );
}

You see you get a filter: 'gettext' with three arguments (or parameters). Now you can use the filter to change the output.
Add this to your theme's functions.php or to a plugin:
add_filter(
    'gettext', // filter name
    'wpse_57673_change_buddypress_profile_tabs', // name of your custom function
    10, // priority
    3 // number of arguments you want to get
);

Now we need the custom function, that's really simple:
function wpse_57673_change_buddypress_profile_tabs( $translated, $original_text, $domain )
{
    if ( 'buddypress' !== $domain )
    {
        return $translated; // not your text
    }

    // find the text to change
    switch ( $original_text )
    {
        case 'Activity':
            return 'My Activity';

        case 'Groups':
            return 'My Groups';

        default:
            return $translated;
    }
}

Comment: "Look at the source, you know that already. :)" (I felt lazy. I looked in the members template file and couldnt find it and I didn't wanna search anymore) Gosh darnit Toscho, you are brilliant :) + What is this? "wpse_57673"
Comment: @Aliyah - It is a prefix for making the function name *unique*, so there's little chance on earth it will conflict with another function declared somewhere (theme or plugin). . . . . . If there are two functions with the same name in your WordPress, the site will break (`HTTP Error 500 (Internal Server Error)`) due to a `Fatal error:  Cannot redeclare wpse_57673_change_buddypress_profile_tabs() (previously declared in /path/to/first/function/ocurrence.php) in /path/to/second/function.php`. . . . . . It stands for WordPressStackExchange_QuestionIdNumber :)
Comment: Ah! I completely understand now. That explains why Ive had past issues with "cannot redeclare"! Thanx a million Brasofilo!
Answer: I dug into the code a little bit and found what looks like the "right way" to do it:
function wpse_57673_change_bp_profile_tabs() {

    // Rename a primary nav item.
    buddypress()->members->nav->edit_nav(
        array( 'name' => 'My Activity' )
        , 'activity'
    );

    // Rename a secondary nav item.
    buddypress()->members->nav->edit_nav(
        array( 'name' => 'Saved Posts' )
        , 'favorites'
        , 'activity'
    );
}
add_action( 'bp_setup_nav', 'wpse_57673_change_profile_tabs', 20 );

This is better than hooking into 'gettext', because the 'gettext' filter is called very often and so hooking into it can degrade performance.

Rename Buddypress Profile Tab


How does Decree of Silence interact with multiple spells cast?

Question: With a Decree of Silence in play with two depletion counters on it, what would happen if my opponent were to cast Titan Strength and then Giant Growth?
Answer: If your opponent cast Giant Growth without waiting for Titan Strength to be countered, both will be countered.
Whenever your opponent casts a spell, Decree of Silence will trigger and its ability will become the topmost object on the stack. When that ability resolves, the first spell will be countered, Decree gets its third counter and will be sacrificed. Therefore, if your opponent casts Titan Strength and just waits for the stack to resolve, Decree will be gone and he will be able to play Giant Growth without it being countered.
If, however, your opponent casts another spell before that ability resolves, Decree is still on the battlefield and will trigger again, putting another instance of its ability on the stack.
Now the stack starts resolving. The second spell gets countered and a counter is put on the Decree. It will be sacrificed immediately afterwards. Now the first instance of the Decree's ability resolves. It does not put a counter on Decree because it's already in the graveyard, but it will do as much as possible, i.e. it will counter the first spell.
Comment: Relevant rule: CR 112.7a Once activated or triggered, an ability exists on the stack independently of its source. Destruction or removal of the source after that time won't affect the ability. [...]


problem with calculated measure

Question: Hi i had a calculated dimension named employeeretirement based on the dateofbirth of the employee it will display the retirement year.My problem is when i changed the dateofbirths of the employees in  the database and processed the cube the changes are not reflecting the browser window.So to solve that im deleting the dimension and adding the from the table in dimension structure window so when i processed the cube and the changes are get displaying in the browser window.Is there any proper way to solve this issue,plz forward ur valuable answer to my mailid -firstname.lastname@example.com
Answer: Sorry but there are some definition problems in you question. Is the problem related to calculated dimension member or a  calculated measure? Although it is not clear, i think you are having problem because of not processing the related dimensions.
Processing the cube doesn't mean to process the dimensions. You should first process the dimension which you think has changed and then the cube.
Hope this help.
Answer: You have to recompile your sass?
Is this done with ruby?

problem with calculated measure


Connect BDESC S10E RTR

Question: I have a brushed motor and an ESC for brushed motors
 Motor rating is 12V 3A. ESC is the mod in the title. I have tried so much, but couldn't find a clue to find a relation between the led blinking, and how to speed up, change direction of the motor with the esc. I searched internet and also on the data sheet but couldnt finx a way out. Please help me?  I have access to a function generator, if that helps. Thank you.
Answer: The slow red blinking is the voltage protection. https://static.rcgroups.net/forums/attachments/5/9/5/6/0/2/a7824090-71-ESC.png
I tried to hook it up to a 18V Li-Ion Battery Pack from a Drill and had the same problem, unfortunately it got not only a untervoltage, instead it got some overvoltage protection too. The BEC that delivers 5V is from the volatgeprotection unrelated, so servos are still working.
After i hooked it up to a 2s Lipo (7.4V) (8.4V fully charged). It started up and works.
If I start it up without a reciver attached to it to give him a position/speed signal it blinkes the same way red.
And it blinks red when I start it up in a postion/speed state that is not neutral, till it gets his neutral(0 speed). Neutral is something like a 1,5ms pulse, from what i read from wikipedia. https://en.wikipedia.org/wiki/Servo_control
So there are two things to try out, decrease the voltage to something like 10v and try if it solved it. Or check how you are sending you speed value to the controller and if you have sent a neutral speed at the beginning.
Hope that helps a bit, even it the answer is quite late.
Comment: Thanks for the answer!

Connect BDESC S10E RTR


Can Mithril Aggregators change snapshot after signing?

Question: Mithril is a mechanism for developing lightweight wallets by storing blockchain snapshots on Mithril Aggregator. We can authenticate these snapshots using Multi Signature. But after the snapshot is signed, it will be stored by Mithril Aggregator. How to ensure Mithril Aggregator does not modify the data of these snapshots?
Answer: We ensure that the Aggregator does not modify the data of the snapshots by verifying the signature. The Mithril team will soon release documentation where this type of information will be clearer.
But to answer your question, the snapshots will be signed by Mithril nodes, and distributed by the aggregators as you said. However, the role of the aggregator is only to serve as a distributor, and we don't need to trust that the data shared is correct. That's what the signature is for. A Mithril client downloads the certificate (which cannot be forged by the aggregator) and the snapshot. Then, it verifies that the snapshot is signed (and therefore validated) by the Mithril certificate. This guarantees that the snapshot received by the client is the one signed by the Mithril nodes, and has not been tampered by the Aggregator. If the signature validates, then the Mithril client can use that snapshot to spin the wallet/node.
[EDIT]: The Mithril project is finally public. You can find more information in the proof of concept documentation:
https://mithril.network/doc/


what is default username and passoword for busybox's ftpd

Question: I am trying to ftp into my android device which is running ftpd server of busybox's multi-binary,  As the ftpd applet quotes "Anonymous ftp server" but when I use anonymous as username and my email address as password from my pc it says login failed , So in this situation what is the way to authenticate.
Comment: Tye using just `anon`
Answer: If you built it yourself, make sure authentication is disabled if you want anonymous connections. In make menuconfig,
Networking Utilities ->
    [*] ftpd
    [*]   Enable upload commands
    [*]   Enable workaround for RFC-violating clients
    [ ]   Enable authentication

If you downloaded it from somewhere, it may have authentication enabled. If it has the bbconfig applet you can also check the configuration to see if it has ftp authentication with busybox bbconfig | busybox grep FTPD_AUTH.
If you want it to work with authentication, you may have to add a user. From the source code it looks like it reads from the passwd and shadow files, so if you can add a user and specify the username and password for it then you should be able to login.
Answer: For anonymous access you don't need to pass a username/password. Just connect in without issuing USER or PASS.
Comment: I've tried this it doesn't works either
Answer: see the /etc/shadow or /etc/passwd (if the /etc/shadow not exist) with texteditor
or
cat /etc/passwd
cat /etc/shadow
if you use terminal.
It will show something like these:
root:$6$jc.8CPty$8rBE2WGgYuCH88ZSl0p8qohQqCBnvaBAy2fgUIq7vBL1Avv.0vCqZE/1k0X1gdZ62HEOvUBZNmXCluS0hsjd8/:10933:0:99999:7:::
bin:*:10933:0:99999:7:::
(not that lucky, you need to use john the ripper to brute force the password)
or
root::10933:0:99999:7:::
bin:*:10933:0:99999:7:::
(your lucky, all you have to do is to specify the user as root then set the password to anything, don't blank the password)
note: if after the username: shows *, it cannot be used to login, because it used
Comment: please provide me the busybox that you use, so i can test it. I've build my own busybox and what i say above is my own experience. And tell me the reason you gave me -1?


Move Windows 7 XP Mode to Windows 8?

Question: I use Window 7 XP Mode for my legacy applications (and also to sandbox iTunes)
I understand Windows 8 uses Hyper-V instead. I'd prefer to migrate my old machine than build a new one.
How do I move my existing XP Mode virtual machine to Windows 8?
Answer: The official answer is: You can't.
Although Harry's answer will work fine for "regular" Virtual PC VHDs, it won't work for Windows XP Mode. After installing the VHD in Hyper-V, XP mode will ask for activation and will fail activation, even if a valid Windows XP license key is specified.
Answer: Edit: this procedure doesn't work; see Heinzi's answer.
Windows Virtual PC Tips (PDF) says:

Windows Virtual PC VHD will work in Hyper‐V after uninstalling the Integration components (ICs). Uninstall the ICs before moving the Windows Virtual PC VHD to Hyper‐V.

So you should follow these steps:

Make a backup copy your XP Mode vhd file in case things go wrong
Bring up XP Mode and uninstall the integration components
Copy the vhd file to Windows 8 and import it into Hyper-V
Start up the virtual machine under Hyper-V
Install Hyper-V integration services

On the other hand, this document suggests that there may be issues with the Windows HAL (hardware abstraction layer).  If you find that the vhd won't start up under Hyper-V, or if the integration services installation fails due to a HAL mismatch, you might need to change the HAL type as described.  This should be done after uninstalling the Virtual PC integration components and before moving the vhd file to Windows 8.

Move Windows 7 XP Mode to Windows 8?


What is the most effective ship for soloing higher difficulties in Jamestown?

Question: What is the most effective ship for soloing Divine and Judgement difficulties in Jamestown or does it come down to personal preference and skill?
Answer: From the basic ones, I preferred the Charge ship for a long time. However, if you have the Gunpowder, Treason, and Plot DLC (it only cost 75 eurocents when I bought it), there are 4 new, much better ships.
Personally, I prefer the one called Ghost. It has a decent primary fire with a good coverage.
Secondary fire creates a ghost ship that passes through obstacles and keeps shooting forward and backward. In this mode your primary weapon changes to a short-ranged sword, Excalibur.  I found this to be great against bosses, too - the sword does decent damage and the indestructible ghost can shoot at the boss' weak spot, while you focus on dodging.
My favourite combination in co-op was me playing Ghost and my friend playing the Gunpowder ship. Its launched barrels have a great damage output, but I found its restricted range too limited for my taste.
Comment: It definitely takes getting used to but it is very effective.
Answer: I don't claim to be an exceptionally good Jamestown player, but I personally find that using the Gunner ship is easiest on higher difficulties. The ability to change your firing direction is invaluable when dealing with the multitude of enemies coming at you from various angles on the higher difficulty levels. Other ships simply do not offer that sort of versatility.
That being said, I personally cannot get through Croatoa in one piece without using the Bomber, as its ability to deal a lot of damage fast to multiple targets in a straight line fits that level like a glove (You may say that the Charge ship can deal even more damage in a straight line, but it simply can't do it fast enough).
Comment: I used the Charge ship all the way up to Croatoa, but I couldn't seem to progress past it. After about 45 minutes, I switched to the Gunner ship, and after a few attempts in which I was mostly learning to control the new ship, I reached the final boss and finished it off with one more try. I have not tried the DLC ships, but I certainly feel like the Gunner gives you the best way to deal with enemies that aren't in front of you, while also having strong forward firepower when you need it.


Rails benchmark the filter chain?

Question: I'm doing some optimisation on my Rails (2.3.5) app, and can't seem to find an elegant way of benchmarking the filter chain. I'm ab testing the site with something like:
ab -n 200 -c 3 -i -k http://localtestingserver:80/test

/test is setup with nothing in the controller and nothing in the page, so it's just loading our default filter chain plus rendering the layout. I get an average of 86ms per request, fine.
When I disable the filters (skip_filter filter_chain) it drops to 37ms, and without the layout (render :layout => false) it drops to 16ms. Is there a way I can benchmark, perhaps with Benchmark.realtime, each function being loaded in the filter chain, before the controller is called (or indeed after)? Can I output even a list of all filters being called on a request?
Thanks,
Dan
Edit
I'm using the Hodel3000 logger and Oink so get output per request like:
Jan 27 17:56:55 testing rails[19611]: Memory usage: 98748 | PID: 19611
Jan 27 17:56:55 testing rails[19611]: Instantiation Breakdown: Total: 2 | Room: 1 | User: 1
Jan 27 17:56:55 testing rails[19611]: Completed in 240ms (View: 28, DB: 0) | 200 OK [/test]

I'd just like to better understand and profile what happens before the controller is called - I can profile the controllers themselves fine. Like where the extra 212ms is from in the above request. Obviously I could drop code into each of my own before_filters, but hoped there was a way to wrap every filter in one go (like ones from included gems, etc.).
Answer: The Performance Testing Rails Applications guide looks like a good place to start.
Comment: Thanks, I'm doing a lot of the stuff there. It's not so much profiling different controllers/requests, but what happens before every request. I'll clarify the question above.
Comment: Broken link. The 3.2.14 version is here: http://guides.rubyonrails.org/v3.2.14/performance_testing.html

Rails benchmark the filter chain?


Backbone templates getting started: How to go from append() to using a template

Question: This is a very basic question on how to get started using templates. This is literally my first time using backbone so any additional pointers on how to improve my code are appreciated:
example is here: http://jsfiddle.net/H93Ej/12/
for the following snippet:
    addFurnitureLi: function (model) {
        // Add a new piece of furniture to the DOM list
        $("#furniture-list").append("
" + model.get('name') + "
");
    }

I would like to go from using append() to using a template like this:

But I'm lost as to how to integrate the above script template into the addFurnitureLi function. Also, I feel as though essentially the addFurnitureLi function is "rendering" HTML on the page, so I have another question-- what is the difference between that function and an "official" render function?
Thank you for educating me!
Full app code is listed below:
(function($) {

    Furniture = Backbone.Model.extend({
        defaults: {
            "name" : null,
            "quantity" : 1
        }
    });

    Furnitures = Backbone.Collection.extend({
        initialize: function (models, options) {
            this.bind("add", options.view.addFurnitureLi);
            //Listen for new additions to the collection and call a view function if so
        }
    });

    FurnitureView = Backbone.View.extend({
        el: $("body"),
        initialize: function () {
            this.furnitures = new Furnitures( null, { view: this });
        },
        events: {
            "click .furniture-add":  "addFurnitureModel",
        },
        addFurnitureModel: function (ev) {
            // Add a piece of furniture to the model
            var furnitureName = $(ev.currentTarget).data('name'),
                furnitureModel = new Furniture({ name: furnitureName });

            this.furnitures.add( furnitureModel);
        },
        addFurnitureLi: function (model) {
            // Add a new piece of furniture to the DOM list
            $("#furniture-list").append("
" + model.get('name') + "
");
        }
    });

    var furnitureView = new FurnitureView;

})(jQuery);

Answer: Boom shakah-lakah.
given that the ID of your template script is furnitureTemplate:

This works fine:
 addFurnitureLi: function (model) {
        // Add a new piece of furniture to the DOM list
        $('#furniture-list').append( ich.furnitureTemplate( model.toJSON() ) );
 }


Brake pad too low on rotor?

Question: I just bought a new Clarks CFR-06 rotor to try to improve my crappy Tektro Auriga, but it seems that I made another bad choice. After just a couple of minutes of trials, I noticed that the pads are rubbing "too low" (3 mm) as you can see in the photo. Do I need to put some washer between the caliper and the adapter, or this is just fine?
Thanks
Comment: I cannot see anything unusual on the picture; the braking traces are where I would normally expect them. Given that both inner and outer edges of the disc braking area are wobbly-shaped, it is hard to predict the optimal path for the pad without doing some comparative simulations or experimental runs. Unless there are clearance issues (disc scraping caliper or caliper touching spider), it should be fine. I want to add that I did use an extra pair of thin (~1 mm) washers with the adapter to fine-tune position of a caliper, and it worked fine.
Answer: IMO, this is fine. I base that answer on the fact that I've been running Avid BB7s on Shimano Centerlock rotors and they are also too low, and in fact abrade down into the arms a bit. After thousands of (touring) miles, this has caused no braking issues nor even any perceptible pinging, etc.
There is more on this here.
If you put in a couple spacers, you'll of course have a little less pad grabbing the rotor. Whether or not it's sufficient braking at that point will be up to you to judge.
Answer: Thanks for your answers.
For the moment i have put a couple of washers. The height of the caliper seems ok now. Still i have to test it.
Comment: Good work.  I'd suggest you look for some wider washers (ie larger diameter) to help support the rotor.  What you've got will have more sideways wobble than if there were no washers.  Ideally, they'd be as large as the mating surfaces.
Comment: So you think it might be dangerous as it is now? (still have to test it)
Comment: no its not dangerous, but it could be stiffer if the washers were wider.  As is should work absolutely fine, but it could flex subtly under braking loads.  Wider washers will decrease that potential flex.   But if you find it works now, then leave it as-is.

Brake pad too low on rotor?


How to give a specific program more resources

Question: I would like to give VirtualBox priority over anything else running on my install of Elementary OS. Within VirtualBox, I have dedicated 4GB of ram and 4 CPU cores to my VM, however the VM is still "laggy" while in use. I would like to know if there is a way to either turn off as many services as possible when VirtualBox starts, or if there is a way to give VirtualBox an extremely high priority over anything else running on my computer. Thank you all for any help in advance.
Answer: You could try to use System Monitor(install from AppCenter) for these. First open System Monitor from Applications, and go click on Processes, and find your VM process, depends on which VM one you using

Next, right click and choose priority for process as you wish:

So check it out:
Then install it in AppCenter by typing ''gnome-system-monitor'':
Comment: Hey @predrag can you make a note of which system monitor app you're using and how the OP can install it?
Comment: I am using default EOS System Monitor. There is no need to install it, it comes with EOS. :) You must meaning something else?
Comment: elementary OS doesn't ship with a system monitor installed by default
Comment: You are right. I forget it, that i did install it after OS install from AP.


Bond Issuance Question

Question: During a new bond issue how do the bankers/advisors determine an initial price for the bond? I know that during an IPO the investment bankers will guage demand for the issue, and price the issue according to the demand. Is this the same process that is applied for a new bond issue, or is there another way that the initial price is determined using the present value formula and overall market conditions? Thanks!
Answer: Different bond issues work different ways. The auction process for US Treasuries is described pretty well on the Bureau of the Fiscal Service's TreasuryDirect site. Basically, institutional investors put in bids ("I will loan $X millions at Y%) and Treasury accepts them in order from lowest interest rate to highest until their funding target for that auction is met - with all bidders receiving the rate of the highest accepted bid.
There are also non-competitive bids, but those are a small portion of any auction and don't affect the prices.
Answer: Assuming you're talking about corporate bonds (not government), the general process is as follows:

The company hires one or more (usually several) investment banks to underwrite the bonds. This bank(s) agree to buy the bonds initially from the company then sell them on the secondary market.
The underwriters determine an appropriate coupon rate for the bonds by looking at the yields of the company's current bonds (if any), the yields of bonds from other companies with similar credit risk, and talking to active market participants to see what prices they might be willing to pay. The coupon rate is usually designed to get a price close to "par" for the bonds (remember that the higher the coupon rate, the higher the price the company gets for the bond, but the more the company has to pay in interest).
Once a coupon rate has been determined, the underwriter buys the bonds from the company (less a fee for the underwriting) and proceeds to sell them on the open market. The market is the ultimate determinant of the actual market value.
Comment: Presumably the underwriters buy the bonds from the company at face value (minus fees)?
Comment: @JBChouinard Not to my knowledge, but the discount might just be baked into the underwriting fee. I do know that the company does not get 100% of the face value.
Answer:
Is this the same process that is applied for a new bond issue, or is there another way that the initial price is determined using the present value formula and overall market conditions?

It is similar and not same. Generally in IPO there is a price band recommended and the book building results in the actual price.
On Treasury bonds, the Govt / Central Bank will price these similar to the yields currently available for older bonds. If they offer more yield, it will get over subscribed and Govt/Central Bank has to pay back more interest. If the yield is low; it will not get subscribed.
On Corporate Bonds, depending on the company ratings as well as company brand, a specific company may choose to offer lesser yield or more yield.
Comment: Actually [at least US] treasuries go through a reverse Dutch auction process at issuance to determine the price. Although the price is likely to be inline with current market prices (ceteris paribus) there is no guarantee until the whole issue is taken up.

Bond Issuance Question


How to understand the binary latent variable z in GMM model?

Question: GMM(Gaussian Mixture Model) itself is a mixture of Gaussian with each having the proportion of $\pi_k$, $$\sum_{k=1}^{K}\pi_k=1$$this is easy to understand. But when introducing the latent, I don't understand it, because there can only be one $z_k=1$, then how this is related to the soft assignment in GMM model?
Answer: It may help if you can define the $z$ variable a bit more thoroughly in your post, since people can use this variable for different things.
However I am going to assume that you are referring to $z$ as a latent variable that randomly selects from a one-hot encoded vector which Gaussian to choose, for example when randomly sampling from the GMM.
For example, when randomly sampling a GMM you need to pick "one out of $K$" Gaussians to pull the sample from. How do you automate that process? You define an extra latent variable, $z$ to act as the middle man in a sense which communicate which Gaussian to pick from a one hot encoded vector of choices.
So for some data point, $X_i$, we can ask the question what is the probability distribution of $X_i$ assuming it belongs to class "2", so it allows to formalize questions such as: $P(X_i | Z = 2)?$, to which we can allocate its Gaussian $P(X_i | Z = 2) = \mathcal{N}(\mu_2,\sigma^2_2)$, and then we can assign multinomial priors to each cluster and even as $P(Z=2)$, what is the prior that we belong to class 2. And so on.
So it's a latent middle man that helps with the random choice of which Gaussian to pick in the mixture when sampling, or calculting the EM algorithm etc.
See also this link:
https://stats.stackexchange.com/a/380776/117574
Comment: Thank you for your answer, it is very helpful. I have another question, in M-step, the GMM is maximizing the log likelihood of complete data $argmax_{\theta}\int p(z|x,\theta^{old})lnp(x,z|\theta)dz$, is is universal for all EM problems even if it is not gaussian mixture models?
Comment: Correct. Read here and notice that the problem is set up in a very general way https://stats.stackexchange.com/a/371087/117574 and it is only until the author says "For the normal mixture" or something like that, is when he can only start to specify how to expand these expressions for GMMs in particular. Otherwise EM is a generic algorithm. Imagine if in a vacuum you gave me your integral expression --- I would have no clue it is related to Gaussians in any way. It is simply some generic probabilistic expression.
Answer: With GMM do you mean "growth mixture model?" If so, then it looks like the proportion π_k might indicate the size of a particular latent class (class size parameter). Since the K latent classes in GMM are exhaustive and mutually exclusive, the π_k parameters for all classes add up to 1.0. This is what the equation states. (For each specific latent class, you should get a specific π_k parameter estimate that is < 1.)
Comment: Sorry about the confusion, GMM means Gaussian Mixture Model here. I added it to the question description.


Magento mini-cart getSummaryCount inaccurate after removing from cart

Question: I have a function that removes all of a product from the cart.
public function removeFromCartByProductIdAction()
{
    $productIdToRemove = $this->getRequest()->getParam('productIdToRemove');
    $cartHelper = Mage::helper('checkout/cart');
    $items = $cartHelper->getCart()->getItems();
    foreach ($items as $item) {
        if ($item->getProduct()->getId() == $productIdToRemove) {
            $itemId = $item->getItemId();
            $cartHelper->getCart()->removeItem($itemId)->save();
        }
    }
}

If I had 4 of the product in the cart, it will remove all 4 from the cart. But the function getSummaryCount provided by Magento Mage/Checkout/Block/Cart/Minicart.php will return 3. This persists until  I visit the cart page, after which it will return the correct amount  of 0.
I use the result of getSummaryCount to preview how many items are in the cart on my cart icon. How can I ensure it gets the correct summary count after I run my function?
Answer: I did not find the root cause, but was able to fix it with a workaround by going into my theme, finding the mini_cart.phtml file, and making this change.
<?php $_cartQty = $this->getSummaryCount() ?>
<?php $_items = $this->getRecentItems(); ?>

To
<?php $_items = $this->getRecentItems(); ?>
<?php $_cartQty = count($_items); ?>


How do I count rows in MySQL?

Question: I know just about the basic usage of COUNT(*) and I wonder if I can use it or some other function to get the following result.
I have a table with people and the products they have purchased (product_id_). I have second table which maps each product_code to a single product_category.
Using a simple SELECT I can combine both tables to get:
first last   product_code product_category
John  BGood  100          Food
John  BGood  29           Beverage
John  BGood  30           Beverage
Rita  Black  25           Fashion
Betty Rock   36           Electronics
Betty Rock   72           Food
Betty Rock   100          Food
Betty Rock   36           Electronics

But what I would like is to count for each person the number of products it purchased from each category. product_category is an enum with 5 possible values (the four above and Other). I would like to get a table like:
first last   product_category count
John  BGood  Food             1
John  BGood  Beverage         2
John  BGood  Fashion          0
John  BGood  Electronics      0
John  BGood  Other            0
Betty ...

Answer: Try this query
SELECT first, last, product_category, count(product_category)
FROM <table_name>
GROUP BY product_category

Comment: I think you have to group by `first` and `last` as well because you don't want to aggregate over the total of all categories but over all categories of the corresponding person.
Answer: SELECT first, last, product_category, COUNT(product_code)
FROM

ORDER BY last, first
GROUP BY first, last, product_category

Answer: Append GROUP BY person_id, product_category to your SELECT.

How do I count rows in MySQL?


Difference between "einfach" and "leicht"

Question: I've started playing a video game in German for practice, and the difficulty levels (Schwierigheitsstufe) start at Einfach ("Easy" in English). This surprised me because I thought Leicht would be the best translation in this context. I associate einfach more with "simple", as in "not complicated", but the game is just as complex on this level; they just give you fewer enemies to contend with and more time to complete missions. Are einfach and leicht interchangeable in this sense, and if not then what is the difference? (The other levels are Normal, Herausfordernd, Schwer, Brutal, Albtraum & Apokalypse in case anyone is interested.)
Related: Simpel vs einfach.
Answer: The adjectives "einfach" and "leicht" are roundabout interchangeable in most contexts, though both cover some additional ground the other one doesn't.
"Leicht" can also mean something like "lightweight", while "einfach" can also mean something like "simple", "ordinary" ("Er lebt in einem einfachen Haus"), or something like "once", "single" (compare "einfache Anführungszeichen").
To me as a native speaker, "einfach" has a bit more connotations of "uncomplicated", while "leicht" is more like "easy", "not much effort". But this difference is quite subtle, and as I said, the two are mostly completely interchangeable.
Comment: Thanks. The difference between "simple" and "easy" in this sense is subtle as well. Still, there are some cases where they are not interchangeable.


Couple questions regarding 3PL IRT model

Question: It so happens we need to implement our own parameter estimation for 3PL IRT model in our small in-house tool we are developing. I'm using Stata which implements IRT to compare how our estimates fare against those of professional software. It's not surprising, I guess, that I've run into discrepancies, given that the model is not particularly easy to estimate. If somebody has an in-depth knowledge of the model and the techniques that one uses to estimate parameters, I'd be grateful if you shared your insights. I'm pretty sure my questions are ones of a newbie, so any expert shouldn't have a hard time answering them.
First, the overall scenario is that we feed tests of similar questions to a sample of students. By similar I mean topically similar -- for example, they can be math questions or chem questions, but never math and chem questions combined. Would it be ok then if I chose ratio of correctly answered questions as the measure of student's ability/latent trait? I believe it makes sense, but above all I'd very much prefer to avoid the situation when I have to estimate both model's parameters and students' abilities from the likelihood function -- I'm struggling with the model as it is, with students' abilities known.
If it's ok, can I estimate both students' abilities and parameters of the model from the same test or will I be over-fitting the data? I'll explain... Say, our test contains 20 math questions. We feed it to a sample of 100 students. We record who answered what and then we calculate ratios of correctly answered questions for every student. These are students' known abilities. Can I now take the first question of the test and estimate 3PL parameters for it based on the data of ratios I have just recorded? I mean it looks like I used the first question (together with the other 19, but still) to estimate abilities of the students, and now I use these estimates to estimate 3PL parameters of the first question. This back-and-forth sounds like over-fitting to me... What's your opinion?
Third, to estimate 3PL parameters I use classic method described in F. Baker and S-Ho Kim's work "Item Response Theory: Parameter Estimation Techniques..." where they use Newton-Raphson iterative procedure. We've tried to run it, but we can't make it deliver consistent results. Instead, we are thinking of outsourcing this part to the libraries of math functions that are available for the programming language we use. To be precise, we want to construct the likelihood function ourselves and then feed it to some generic maximum-finding algorithm. Sounds straightforward, but since I'm not getting consistent results, I'm doubting my whole understanding of how it's supposed to work. Could you confirm that yes, indeed -- the ultimate goal is that we simply need to find the maximum of the likelihood function that we build based on our abilities data from the sample of students? That is find the maximum of $Prob(R)$ in the snapshot below (Baker's book):

where $f_j$ is the number of students with ability $j$ and $r_j$ is the number of students with ability $j$ who answered the question correctly.
Finally, I don't understand how professional software (I use Stata) manage to build 3PL model for a test of a single question. A single question means that students' abilities (as ratios of correctly answered questions) can be estimated to be only either 0 or 1. When I construct the likelihood function and search for its maximum, then the 3PL parameters I obtain give me a very degenerate logistic function, looking like this (red points on the plot correspond to the students' abilities, but since I normalize them, they are not actually at points 0 and 1):

Stata, on the other hand, manages to produce a very normal-looking and smooth logistic function. When the test consists of dozens of questions, so that estimated abilities fill a certain range, I get typical logistic functions too. But I can't comprehend how Stata fits the data even in degenerate cases like this. Which leads me to doubting whether I even understand what I'm supposed to do and what the end result should be.
Any thoughts on any of the questions are most welcome. And thanks.
Answer:
Finally, I don't understand how professional software (I use Stata) manage to build 3PL model for a test of a single question. A single question means that students' abilities (as ratios of correctly answered questions) can be estimated to be only either 0 or 1. When I construct the likelihood function and search for its maximum, then the 3PL parameters I obtain give me a very degenerate logistic function, looking like this (red points on the plot correspond to the students' abilities, but since I normalize them, they are not actually at points 0 and 1) ... Stata, on the other hand, manages to produce a very normal-looking and smooth logistic function.

I can't verify that the graph you produced is the correct likelihood function for a 1-item, 3PL model. However, I can tell you that if you used any of the stock IRT commands in Stata, you were not graphing the likelihood function. You were probably graphing the item characteristic curve, i.e. the probability of a positive response to an item given a certain level of depression. ICCs look like this. In your case, they would have had a lower asymptote, but these are from a 2PL model, which doesn't model such an asymptote.


Why and when we do not need to test the pre-trend analysis for Difference-in-Difference

Question: When regressing DID, we normally run pre-trend analysis. But in some papers recently using "generalized" DID for testing the impact of staggered laws on some dependent variables, the authors did not conduct the pre-trend analysis (here and here). This raises a question to me that why and when we do not need to perform a pre-trend analysis. Any suggestion or document and explanation is much appreciated.
Comment: How sure are you that they didn't test for a difference in trend in the pre-period?
Comment: @ThomasBilach FMHO, they did not show any pre-trend analysis. From what I saw, they just plot the graphs in section 3.1 page 2600 paper [link](https://academic.oup.com/rfs/article/32/7/2587/5079300), not any official pre-trend analysis. I may miss something here, please let me know. Warm regards.
Answer: A pre-trend analysis isn't a requirement, though it improves the credibility of a study. Typically, evaluators plot the outcome trends for the treatment group and the control group over time. We should expect the inter-temporal evolution of the trends to be reasonably parallel before the law/policy is enacted.
For example, the authors in the paper you referenced plot the mean change in asset growth in both groups in the 2 years before and the 5 years after the adoption of a leniency law. We should expect the trends in asset growth in the treatment group and the control group to be moving in tandem before the passage of the leniency law. If the two groups were on completely different trajectories, then we may wrongly infer a "treatment effect" when, in fact, divergent paths were already emerging in the pre-treatment epoch.
Technically, a pre-trend analysis was conducted in the work you cite. In section 4.2 they investigate a "dynamic response" to treatment. In particular, they examined whether some countries "anticipated" a change in their leniency laws. Media outlets may report on impending law/policy changes, and firms within those countries may start to change their behavior before the law is actually passed. To investigate anticipatory effects, the authors include dummies from 1 to 4 years before the passage of the law.
Including indicator variables for the periods before the shock serve two purposes in my estimation. First, they model potential anticipatory effects. Second, it is a form of pre-trend testing. With respect to pre-trends, we shouldn't be observing strong non-zero effects in the years before the law is passed, unless we suspect anticipatory behavior. And even if anticipation is suspected, the anticipation phase is usually limited to the periods close to the treatment's start date.
Comment: thank you for your tho rough explanation. I have two questions (1) is there any reference mentioning that "A pre-trend analysis isn't a requirement" and (2) regarding how the authors "include dummies from 1 to 4 years before the passage of the law"? It links to my [another question](https://stats.stackexchange.com/questions/526090/pre-trend-testing-for-generalized-difference-in-difference)  , I much appreciate if you can have a look and answer or help me to edit the question to be more readable based on your experience. Much appreciated.


Grammatica program

Question: Does anyone know if Grammatica still exists - the program which accents Russian text for you? I lost my stand alone app version when I had to reset Windows 10. A Google search for the online version is 'unable to find the server.' If this company no longer exists are there any alternatives? Thanks!
Comment: See https://russian.stackexchange.com/q/332/2104
Comment: The website stopped working about a month ago. I've been trying to find some info on what happened and if its coming back up, but no luck. They had a pretty expensive subscription model. There are other sites out there for stress marks - RussianGram and Russian Stress - but none that provide all the cases and other grammatical info this one did.
Comment: Thanks for the info. Yes- their grammatical information was invaluable. I still have trouble identifying participles- although so far the morfologia site does a good job as long as you already have a basic grasp of the grammar.
Comment: although visual info is indeed very convenient, one can always paste a text into Google Translate and listen to the playback of any given word
Comment: it's not a question about Russian language
Answer: I've been using Russiangram for a few days now in order to replace Grammatica. Very well done and very helpful! The one question I have now is how to choose when it gives you an option. eg: Вели́ка|Велика́. The morfilogia site helps somewhat and also a book I have 5000 Russian words. But one of the most helpful things about Grammatica with its drop down tables was that it made the choice quite easy.
Comment: i guess the choice of the correct stress needs to be informed by knowledge of the grammar

Grammatica program


How can I disable S/MIME signing/encryption for Mail on iOS?

Question: I would like to deactivate S/MIME signing and encryption in Mail on iOS (latest version 16.3.1) as I no longer use it. In Settings > Mail > Accounts > [my account] > Account > Advanced, I see at the bottom two options for S/MIME signing and encryption that can, however, not be deactivated (see screenshots). If I recall correctly, there seemed to have been a third option in the advanced settings, and that was whether to use S/MIME at all. That option is not visible in my settings however. Any help with this is much appreciated
Comment: Without certificate it won't be able to sign/encrypt mails anyway. Does the lack of a certificate cause issues (e.g. warnings when sending mails)?
Comment: Thanks for your reply. Indeed I get warnings both for composing messages (no cert found) and for sending (do you want to send without encryption?). I didn't see an option to deactivate S/MIME altogether for this account, though. Thanks for any hints!
Answer: If you cannot deactivate signing and encrypting, then it has probably been configured by a profile.
Search for "profile" under in your Settings app to find the configuration. You can delete the profile unless it has been protected from removal by a password.
Comment: Thanks for your reply. When I search for profile (or "Profil" in German) in settings, I only find the settings for "VPN and device configuration" which are empty. Also, I recall having installed the S/MIME certificate myself a long time ago. But I can't seem to be able to delete it anymore... :-/
Comment: We are not speaking of a self-signed certificate, are we? What is displayed if you click (i) at the selected certificate? Is it trusted? And did you try to delete and re-create the mail account?


Why do mobile ads fail?

Question: I want to know from a UX perspective putting aside the fact that the time at which the ad is displayed is never right. Lately I've been noticing various formats to try and engage a user (me in some cases) but users don't even glance it. I do get some relevant ads that I used to download an app. On the whole experience front why do our finds just shut off when we see an ad?
Comment: When you wrote "Why do our *f*inds just shut off" I think you meant *m*inds—but the M is so far from the F on my keyboard, I'm reluctant to edit this for you. :o
Comment: It's an interruption, a distraction, a pesky fly getting in the way. Speaking for myself.
Answer: Think about the user's tasks. They're using the app for a particular purpose, working toward certain goals. Ads are, therefore, distractions or hurdles in the way of reaching those goals.
You might also be interested in reading about Banner Blindness.

Why do mobile ads fail?


Why are all the toilets in my house running intermittently?

Question: All of my toilets in the house have started to run intermittently. Is there something wrong with the plumbing or could it be that the flapper has gone bad on all the toilets at the same time?
Comment: Maybe they are trying to get in shape.
Comment: Have you done anything different in your home recently (particularly added/changed anything that uses water)?
Comment: Does your house have a Pressure Reducing Valve ([PRV](http://en.wikipedia.org/wiki/Pressure_reducing_valve))? This will usually be located near the supply shutoff valve.
Comment: are you on well water? or city water?
Comment: Is there water flowing in to the bowl? (Perhaps put some dye in the toilet tank, and see if the water in the toilet changes color over time without flushing).
Comment: You might try to diagnose what actually is the cause, per toilet.  Then you would have an idea of what to look for as a commonality.  It could be coincidence.  It could be you didn't notice one going bad until another one got your attention.
Answer: You have to diagnose why the toilets are running, but given that multiple toilets have started running simultaneously, I'm guessing your water pressure is too high. This can be due to a falling PRV or a missing or failing expansion tank. See this answer for the steps to check an expansion tank. This answer may also be helpful. If you find your water pressure is well over 60psi (I believe) all the time, then you need a PRV (or to replace your existing one).
If checking your water pressure shows that it's never high, then it's time to diagnose the toilets. If the float valve is adjusted too high and allows the water to reach the overflow, then you may be losing water through the overflow and the toilet will cycle to makeup the lost water. I've also seen cases where the tube to refill the toilet was installed in such a way that it was below the water level and it eventually siphoned water through the fill valve into the overflow drain. The water would siphon down until the toilet ran to makeup for lost water. The most common reason is a bad seal on the flapper valve. Depending on the flapper design, this may be replaceable without disassembling the toilet tank. One last possibility is a failing valve on the toilet. Typically, the reason these fail is from high water pressure. But the symptom will be a high water level, well above where the float should shut it off. You may find the float submerged if this happens.
Answer: There's nothing wrong with the plumbing...the flappers do go bad eventually. I h ave an ongoing problem with my 2 toilets. Not that it's really on-going, it's that I put it off until I can't stand it.
Replace one of them (the flapper or the whole kit) and see if the problem is solved (it will be!). I don't have to tell you what to do with the rest of your plumbing if this works.
Comment: The problem could also be the fill valve. If the tank's water level is at the top of the overflow tube, then the fill valve needs replacement.
Answer: Remove the tank lid and look inside. There will be a copper tube sticking up in the middle. If the level of water is up to the top of the copper tube and draining into the tube, which would make it above the max fill line, you have a bad fill valve. The fill valve is the component that sticks up from the left side (usually) of the tank and has the float (or float arm is connected to it in the case of older style ball floats.)
If the water level is not up to the top of the copper tube you have a bad flapper that isn't making a good sel and letting water escape. The flapper is a rubber lid that covers the outflow port on the bottom middle of the tank. It is connected to the lever via a chain and arm.
You're best bet is to just replace them both to save yourself the hassle of replacing the other at a later point. They come in a kit. Take a picture of the flappers to make sure the one in the kit will work or get an appropriate flapper.
I really like the Korky QuietFill valves. They're quieter than the FluidMaster ones they replace and have lasted longer for me. I think the oldest one I have installed is going on 10 years now without problems.
Answer: It's probably the flappers. Since they are pretty cheap, they usually get replaced all at once.
Same flappers sitting in the same water, going to deteriorate at the same pace.


how do I set one variable equal to another in pig latin

Question: I would like to do
register s3n://uw-cse344-code/myudfs.jar
-- load the test file into Pig
--raw = LOAD 's3n://uw-cse344-test/cse344-test-file' USING TextLoader as (line:chararray);
-- later you will load to other files, example:
raw = LOAD 's3n://uw-cse344/btc-2010-chunk-000' USING TextLoader as (line:chararray);

-- parse each line into ntriples
ntriples = foreach raw generate FLATTEN(myudfs.RDFSplit3(line)) as (subject:chararray,predicate:chararray,object:chararray);

--filter 1
subjects1 = filter ntriples by subject matches '.*rdfabout\\.com.*' PARALLEL 50;
--filter 2
subjects2 = subjects1;

but I get the error:
2012-03-10 01:19:18,039 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200:   mismatched input ';' expecting LEFT_PAREN
Details at logfile: /home/hadoop/pig_1331342327467.log
so it seems pig doesn't like that. How do I accomplish this?
Answer: i don't think that kind of 'typical' assignment works in pig. It's not really a programming language in the strict sense - it's a high-level language on top of hadoop with some specialized functions.
i think you'll need to simply re-project the data from subjects1 to subjects2, such as:
subjects2 = foreach subjects1 generate $0, $1, $2;

another approach might be to use the LIMIT function with some absurdly high parameter.
subjects2 = subjects2 LIMIT 100000000 ;
there could be a lot of reasons why that doesn't make sense, but it's a thought.
i sense you are considering doing things as you would in a programming language

i have found that rarely works out like you want it to  but you can always get the job done once you think like Pig.
Answer: As I understand your example fro DataScience coursera course.
It's strange but I found the same problem. This code works on the on amount of data and don't on the another.
Because we need to change parameters I used this code:
filtered2 = foreach filtered generate subject as subject2, predicate as predicate2, object as object2;


In CartoDB, why can't I see my text item in the map view editor?

Question: I'm working in CartoDB on a map that is pretty much completed. I was editing a text item that I had added to the map, and I somehow moved it out of the editor screen and now cannot find it again (it has the data citation). I would assume that was deleted, but when I view my map on my organizations website where it is embedded, it is appearing in the original place. I need to edit the text item, though - any suggestions for how to locate it and move it back into the map view editor?
Answer: It seems that when you moved the screen, the item got hidden.
If it's an annotation element, open the JS console of the developer tools of your Browser meanwhile the Editor with the map is open, and run:
<code>$('div.annotation.overlay').css("left", "0")
$('div.annotation.overlay').css("top", "0")
</code>
This will put the element at the top-left corner.
If it's a text item, use:
<code>$('div.text.overlay').css("left", "0")
$('div.text.overlay').css("top", "0")
</code>
Then, once the elements are visible in the Editor, you can get rid of them or move them wherever you need.
Comment: Ah perfect - that's exactly what I needed. Really appreciate it!
Comment: Hi - and many thanks for the response. However, I'm not clear on how to open the JS consule of the developer tools. Is there a how-to guide that could help me with this? I see where to access information on CartoDB.js, but I'm not clear on how this connects to your suggestion.
Comment: The console is not a part of CartoDB, is a part of your browser :-) If you are using Chrome, see how to open it here: https://developer.chrome.com/devtools/docs/console This will work inside the Editor, you don't need CartoDB.js! The code I pasted in the response gets the "annotation" or "text" elements and set their position to (0,0), this way if the elements are lost in the Editor in a position you can't see, they'll appear there.


Is it possible to use an Apple gift card toward repairs?

Question: I have a gift card whose balance should just about exactly cover the cost of some repairs Apple is doing on my computer. Is it possible to spend a gift card on repairs? I assume so, but I cannot find any confirmation on Apple's website. Just wondered if anyone on here had any experience to confirm or disconfirm.
Comment: You can even pay part with the gift card, the rest with cash or other payment. Just be sure it's not an iTunes store gift card - those are not valid on the web store and retail stores.
Comment: @bmike yup, that's exactly what I did, with great success.
Answer: If the card can be used in an Apple retail store (i.e. not an iTunes gift card), then yes. Repairs are treated as an in-line item in their POS system. Any valid form of payment that could be used to pay for anything else in the store can be used to pay for repairs.
I called an Apple retail store to confirm this.
Comment: @michael +1 for thinking to call the store.
Comment: Thanks for making the call for me! Sometimes I forget that the "phone" can be a valid source of info...
Answer: From the Apple Gift Card Page:

The pressure's off. Now your friends and family can choose almost
  anything that Apple offers in its huge collection of Mac and iPod
  products at any Apple Store in the United States - online, by phone,
  and at an Apple Store near you. Just give an Apple Gift Card and the
  recipient can choose from qualifying products.

Clearly just for buying a subset of products, not for repairs.
Comment: This is incorrect - Apple Gift Cards (which are different than iTunes gift cards) are acceptable forms of payment for anything that is sold in the Apple Retail Stores - repair services are processed through the same iPod touches as the rest of the things you buy there. Your repair paperwork gets scanned with a barcode scanner, your gift card gets swiped as a credit card would, you leave with your mac as long as enough funds are there to cover the repair.
Comment: Adding a data point here - was told by Apple Chat that Apple ID balance (which is redeemed by Apple Gift Card) cannot be used for AirPods Pro case replacement cost. Very frustrating.


"Incompatible with other applications(s) using the same shared user ID" when installing Google Play service?

Question: I need to run Google Plus, and Google Plus needs the Google Play service.
Every time I install google play service from the Google Play store it fails to install with this error:

Incompatible with other applications(s) using the same shared user ID

What could be the issue? How can I fix this?
UPDATE: I know almost nothing about android, so I dont know what ROM is, or such thing, I get my phone from local production and I guess, yes, it uses custom system, so I just know that I'm using Android Version 4.0.4. any help would be greatly appreciated.
Comment: Mind to add some details on your device? Which is it, what Android version is running, is it a custom ROM (and if so, which)? On a stock ROM, Google Apps should already come pre-installed.
Comment: Google Play Service is part of your Android OS. You don't need to install it separately. If you have custom ROM and you have done some modification then mention it so that others can help.
Comment: Reads like your "local production" hasn't set-up the custom system correct.
Answer: What is get my phone from local production?
Since you mentioned about custom system are you referring to a modded ROM like Cyanogenmod, Paranoid Android etc?
You have custom recovery in place? If so, grab the latest Google Apps from here appropriately for Android 4.0.4 aka ICS, more than likely, this version of gapps.
Reboot into Recovery, select:

Wipe Cache
Install from zip, select the gapps you downloaded
Then when install is done, reboot.
Answer: Google Play services is used to update Google apps and apps from Google Play. This component gives you access to Google Settings and helps apps speed up offline searches, provide more immerse maps, and improve performance.
If you think there is an error of your OS, you can always go for a factory reset. You shall backup your data before you proceed. This should re-install the Google Play service. And if you are NOT asked to install Google Play Services, you don't have to. It is bundled with your OS. You must simply be able to download Google+ and use it on your phone.
You can find your device info from Settings => About Phone
Answer: What worked for me was the suggestion I found here:

http://forum.xda-developers.com/showthread.php?t=1219029

In a nutshell:

Figure out the exact formal fully-qualified package name or *.apk name for the app you're trying to install. For Google Play Services, it's com.google.android.gsf or GoogleServicesFramework.apk.
Pull the /data/system/packages.xml file from the phone using adb
Open the xml file in a text editor and look for the <package> xml element that describes your app, using the names from step 1.
Get the value of the sharedUserId attribute for that element.
Remove the entire <shared-user> xml element with the userId attribute that matches the id you found for the package.
Push the modified packages.xml file back to same location on the phone using adb
Wipe the dalvik cache and reboot.
Comment: I don't understand how people can trust other solutions like wiping cache/data. Your instruction is clear and understandable! Help me to install `MX player` on top from modded ROM. Thanks!
Answer: I had the same problem. I uninstalled all app updates and this fixed the issue
Answer: You should know this first that Google play service is required by some apps which had implemented functionality provided by google play services. Like multi player, real time multi player, leader-boards, achievements in some games ans apps.
If you are having problem in downloading it there are many possible solutions there.
- Go to the application manager, remove all updates from google+ related apps. Then start play service after installing all the apps updates. This might get solved ur problem.


Should I downvote questions posted on the wrong SE site?

Question: If a question is not directly "bad", but placed on the wrong SE network (e.g., posted on stackoverflow.com when it should have been posted on superuser.com), in addition to close-voting, should I also downvote the question? Or not?
Comment: Do you think *How much eggs do I use for waffle batter* is useful to have on the front-page of SO?
Comment: @rene no, not at all.
Comment: Three down votes will remove it from the front page and there are way more down voters then close voters so that still is a viable option. Down voting prevents that other cooks go ask questions on SO as well and less people are invited to answer *6 to 8 eggs will do*.
Comment: @rene Doesn't disappearing require a net score of -4?  Pretty sure answers just get greyed out at -3, at least at Arqade.
Comment: @fbueckert being off-by-one isn't unfamiliar to me ...
Answer: I generally do not downvote a question that is a good question, but merely submitted to the wrong stack. I will flag/VTC the question, and will sometimes explain why the question is inappropriate for the stack.
If the question is on a topic that belongs on a different stack, but would likely be closed on the "correct" stack for various poor-quality-related reasons, I will flag/VTC for a reason other than it being on the wrong stack, and will comment that the topic belongs on [whatever-stack], but would not be acceptable there in the present form because [reasons].


Possible to switch out View Controllers managed by a UINavigationController?

Question: I am breaking the normal paradigm of a UINavigationController, or at least I'm trying to.
We know that the Navigation Controller manages navigation via a stack. If I initialize with root controller A, navigate to B, and then Navigate to C, the Stack will look like - C/B/A.
What I want to do though, is have a button on view C that will show another view, say X, but still keep the Navigation Controller's nav bar in place. Essentially, switch "C" and "X" on the stack. I tried to accomplish that by popping C off and immediately pushing X as shown below, but it didn't work. Am I going down the wrong path here?
-(IBAction)showViewX:(id)sender {
[[self.parentViewController navigationController] popViewControllerAnimated:NO];

XViewController *xViewController = [[XViewController alloc]
        initWithNibName:@"X"
        bundle:[NSBundle mainBundle]];
[[self.parentViewController navigationController] pushViewController: xViewController animated:YES];
[xViewController release];
}

Answer: What you call "view C" is actually "view controller C". Since it is a view controller, you can easily set it up to switch between, say, two views, X and Y. So you just leave C on the stack, don't pop it, and switch between views in C itself. For example, you can set up C to use a toolbar to switch between views.
Answer: It might be the case that you really aren't trying to do the kind of navigation that the UINavigationController was designed to support. In your example, how does your user get back from view X to view C?
UINavigationController is intended to allow basic forward/back navigation. If you have more-complex navigation needs, you'll have to build your own navigation system. Take a look at how some of the more-complex Apple applications do their navigation (Mail and Safari) -  maybe there's something in there that'll be helpful?
Comment: To answer your question, "how does your user get back from view X to view C?", they wouldn't be able to. Instead, when they navigate back they would go to B instead of C. (In my case, B has buttons to go to C, X, and other views).
Answer: (Looking at the clarifying comment above, I misunderstood the goal of the original question, a better approach would be to manage the display of either View X or View C from within View C itself, switching out as necessary, and not altering the stack at all.)
Since you want to keep the navigation controller bar, but you do not want to be able to go back to 'C' from 'X' (I assume there is some other path out of 'X') Then you could do the following:
self.navigationItem.hidesBackButton = YES;

from within ViewController X, inside the viewDidLoad method.
X is still on the stack, C is still on the stack, but you get the visual representation you wanted.
Otherwise you'll probably need to roll a new NavigationContoller, pop X onto it's stack, and jump to it, leaving your old stack (and ViewController) behind.


MEW keeps putting in QSP contract address for receiver instead of address I've entered

Question: I'm trying to send Quantstamp (QSP) to Binance offline, using MyEtherWallet. In mew's offline helper... when I paste in the signed transaction (into the online MEW, as received by offline version of mew) it keeps saying receiver is the QSP contract address - not the binance address (as supplied to me by Binance). The sender is correct (my mew wallet) - but not the receiver. Is that supposed to happen?
Answer: QSP is an ERC-20 token. Token transactions work a bit differently than regular Ether transactions. To transfer a token, you send a (0 Ether) transaction to the token contract, with data that specifies the value of tokens to send, and the address where you want to send the tokens to. If you take a look at a token transaction on Etherscan.io for example, you will see that the "To" address is the token contract.
A token transaction can look something like this:

Address: 0x99ea4db9ee77acd40b119bd1dc4e33e1c070b80d (QSP contract)
Value: 0 Ether
Data: 0xa9059cbb0000000000000000000000004bbeeb066ed09b7aed07bf39eee0460dfa2615200000000000000000000000000000000000000000000000000de0b6b3a7640000

The data consists of three parts:

The first 4 bytes (or 8 hexadecimal characters) specify the function of the contract to call. In this case 0xa9059cbb, which is the transfer(address,uint256) function. This is also called the function signature or selector.
The address where to send the tokens to. This is the next 32 bytes after the function signature, in this case 0x4bbeeb066ed09b7aed07bf39eee0460dfa261520 (removing the zeroes at the start).
The number of tokens to send. This is the last 32 bytes of the data, which is 0xde0b6b3a7640000 or 1000000000000000000 in this case. QSP has 18 decimals, so this is equla to 1 QSP.

You can read more about transaction data here, and more about how tokens work in the background here.
Comment: Thanks for the info, very interesting. However... in case somebody else happens upon this question, I'll answer it this way (after crossing my fingers, I ran a test, sending just one token to "see what happens"): The answer is "yes," you'll see the token contract address, not the Binance address in the "receiver" field. (So, you'll have to make darn sure you input the Binance address in correctly when initially inputting it - because there doesn't seem to be a way to check it before putting the order through.) If I'm wrong about this, anybody, please correct me.


Lifts across covering maps

Question: Let $X,Y,Z$ be connected topological spaces, $f\colon X\to Y$ be a continuous map and $p\colon Z\to Y$ be a covering map. The problem is the existence of a continuous lift of $f$ across $p$. A standard result involving fundamental groups and induced homomorphisms requires that $X$ be path-connected and locally path-connected. Sufficient conditions however exist also in case of not necessarily locally path-connected spaces $X$. Say, if $X$ is contractible then the lift does exist. Could you please recommend a work containing sufficient conditions for more general spaces $X$ than the locally path-connected ones? (Possibly with further restrictions on $f$ or $p$.)
Comment: Do you have any specific example in mind? What kind of spaces are you thinking of?
Answer: Suppose you have basepoints $x_0\in X$, $z_0\in Z$ and $p(z_0)=f(x_0)$. The lift $\tilde{f}:X\to Z$ such that $p\circ \tilde{f}=f$ exists and is continuous if and only if
1) $f_{\ast}(\pi_1(X,x_0))\subseteq p_{\ast}(\pi_1(Z,z_0))$ (this is equivalent to $\tilde{f}$ being a well-defined function).
2) For every evenly covered neighborhood $U\subset Y$, there is an open neighborhood $V\subset X$ such that if $\alpha,\beta:([0,1],0)\to (X,x_0)$ are paths with $\alpha(1),\beta(1)\in V$, then the lifts of $f\alpha$ and $f\beta$ starting at $z_0$ end in the same slice of $U$ in $Z$. (this is equivalent to the continuity of $\tilde{f}$)
For arbitrary spaces, this is about as good as it gets. Without more conditions on $X$ to control how paths vary with respect to their endpoints, there is no way to get around having to deal with how the given cover lifts paths. There are some conditions that do provide insight for some non-locally path connected spaces.
Here is a sufficient condition which generalizes local path-connectivity:
Suppose $(PX)_{x_0}$ is the space of paths in $X$ starting at $x_0$ with the compact-open topology and $ev:(PX)_{x_0}\to X$, $ev(\alpha)=\alpha(1)$ is endpoint-evaluation.
Theorem: If $f_{\ast}(\pi_1(X,x_0))\subseteq p_{\ast}(\pi_1(Z,z_0))$ and $ev:(PX)_{x_0}\to X$ is a quotient map, then $\tilde{f}$ exists and is continuous.
For a proof, see Lemma 2.5 and Corollary 2.6 of
J. Brazas, Semicoverings: a generalization of covering space theory, Homology Homotopy Appl. 14 (2012) 33-63.
The proof doesn't require local triviality. To see an example of this generalization in action, consider something like the suspension of a non-discrete, zero-dimensional space (like the Cantor set). Such a space is not locally path connected, but the evaluation map is quotient so lifts are guaranteed to be continuous. The endpoint-evaluation map is not continuous for Zeeman's example that ACL mentions showing that there is not going to be a nice characterization for all spaces.
Comment: This is basically what I was looking for, thank you. One more question. Are there any sufficient conditions for the map $ev$ to be quotient?
Comment: I used a sufficient condition in that paper which is a little easier to check (I have called it wep-connectedness in a few papers for a space having enough "well ended paths"). A path $\alpha:[0,1]\to X$ is well-targeted if for every neighborhood $U$ of $\alpha$ (in the compact-open topology of $(PZ)_{z_0}$), there is an open neighborhood $V$ of $\alpha(1)$ such that for every $v\in V$, there is a path $\beta\in U$ with $\beta(1)=v$. Now $Z$ is wep-connected iff for any point $z\in Z$ there is some well-targeted path $\alpha$ from $z_0$ to $z$.
Comment: It turns out that this property of $Z$ does not depend on the choice of basepoint $z_0$ and it's a straightforward exercise to show that it implies $ev$ is quotient.
Comment: @JeremyBrazas Can you edit the above? \tilde{f}: X to Z,\ and f_*(X, x_0) \subseteq p_*(Z, z_0) I think are what you meant.
Comment: A necessary and sufficient condition for $ev$ being quotient is given in Lemma 6.2 of http://www.tac.mta.ca/tac/volumes/30/35/30-35.pdf
Answer: If every cover of $X$ is trivial, then the lift does exist.
The example of Zeeman presented in pp. 258-259 of Hilton-Wylie's Homology Theory: An introduction to algebraic topology makes me doubt that a more general (usable) sufficient condition can exist.
Comment: I think Zeeman's example rather suggests there is no reasonable condition that works for all spaces. The one I give in my answer is not just more general but is actually quite useful. It was critical in the proof of a general Nielsen-Schreier theorem for topological groups (open subgroups of free topological groups are free topological), which had been a long-standing open problem in the theory of topological groups.
Answer: I feel it would be difficult to deal with non locally path connected spaces and covering spaces, though I may be wrong. However the existence of a covering map $f: X \to Y$ implies certain local conditions on $Y$; these are usually stated in the case $f$ is a universal cover, but the more general case is in Chapter 10 of Topology and Groupoids,  Section 5,  as that $Y$ is
"semilocally $\chi_f$-connected",
which means that each point $y  \in Y$ has a neighbourhood  $U$ such that for all $x \in X$ with $f(x)=y$ the image of $\pi_1(U,y)$ in $\pi_1(Y,y)$ is contained in the image under $f$ of $\pi_1(X,x)$. So to get a lift of $p: Z \to Y$ to all possible base points you seem to need a similar condition on $Z$ and $p$.
The proofs in above the book go by modelling covering maps of spaces by covering morphisms of groupoids. This modelling seems to me particularly convenient, as against the usual modelling in terms of actions of groups,  when considering lifting of maps.

Lifts across covering maps


Using Automation, is it bannable?

Question: The latest steam summer sale game is just a glorified "cookie-clicker" game. As such I've seen users post about being able to automate the clicks and effectively cheat in the game, does anyone know if users who do this will be banned?
Comment: Given how little difference this will make, you're only 1 of 1000 players, probably not.
Comment: I've tested it and the best I can do is 50 click per second. I figure even a super fast person would be lucky to get 10, so with a simple program you have the impact that 5-10 other people would. If everyone or a majority used it, it would certainly cause a large discrepancy. But seeing as how there aren't any rewards for killing things faster, (or there don't seem to be) there's really no purpose to this other than to cheat for the sake of cheating. After testing it myself, I didn't notice anything strange on my account, so probably not is right.
Answer: Valve works in strange ways when it comes to bans, so I can't authoritatively say if you will or won't be banned for "cheating" at the game.  They've taken a hard stance at times, but ignored other flagrant, profitable cheating avenues in the past.
That said, there is absolutely no reason to cheat - there are already built-in ways to automatically do damage, and there's doesn't appear to be anything tangible as a reward for doing more clicks yourself.
If we balance the risk (unknown) against the reward (nonexistent) it seems pointless to take the chance.
Comment: I can't help but laugh at "no reason to cheat". With an autoclicker you'd get easily 20-30 clicks/second and since the damage of both trees is similar that's a lot more damage. And that's not considering the whole raining gold thingy that will make most of your income.
Comment: @Zibbobz Gold isn't the winning strategy, neither is clicking. The Wormhole and Like New items are what get you to absurdly high levels. http://gaming.stackexchange.com/a/224150/
Comment: "no reason to cheat", the maximum badge is level 100,000,000. The only practical way to get this is using WH strategy (as mentioned above) for _many_ hours. In other words, Valve knows about the bots and has made the maximum reward only practically obtainable this way.
Comment: @meneldal I suppose we can agree to disagree - I just started today's game, haven't clicked once, and we're gaining around 1,000 levels every 5 minutes.  Raining Gold doesn't make any kind of dent in my gold reserves.  I don't really see the need to click.
Comment: @agent86 Multiple Raining Gold power-ups on a boss produces an absurdly high amount of gold (~+52,000 per click per active raining gold), far more than you can gain through idling and collecting gold drops. Stacking them together as a team is the fastest way to gain gold, and the faster you can click, the more gold you can get.  In fact, it's part of the winning strategy. http://gaming.stackexchange.com/a/223694/55285
Comment: The WH thing only works if the team is coordinated which doesn't happen in random games. In this case, raining gold is the only thing you can do.
Answer: It looks like Valve doesn't care if player cheat like this. People from Reddit have been using scripts to play the game in order to achieve seemingly impossible levels. Their scripts managed get them what is apparently the highest level possible in the game, level 100,000,000. Instead of banning them, Valve rewarded them with a new badge:

Using Automation, is it bannable?


Enlarge the component Name field in Tridion component creation

Question: Enlarge view window for Content Name Field When viewing the "Name" field in Tridion, it shows a limited amount of space, whereas there may be a much larger amount of content to viewenter image description here
Comment: is it strange when I ask what exactly the question in this is? I can't really place a question mark on the end of your sentence, so I might be missing what you are really asking for.
Comment: Which solution did you go with?
Answer: First - this isn't a description of the component. This is the name/title of the component and is used in various lists etc.
Name

For naming the components I would generally recommend that you use a sense of brevity in the editor displayed name in the first place. When there are 20 of these components in a list you are going to have issues with seeing through the clutter. Additionally I would suffix the name with a 'standard format' for the schema name/type

xyz landing page - (article)
xyz marketing spot - (spot)
xyz marketing spot container - (spot container)

You could, as John says, work on a GUI extension to expand the width but

in this case, you're still restricted with the width of the user browser/screen
if you use multiline your GUI extension starts to become more complex having to deal with line breaks etc.
you could have an extension to simply add the full name (if the editors insist on such detail in a name) set as the 'Title' attribute so they can just hover and see the full value.
I see also just updating the CSS (in a supported way) would allow you to horizontally expand the width

Using a Description
The simplest - would be to add an 'Internal Description' field as the first field of the relevant schemas. This would allow as verbose a description as you choose.

[update] This last approach may seem excessive at first (this was put to me in an offline discussion) but I've seen this to be useful where the schema concerned contained technical content - often passed in as copy and paste from another team/other teams (e.g. JSP tags, JS, CSS etc.)
Answer: If you'd like to enlarge this you could look into a GUI extension to inject some CSS to change the appearance of this text box, there's plenty of examples out there.
I'd recommend to keep these names as short as possible as the name of the item used within the WebDAV path of the item and there are limits to these paths within Windows.
Answer: Name field is Self-explanatory. This field should be used for naming purpose.
Name — the name of the Component. Users will see this name in the folder where the component is created. Ensure that the name of the Component easily identifies. For example, "ABC Article"
You are trying to use Name field as either Description/Body content field.
Answer: The default width of the Name text box is set by the the CSS of the Content Management Explorer (CME) interface.

If you are dealing with Components that have extra long names, then you could consider writing a Bookmarklet to update the width of this field when necessary. You may want to look at something like this Changing pages with bookmarklets article.
Alternatively, you could amend this within the applications CSS file, but I would advise against this, if possible.


How can I limit the number of error messsages displayed after compiling a C++ program?

Question: I am compiling a C++ program with g++ and each time get a huge number of errors, forcing me to scroll up every time I want to view the first (and most relevant) error. I am wondering if there is an option when I am compiling the program that would allow me to limit the number of error messages displayed in the terminal.
Comment: How are you compiling it?
Comment: It seems that you are asking about IDE.
Comment: g++ -std=c++11 main.cpp
Answer: You can use option -fmax-errors=1 to set the number of errors to 1 and so on. The default 0 is infinite. The gcc option applies to g++.
Answer: You have several options:

Use compiler options to set a limit on the number of error messages before the compiler just gives up completely, as in another answer.
Use head, remembering that error messages are sent to standard error of course.  Or use one of the many tools floating around that post-process GCC output.  Also remember that with modern versions of GCC that have adopted the clang model a single error can span several lines, so low line counts for head might not be very useful at all.
Use a paginator such as pager, pg, more, or less, again remembering that error messages are sent to standard error.
Run the compilation command in a :terminal within NeoVIM, which provides quite a lot of scrollback, and of course all of the usual VIM navigation key sequences for quickly going to the top of the output and searching.
Integrate with your text editor.

The latter is the most interesting option.  It comes in at least two flavours:

Write the standard output+standard error of the compiler to a file and tell your text editor to treat it as an errors file.  With Vim and NeoVIM this is done withvim -q errors_file and nvim -q errors_file where you can substitute the name of your choosing for errors_file of course.This will open the text editor with the errors file loaded into the quickfix buffer, and the file for the first error or warning message opened and positioned at the line number (and column) of that error.
Run the compiler from within one's text editor.  With Vim and NeoVIM if one has a makefile one can invoke it with the :make command, and VIM/NeoVIM will put the error output from running make into a quickfix list, again automatically positioning at the file, line, and column of the first error or warning message.

With both of these, one can of course move from the location of one warning/error to the next using :cnext and the various other Vim/NeoVIM quickfix list navigation commands listed at :help :cc.  Note that there's no reason to limit the number of errors with these mechanisms, and there are Vim/NeoVIM commands to return to the position of the current message, or go back to the position of the first message.
With the latter specifically, one can also run :make multiple times and change back and forth between older and newer error lists using :colder and :cnewer.  (One can additionally change :make to run something other than make, using set makeprg, more of which in the VIM/NeoVIM manual.)
One can do similar things with emacs.
Answer: Use compiling-command | head --lines 32 to output first 32 lines from compiling-command output.
You can also use compiling-command | grep "Text to search" | head --lines 32 to display first 32 finds of "Text to search".
Disabling -Wall option with gcc will not output as many errors.


Moving along the path - strange rotations

Question: I would like to make an opening gate composed of segments. All segments except the lowest one work fine. The lowest, unfortunately, performs strange rotations when moving along the path. I tried adding new mesh, new empty's, extrude new bone. No good result. I'd appreciate a hint as to what I'm doing wrong. Link to the video on YT
Comment: Please share your Blend file via https://blend-exchange.com/ following the instructions there to add the link into your question.
Comment: Link to file: [](https://blend-exchange.com/b/zNjLjY9r/)
Comment: That's very odd! I'm no expert on animation but the only difference I can see between that section and all the others is that the bone roll of the bottom bone is 90° and all the others are -90° but changing that bottom one to match the others makes no difference.   I don't know if anyone else here has an answer now that the blend file is available?
Comment: Hello, you didn't share the link to your file, only a jpg image, please share the link  ;)
Comment: I corrected the link :)
Answer: I'm still not sure what's gone wrong with your file, but here is a much easier solution:

Run the animation to see it in action.
If you want a different texture on each panel you can apply the array and everything will still work. (I've moved the top front edge of the panel down slightly to show the gaps between panels.)
Comment: Your solution is beautiful BUT will I be able to export this fbx with animation to Unity? I assumed that bones would be needed for the animation to work properly in Unity.
Comment: I'm afraid that I've no idea about any other software. I only ever use Blender here. Maybe someone else can give a solution to your original problem (hello @moonboots)?
Answer: Okay, I found the problem. All empty had to have a location applied, which I didn't. Now the gate opens properly :)
Comment: Ah! Yes they would need that. I thought I'd checked those. :^(


Difference in cookie texture if we use melted vs softened butter

Question: I would like to know the difference in the final result if we use softened butter or melted butter in an ordinary cookie recipe.
A few days ago i baked chocolate chips cookies i waited for the butter to get the room temperature and then i smoothed the butter with the mixer (...) and at the end i put the cookie dough in the frighe. I just wondered what if i melt the butter so i will not have to wait for the butter to get soft, anyway i will put the cookie dough in the frighe later. But what will change? Some recipes demand for butter in room temperature softened and to turn sugar and butter mixture into a fluffy outcome. Some other recipes demand to melt the butter and sugar in low heat.
What is the logic behind what each recipe demands? And why?
Comment: See http://cooking.stackexchange.com/questions/1/how-can-i-get-chewy-chocolate-chip-cookies
Comment: There are many questions & answers on getting optimum results for chocolate chip cookies but your question is about the difference between a soft butter cookie and a melted butter cookie so for that I'm upvoting your question.
Comment: Melted butter super-cools before it freezes, just like olive oil in the fridge. The liquid is far more reactive with other recipe components than the solid.
Answer: There are many factors in play such as the type of sugars, amount of eggs or other sources of hydration, amount and type of leavening and so forth, but as an overall generalization:

Melting the butter will lead to chewier cookies
Creaming colder/room temperature butter with sugar will lead to cookies with a higher, more cake like texture.
Refrigerating the dough before baking will help inhibit spread because the butter is colder, and takes longer to melt.  It is also gives time for the liquid in the recipe to hydrate the flour.   See What does an overnight chill do to cookie dough, that a 4 hour chill doesn't?

See the transcript of Alton Brown's Three Chips for Sister Marsha episode for a good treatment of chocolate chip cookies and their variations.
Answer: My experience is that every cookie I've baked that has a base of:

softened butter

white & brown sugar

egg

baking soda

flour
(which are most chocolate chip recipes), melted butter (or even too soft, almost melted butter) will result in very flat, almost toffee-like cookies.  Not that they're bad, they can be quite tasty if you can get past the look of them (like a lunar landscape).

I'm sure there are others on this site that can give the exact chemical and molecular reason for the need for softened, not melted butter, but from my many years experience as a cookie baker, that is my observation.
Comment: The exact reason is that leavening does not create new bubbles in dough, but increases the ones made by creaming butter with crystal sugar. If you use melted butter (or powdered sugar), you get non-leavened, chewy cookies despite including baking powder. And yes, there are recipes for those too, and they do indeed prescribe melted butter.
Comment: @Felissa - glad to help - good luck with your cookies! :-)
Comment: Thanks @rumtscho!  I knew you'd be at the forefront of the experts!  Excellent explanation.  I've made many varieties of cookies over the years, including those with melted butter, and there's a beauty and uniqueness to each of them, for sure.
Answer: I did my science research project on this and found that the softened butter will result in chewier, and smaller cookie than with melted butter. The cookie with melted butter will also be thinner. I also figured out that if you use double the melted butter you get a WIDE, thin, and crispy cookie and with half the butter you get a small, chewy, and what I found very appealing to most people in taste, texture and appearance.
P.S.
I used the toll house recipe without nuts and with choc. chips.
Answer: If we are using melting butter in cookies then the cookies will become chewer in taste.There are some ingredients that are used while baking cookies to make them perfect in taste and texture.These are baking powder,softened butter,egg,brown sugar,white sugar.
Comment: But in what proportions?
Answer: I just made two batches of chocolate chip cookies. One recipe had butter creamed at room temperature and the other had melted butter. The ones with the melted butter were noticeably chewier. Both batches are yummy. We prefer the melted butter.