Xcode programming

Question: I wrote my programs in Visual Studio. now i have an mac and i want to program there like visual-studio. but there are differences between them. Is there any solution that i can write a code in Xcode that it is compatible in Visual Studio and works without any errors?
Comment: Unlikely. Apple supporting anything but Apple products? Ha.
Comment: @Finglass Of course, I suppose you could write VS code that is compatible with Xcode, hmmm?
Answer:
Is there any solution that i can write
  a code in Xcode that it is compatible
  in visual-Studio and works without any
  errors?

Write standard portable source code. Xcode uses the GCC toolchain, VS uses MS's cl compiler. They are different. Xcode does have the notion of projects and solutions and allows configurations. However, they are a bit complicated (so beware). Also, the Xcode debugger is buggy and the editor is not as feature-rich as the VS2005/VS2008 IDE.
You can build Cocoa/Carbon based applications on Xcode but these won't compile/run on VS. Similarly, you can build Win32 applications on VS which won't run/compile on Xcode.
All in all, Xcode is your best shot at an IDE if you're not a vim/emacs fan.
Answer: You can easily write portable low level code in C/C++, but any GUI code or code which calls the OS will be non-portable.
Answer: Java would be also a good solution for platform independency. NetBeans would be my choice.
Comment: The question relates to using vs editor to create xcode, not what platform am I going to use
Answer: Would in theory be possible to have a vs template so you go project structure and intellisense then when you build have a build script export to the mac or source repository then build on mac
Either way Xcode needs to be run on a Mac.
Answer: You can use Mono and MonoDevelop, then the programs you create on Mac can run on Windows also. I use Visual Studio on my job, but my spare time I like to play around with mono on my mac. http://www.mono-project.com/

Xcode programming


What are the pros/cons of installing floors before doors?

Question: I've heard contractors say to install doors first then flooring, and others suggest the opposite. I'm installing new 3/4" prefinished flooring and new doors/closets (prehung wood/ primed white). What are the advantages/disadvantages to installing the doors after the floors? What sequence would result in the best finish?  Thanks
Comment: I decided to put in the doors first upon a strong recommendation from my carpenter. He said the risk of scratching the floors is high, despite best efforts. I'll report back how it goes
Answer: I like to put the flooring in first. If you're working on the last row against a wall with a door in it, and you have to cut a piece that's half strip against the wall for half its length, and a full strip in the doorway, it's easier to get it into place if the jamb isn't in the way. It also means you can get the fit better at the  bottom of the door jambs, without needing to use a flush-cut saw to trim the jamb before you can fit a floorboard under it, or ending up with a gap between the jamb and the floorboards.
As far as cons, I guess putting the doors in first means less activity in the room once the floors are in place, and thus less risk for dropping a hammer and marring  the floor, or tracking dirt across the finished surface.
Comment: The cons can easily be overcome with a few sheets of masonite to protect the floor around the work area. Same goes for tile and even linoleum.
Answer: Sounds like carpenters don't like doing things the difficult proper way of a construction schedule. All I here is it's harder for a carpenter to install doors after floors are installed. It's human nature to seek the easier softer way, but it only makes common sense that you install floors first then have a skilled carpenter to put door frames on top of floor, then trim around door last. Cover floor for protection where needed. In a sandable floor, no cover needed
Answer: Theres one good reason to install the doors first and that is if your floor is not level across the threshold (almost always off by some factor in my house). Before the floors go in you can easily shim one end of the jamb to get the door exactly plumb. After floors this would be a huge pain to do since you would need to pull the door out and saw the jamb. Also, maybe others are more careful but I found it's hard not to ding the floor a little bit when doing doors afterwards. I also like a very tiny gap between the floor and jamb to slide paper under when painting which saves a ton of time. The person who installed my floors used a proper tool (not a trim saw) and cut the jambs very precise
Answer: I'd agree with the above poster. I've been installing doors before flooring, for thirty years. Painting, that's the biggest reason because after doors comes paint.. because who cares where the paint drops land before flooring? Installing flooring first is easier for a flooring guy, but you try getting 1/16" door margin over 3' and keep the jamb leg on the floor. You almost always need to raise the jamb to compensate for an even margin, otherwise you're fumbling around on a finished floor trying to cut 1/16 of an inch of a door jamb upside down. Experience is the greatest teacher. I've never seen flooring go in first in a new construction job my entire life.
Comment: Welcome to [diy.se]. I'm sure you noted that this question is 11 years old, however, good answers are still good answers. You'll also note that there are a couple of options for sorting answers, one of which is by votes which means that even that sort order can change. If you want to refer to a specific answer, mention the author or include the [share] link, because "above" is meaningless here. Also, please take a few moments to take the [tour] to get a better feel for how this place works in general.


Electrochemistry - reduction potentials - an IB Chemistry Question

Question:

I have re-read the Electrochemistry chapter from my textbook just now to remind my self of the exact formulae. I still don't understand how to approach this question, however - how can we work it out? I can either give you the mark scheme answers straight away and we can work backwards, or I can wait for an answer and then tell you if that is the correct solution. What ever is the norm on this forum! Thank you.
Comment: The norm on this Q&A site is for you to show what you have tried (or are stuck on) and then help may arrive. No one is just supposed to post an answer to a homework problem or the like.
Comment: @ Ed V - thank you for the clarification. As I state above, I have re-read the electrochemistry chapter in my textbook. So I know how to calculate the standard cell potential from individual reduction potentials. However, I have never come across this type of question before and so cannot offer any suggestions. I am happy to do some extra reading to find out, but didn't know what to google as, again, this wasn't something I had come across. If you could point me in the right direction, that would be very useful. Thank you.
Comment: This is a pair of puzzle questions. For the first question, you need a voltaic cell with positive potential, so the reaction would be spontaneous, with the second half reaction in the top table being the cathode reduction. Now which of the 5 half reactions in the bottom table would make a viable anode oxidation reaction? Maybe several of them. But then you narrow the choices by using the reduction half reaction in the first line in the upper table. Think about it: it is mostly a logic problem, not chemistry per se.
Answer: First put your redox potentials on a horizontal line by order of increasing standard redox potentials. You will see that it starts on the left-hand side by $\ce{Zn^{2+}/Zn}$ at $\pu{-0.76 V}$. Then, going to the right, you find $\ce{V^{III}/V^{II}}$ at $\pu{-0.26 V}$. Now you find $\ce{Pb^{2+}/Pb}$, and so on.
Now try to learn how to use this scale. The reduced species of any couple can react with any oxidized species of any couple situated to its right. For example, $\ce{Zn}$ is the reduced species of the couple $\ce{Zn^{2+}/Zn}$. So $\ce{Zn}$  can reduce all oxidized species, and for example all oxidized forms of Vanadium ions. But $\ce{Zn^{2+}}$ cannot be reduced, because there is no reduced species at the left hand side of $\pu{- 0.76 V}$.
On the other end of the scale, you find $\ce{Cl2/Cl-}$ at $\pu{+1.36 V}$. Hopefully you admit that $\ce{Cl2}$ can oxidize all reduced species, and $\ce{Cl-}$ cannot reduce anything.
Now let's consider $\ce{Pb^{2+}/Pb}$, at $\pu{-0.13 V}$. $\ce{Pb}$ can reduce all oxidized species situated on the positive side of the axis, for example $\ce{VO^{2+}}$ which is at $\pu{+0.34 V}$. But it cannot reduce $\ce{V^{3+}}$ to $\ce{V^{2+}}$, because $\ce{V^{3+}/V^{2+}}$ is on tis left-hand side. And this is exactly your first question.
Now think a little bit about how to solve the second question. It is exactly the same approach.


Raspberry Pi 2 not booting connected to network

Question: I bought the Raspberry Pi 2 last week. When booted without Ethernet cable plugged in it works fine. When I connect the cable to Ethernet port on Pi, it simply does not boot. The lights below Ethernet port will be on.
Comment: You should include a description of what you mean by "does not boot".  If there's a problem, the green ACT light will blink repeatedly in a regular pattern (e.g., 7 blinks, pause, 7 blinks, pause...).  If it just blinks twice, ostensibly it *did* at least boot the kernel, in which case you should get some output if you plug in a monitor.  This will provide a clue.  If the ethernet lights are on, almost certainly the kernel did boot because that requires an OS to work.
Comment: What are the power and act lights doing (red and green)
Answer: That is most likely a power issue. Check that your supply is giving at least 5v@700ma. I would recommend more current. Depending on what devices you have attached you may need a power supply with a current rating of 1 amp or more. Also, sometimes those adapters have faulty and misleading labels. If you have a multimeter check the two test points to make sure the right voltage is getting to your pi.
Answer: The problem I had was the eth0 device being set to "auto", if that is changed to "allow-hotplug" it will boot without eth0 being connected.
Edit /etc/network/interfaces to make this change.


Recommended example applications written in Ember.js

Question: Which recent, public, medium-sized Ember.js applications do you recommend for learning about usage patterns by reading its implementations?
Answer: I'd recommend the Travis CI project - it uses Ember on the client side and Rail 3 on the server.  While it doesn't use the latest Ember features it has very good foundations.  You'll find the client-side code in a separate repo travis-web.
I also found reading through @ebryn's "New Twitter" helpful although it is older (Sproutcore 2) and smaller/simpler than Travis CI.
Update: Ember has gone through a number of big changes leading up to their 1.0 release so a lot of older example apps use deprecated APIs and are no longer representative of best practices.  A new example to check out is Discourse (https://github.com/discourse/discourse) a large webapp built by Jeff Atwood and Robin Ward.  Also, check out @trek's Ember Todos, a version of TodoMVC with a touch more process (https://github.com/trek/ember-todos-with-build-tools-tests-and-other-modern-conveniences)
Comment: Discourse is a great app to look at Ember features, however, their codebase uses lot of the old features in emberjs. But they do work perfectly
Comment: For Emberjs & Laravel learners, [Exyht](http://exyht.github.io/exyht) could be a good example.
Answer: I recommend the ToDoMVC project, which offers the same Todo application implemented using MV* concepts in most of the popular JavaScript MV* frameworks of today. Now ToDO MVC ember.js example adapts ember.js 1.0.rc1.
The website: http://todomvc.com/
The source: https://github.com/addyosmani/todomvc
Answer: Emberwatch has an Open Source Category with a list of interesting projects.
Answer: I recommend the http://www.embercasts.com/episodes/client-side-authentication-part-1 great to start with authentication.
And also it from smashing magazine http://coding.smashingmagazine.com/2013/11/07/an-in-depth-introduction-to-ember-js/
a good exercise is to put those apps to work in http://iamstef.net/ember-app-kit/ that has the current releases


rescue data from partially overwritten ntfs partition

Question: I accidentally overwritten part of my ntfs partition with image of another partition using dd if=diskimg of=/dev/sdaX. I canceled it immediately, but unfortunately about 200MB was already written. I'm copying accessible data now, but some directories (most notably directory containing my desktop and documents) are empty. Is there a way to recover files in those directories that haven't actually been overwritten and are only inaccessible?
Comment: No; You already overwrote the data.
Comment: Not all of them, some are still intact. Unfortunately most of the data missing is the data I actually need whereas the data that's still intact is mostly old data I don't really need anymore.
Comment: You can try Recuva ==> https://www.piriform.com/docs/recuva/advanced-usage/running-recuva-from-a-usb-drive
Answer: I did the exact same screwup as you did, overwriting the boot sector, the partition table, and a large portion of the data partition.
The good news is that I managed to salvage most of it. I didn't know of any tools to do this in linux, which would have been preferable, other than dd + grep, but a friend gave me a tip about this tool. It scans through a harddrive for data resembling files, ignoring conveniences such as a file allocation table, or even a partition table. It then allows you to extract said data either one and one manually, or in bulk automatically once detected.
The bad news is that it's not free software, but I can confirm that it works as advertised.
Comment: Sadly after reboot I can only see `System volume information` folder from linux. But I'll try again from windows.
Comment: After trying to recover a NTFS-Partition overwritten by a 400MB Linux-image, I tried recovery with testdisk and gpart to no avail. GetDataBack didn't give any results either, but with R-Studio I was able to recover the files (Not the original folder structure though, and a lot of useless files it appears to have made up from the fragments).


C++ unit testing with VS test professional

Question: Does any one know if I can test native code in VS Test 2010?
Comment: Can you define native code more explicitly?  Are you talking about C++ code where you have the headers and the libraries, the source code, or ...
Comment: You should ask at http://stackoverflow.com/
Comment: @Ian C. I did and so far no one answered
Answer: As of VS2010, native C++ unit testing is not directly supported by Visual Studio.  See MSDN, specifically:

You cannot have test projects with unit tests that use unmanaged C++.

You can still do native C++ unit testing with Visual Studio, but it won't be as integrated as other VS features.  See this SO answer for a number of native unit testing frameworks and libraries.  I have not used any of those, so I cannot give any guidance there.
Answer: I would bite the bullet, download Boost and get the test suite compiled.  Once you get into it, it's as easy as VS tests.
Comment: Or if you don't want to pull in boost (which is great BTW) go for UnitTest++.


Swing application multiple threads sharing data and creating evemts

Question: Currently I am working on a Swing application in Java. Lets call this program Simulator. My task is to
deliver packages to their destination by trucks. I have a thread which calculates scheduling of the trucks(which package when to deliver).This thread can run in some cases very long. In a second thread(calculator thread) I am calculating the step of simulation. These two threads should communicate with each other. The algorithm thread sends  plans and trucks to the calculator thread and  calculator thread sends back free trucks to the algorithm thread. The simulation ends when the calculator thread ends its work. My question is related to drawing of the simulation. Where should  a call the drawing of the components? In the same thread where the steps are calculated? Third thread for drawing? Any other possible options?
Comment: Use `SwingWorker`, seen [here](http://stackoverflow.com/search?tab=votes&q=user%3a230513%20swingworker).
Answer: Yes, I'd use a separate thread for drawing. Do the drawing you need in an infinite loop then call Thread.sleep(1000) to make it update approximately once a second.


Discount for category and its subcategories

Question: For example I have:

Mobile -> Apple
  Mobile -> HTC
  Mobile -> Nokia

I want to give 5% discount for all product in these categories.
Is there any way to do it without creating a catalog price rule for each of them without explicit list?
Comment: Maybe it works, if the parent category is anchor. If this doesn't work I don't see any option beside a list of categories, except using any other thing to identify the products, like a sku(prefix/suffix), special attribute, whatever...
Answer: If it would be acceptable to write a single rule then you can simple do this using the condition:
Is One Of

This will allow you to select multiple options for a single product attribute. In this case you can selected more than one category.
The following screenshot should help:
Comment: Couldn't you add the products to the parent category "mobile" as well and then use one rule for this category?
Comment: Yes it is posible. But before Tim edited my post, my question is: "Is there any way to do it without that I enumerated them all?"

You post is way but too hard if i have about 1 000 categories.
Comment: @MiMo, sorry, fixed the initial question.
Comment: Ah I see, I did think it was a bit easy :)
Answer: Here is a dirty hack for it, but it should point you in the right direction to do this cleaner (i.e. in its own extension).
Add this piece of code in Mage_Rule_Model_Abstract::_beforeSave before the // Serialize conditions part (around line 105);
$totalSubCategoryIds = array();
$conditions = $this->getConditions();
foreach($conditions['conditions'] as &$condition) {
    if($condition->getAttribute() == 'category_ids') {
        $categoryIds = explode(',', $condition->getValue());
        if($categoryIds) {
            $categoryIds = array_map('trim', $categoryIds);
            if(count($categoryIds)) {
                foreach ($categoryIds as $categoryId) {
                    $category = Mage::getModel('catalog/category')->load($categoryId);
                    if ($category->getIsAnchor()) {
                        $subCategoryIds = $category->getResource()->getChildren($category, true);
                        $totalSubCategoryIds = array_merge($totalSubCategoryIds,$subCategoryIds);
                    }
                }
            }
        }
        $totalCategoryIds = array_merge($categoryIds, array_unique($totalSubCategoryIds));
        $condition->setValue(implode(',', $totalCategoryIds));
    }
}

It will automatically search for all subcategories for all of the chosen categories and it will add those to the list, so you won't have to click all of them (particularly handy when you have a lot of subcategories).
Answer: You can alter the method Mage_CatalogRule_Model_Rule_Condition_Product::validate which is in charge of checking the rule.
With a nice rewrite you can do :
public function validate(Varien_Object $object)
{
    if ('category_ids' == $$this->getAttribute()) {
        return $this->validateAttribute($object->getResource()->getCategoryIdsWithAnchors($object));
    }

    return parent::$this->validate($object);
}


How does choosing Imperials or Stormcloaks affect me later in the game?

Question: I went with the Stormcloak guy when we were running from the dragon. I was just wondering how this will affect me later on?
Comment: The beauty of the choices in Skyrim is that they are *difficult*. All factions have their heroes, their cause, their good deeds, their hidden agenda, and their skeletons in the closet. You can hardly judge a large organization by the actions of a single, rather low-ranking person. Also, if you side with the guard, the Stormcloaks attack you unprovoked shortly after that. They're no better.
Comment: Is this supposed to be Stormcloaks or the Imperial Legion? Or did I just step into a Star Wars/Skyrim mod question?
Comment: The Stormcloaks *are* rebels, and the Imperial Legion serves the Empire so... George Lucas eat your heart out.
Comment: You should join the Rebels, because in the beginning you were not on the death list and the Imperials wanted to cut your head off along with the others anyway. So, kill all the Imperials.
Comment: How do you square Ulfric's murder of the prior king?
Answer: The choice between Stormcloaks and the Imperials is supposed to provide a little more immersion in the story: you choose a side, and while both sides have comparable quests, they take on a different flavor and will have different actors.
To this end, both the Imperials and the Stormcloaks have and 11-part quest chain concerning the Civil War that ravages Skyrim. The first few quests are almost identical, but then they branch off as each side wins (or loses) major fronts in the war.
And in general, choosing one side or the other makes things easier for you if the side you chose is in power.
For example, if your side controls a major city, you generally don't have to do any special favors for the Jarl in order to get permission to buy a house: it'll be given as a gift for siding the cause.
But the Elder Scrolls series is all about choice, and you're not going to be limited much by what side you choose. Choosing the side you most identify with will generally work out just fine.
But fear not, you didn't make a permanent choice when you went with Ralof (the rebel). You'll be able to play both sides until the last possible moment. You don't seal the deal until you swear an oath to either side by going to their stronghold city.
Additionally, there's one more chance to switch sides during the civil war:

 During The Jagged Crown, bringing the crown to the opposing side's leader will let you turncoat and join the other side.
Comment: @StuartPegg I believe guard NPCs will occasionally suggest you join the Imperials.  Then, that will show up as a quest option just like the Stormcloaks quest.  If you want to jump ahead of this, go to Solitude and speak with General Tullius.  More details here:  http://www.uesp.net/wiki/Skyrim:Joining_the_Legion
Comment: Sorry to question-on-question, but where do you pick up the Imperial quest chain if you followed Ralof?
Answer: If you're choosing the stormcloaks to ally with be sure to do the main quest "alduins wall" before fully committing to them, otherwise Delphine of the blades will become your enemy thus making the "alduins wall" quest impossible to complete.  I learned this the hard way.
Comment: thx vm, I will wait! any more tips? may be now in 2013 something has changed?
Answer: From what I've seen it doesn't affect it much/at all.
I've started 2 chars, one went with imperial and one with stormcloaks, the only changes I've seen so far is that when (whoever you're with) says we need to split up they both give you a quest, and it's to talk to a different person in Riverwood, if you go with imperial it's the blacksmith and he will give you some free items and limited info (and you find the imperial guy there, gives some more info but not much else) if you go with stormcloaks it's someone else in the village, gives you some free gifts as well but limited info. I'm guessing you can find the stormcloaks guy later in the game, but I don't think it affects anything beyond the first village.
Comment: Geldur is the Stormcloak contact, and the smith's called Alvor (just to complete the info).
Answer: The only thing I've found that is impacted is that if you pick Imperial:

 you will not be able to buy the house in Windhelm until the main quest is completely over.

Learned this the hard way.


Is there a word to describe the combination of a table and a chart together?

Question: Is there a single, succinct term in English that would describe the grouping of a chart/graph and a data table displayed together in one place?
Comment: See LINKED sidebar also [.](http://english.stackexchange.com/questions/164198)  [.](http://english.stackexchange.com/questions/195011)
Comment: Why would one in the audience related to the problem this question solves (what? this doesn't solve a problem? Or, what problem does the question solve?) consider the graph and data separate entities requiring a unifying label that wouldn't be understand by the graphic figure name?
Answer: There isn't a word that specifically refers to the combination you mentioned. You can probably get by with referring to it simply as a chart, but "figure" would be more appropriate in academic writing. "Infographics" may include charts and data tables, but the word itself refers to the final graphic presentation (usually pretty fancy) and not the grouping of different information representations.
Figure: "graphs, diagrams or illustrations/images" (Source: Birmingham City University)
Infographic: "graphic visual representations of information, data or knowledge intended to present complex information quickly and clearly" (Source: Wikipedia)


A DIY Power supply system for a 150w high power led engine

Question: I have this SST-300 High-power LED which requires 10A and 12-14V as described in the product characteristics. The product is suggesting with its own power supply as well as its own constant current led driver which comes as a separate unit from the supply. however, i would like to make my own power supply system for this one, for budget porpuses.
So im thinking of buying one of those 'led strip supply' of 10A and 12V which gives a 120w (lesser than the maximum led power which is 150w) and make the current that comes from the supply even more stable and free of harmful spikes, using this "600w 8-16V 12V 24V to 12-60V 48V boost converter", even for the price of losing some few watts.
Should it work that way? there are any calculations i need to take in account?
It will be nice to get your help. Thank you!
Comment: What calculations could you take into account with equipment from AliExpress and no data sheets?
Comment: The 12V supply used directly with the LED will probably 'work well enough'. Either the LEDs will want less than I_Supply_max at 12V and so "just work. Or will try to draw more than 10A at 12V so need a small series R. At 10A every 0.1R will drop 1V so adding lead length may suffice.
Answer: The cheapo converter posted in the question will pop its output caps at 10A, they won't handle the converter's ripple current. No way. Be careful with these cheap chinese items, the specs are usually fantasy. Especially the "LM2596" ones, they're usually counterfeit chips.
Wiring a cheap converter at the output of a low quality switching power supply increases risk of trouble, and converting the voltage twice means more losses than using a simple offline constant current LED driver.
So, let's use an all-in-one constant current driver. These have an allowable output voltage range, and this must include the voltage range of your LED. Actual output voltage is determined by the LED, but it must be within the range allowed by the driver.
Your LED has a Vf of 12-14V at its nominal current of 10A, so you can't use a driver than is limited to a max voltage of 12V in constant current mode.
Thus, a Meanwell HLG-150H-15 is a good fit. It delivers 10A constant current with an output voltage between 7.5V and 15V, which is what you need. Get the -B version if you want it dimmable. It is not expensive and it works.
You will also need a fan, and I'd definitely recommend a thermal shutdown sensor on the LED. Heatsinks and filters tend to clog up with dust over time.
Comment: i found the datasheets of the power supply (google 's-120-12 datasheet') and i also got components names of the converter which are MBR20100 and 072N10N which both heatsinked, while the LM chip is "LM358 HLF108". in a brief look at the first two components's datasheets, it seems for me, that they can handle 12v at 10A, but of course, i need the answer from an expert.
For the HLG-150H-15, i searched a bit for a price and the price range is still a bit high for me, although i can buy it anyway. so my question is if are there any imitations of this supply that are even more cheap than this one?
Comment: Well, your power supply may work but 12V isn't the correct voltage and it is constant voltage, not constant current, so another converted is needed, which costs more and increases losses. Instead you can search for "AC-DC LED driver" or "offline LED driver" on aliexpress, you will find cheaper off-brand mains powered **constant current drivers**. Make sure the output voltage range includes the 12-14V range your LED requires, and that it can output the amps.
Answer: The 12V supply used directly with the LED will probably 'work well enough'.
Either the LED will want less than I_Supply_max at 12V and so "just work.
or
The LED will try to draw more than 10A at 12V and so will need a small series R. At 10A every 0.1R will drop 1V so adding lead length may suffice.


How to calculate mass of nanomaterial grown on a substrate

Question: I'm growing graphene on copper substrates and need to know the mass. The graphene is grown via chemical vapor deposition; amounts of reactants are not completely known. The best approach I've thought of is recording the mass of the substrate before and after using an analytical balance, but with the nature of the material being nano, this method may be elusive. What other method could I use to find the mass?
Comment: Is it a graphene monolayer? If so, then weighing will likely not work; monolayer graphene weighs [$\mathrm{0.8\ mg\ m^{-2}}$](http://www.graphenea.com/pages/graphene-properties). Also, does the graphene have to stay adhered to the copper? And to what precision do you need the mass to be determined? Do you know the shape/area the graphene layer has, or could you somehow mask it (i.e. measure the area covered in graphene and use the areal density to obtain the mass)?
Comment: It's [vertically grown graphene](http://www.oxford-instruments.com/OxfordInstruments/media/plasma-technology/SEMS/SEM%20Competition%20Entries/Vertical-Graphene-nanosheet.jpg). We're calculating specific capacitance using cyclic voltammetry. It doesn't have to be extremely precise; just enough to do basic calculations.
Comment: Oh, not at all the type of layer I had in mind. Quite a pretty image! Depending how tall and dense that graphene forest (coral?) is, weight may work. Unfortunately it's a rather irregular layer of material, so now I'm having a hard time thinking of alternatives. If a destructive method is allowed, maybe you can oxidize the carbon to $\ce{CO2}$ and measure that with, say, gas chromatography?
Comment: Ah, I don't think destruction of it is something we would be trying to do. And yes, I think its a great image. Wish it were mine.
Answer: One possible option for thin film thickness measurement is by Energy Dispersive Spectroscopy (EDS) in a scanning electron microscope (SEM).  There exist commercial packages for this such as LayerProbe by Oxford and STRATAGem (I have no financial interest in Oxford or SAMx).  If your campus/research facility has an SEM with an EDS (many do), but not a commercial package, you can still work it out yourself.  If I were tackling this in my own lab, I would probably do something along the following lines:
Option #1:
Obtain a spectrum from a known thickness of carbon on your Cu substrate.  This can be any method such as sputtering or evaporation so long as the thickness is known by other means.  Most geology labs have the ability to do this kind of deposition since they need reproducible carbon thicknesses on their samples.
For example, geo labs will typically place a polished brass object next to the sample to be coated in an evaporative coater.  The change in the color of the brass corresponds to the thickness of the carbon: e.g. blue is 250 Å but bluish green is 300 Å (Kerrick, D. M., et al., 1973).  So something like 25 % accuracy is possible this way.
Then you measure that thickness in the SEM using an exact beam current, size, distance from the objective lens.  Then you measure your graphene in the SEM using the exact same conditions.  If your sample is less than about 200 nm thick, then the number of counts/second is proportional to the number of carbon atoms present in the layer.  Using the mass for your standard layer, (assume a density of graphite), then you can compute the mass of your graphene.
If your thickness is more than about 200 nm, then you may need to do an absorption correction – i.e. the photons are being absorbed on their way out and your count rate is no longer proportional to the number of atoms.  You can compute attenuation coefficients using the CXRO calculator (and a couple other places if you google).  Then you can do a thin film correction.  At 200 nm, your error from ignoring the thin film correction is probably about 5–10 %, which is likely a bit less than the error in the determination of the standard film using the color method.  So you can think with that for your sample.
Option #2:
You can measure the mass directly using an oscillating crystal.  Commercial systems comprise a quartz crystal with electronics set to find the resonant frequency.  You place the quartz crystal in your chamber alongside your Cu substrate.  As your reaction happens, it grows both onto your Cu and onto the quartz crystal.  The resonant frequency of the crystal changes as mass is added.  These are sold commercially, though a bit pricey.  For example, at TedPella (again, no financial interest).  The resolution is typically billed as 1 Å thickness resolution (assuming you know the density of your material.)
For your application, you would have to be sure that the graphite grows on your monitor crystal the same as on your Cu substrate.  That may require checking in an SEM, and it may require prepping the crystal somehow.  Hence, I offer this as suggestion #2.
Finally, you could also figure this out using a focused ion beam and sectioning the sample from the side.  If this is too complex, there also exist labs where one can hire them to do this kind of measurement.
I hope one of these solutions works for you!
Ref:
Kerrick, D. M., Eminhizer, L. B., & Villaume, J. F. (1973). The Role of Carbon Film Thickness in Electron Microprobe Analysis. American Mineralogist, 58, 920–925.


what is the MASPAR case study?

Question: It is a question in istqb exam. I don't know what is the MASPAR case study and what it is about. Could anyone please summarise the learnings from this study?
Comment: Welcome to the community! It seems people want to close this question as "not enough clarity or details." I get it. But it seems like most people may not have heard of this case study to provide an answer?
Answer: I've been involved in tech -- computer science education and career -- for nearly 25 years, with a majority of this time in testing and QA! I've never heard of this case study and I've studied a lot of the history of the industry!
With that said, some quick Google searching led me to the following conclusion.
This case study might be available for purchase or behind a login on both the Standford Business website from 1994 and the IEEE website from 1990. Honestly, I don't think these are the right case studies, but just case studies about the MasPar company and hardware designs! Unless they are thinking about "maspar" - a company that sells bedding and quilts? Unlikely, hahaha! I can't find any other references to "MASPAR, "maspar," or "MasPar." Even Google search and Google Scholar is light on clarity and details about this!
MasPar was a company that stands for "Massive Parallel Computers," which essentially means "supercomputers" made during the 1990s! They are a defunct company.
Why ISTQB is asking about a defunct hardware company from the 1990s doesn't make a lot of sense to me. However, the question is phrased like this:

In the MASPAR case study:

A. Security failures were the result of untested parts of code.
B. The development team achieved complete statement and branch coverage but missed a serious bug in the MASPAR operating system.
C. An error in the code was so obscure that you had to test the function with almost every input value to find its two special case failures.
D. All of the above.

Any of these can be the right answer from a testing/quality perspective. But unless you've read the case study, it's a big guess here. The answer I found was "C," which I've bolded above.
So if this is the correct answer and really the outcome of a case study in failure that can't be referenced anywhere, then it seems to go against the standardized techniques and principles of "Boundary Value Analysis" and "Equivalence Partitions/Classes," since these allow you to cut down on the number of test cases needed to gain confidence in a working system in a shorter amount of time!
Is "Boundary Value Analysis" and "Equivalence Partitions/Classes" a standard technique today? Yes!
Can using them still not account for all test cases, which end up leading to bugs? Yes! But using them is a trade-off of speed versus accuracy, or the use of the Pareto Principle aka, the 80/20 rule!

for many outcomes, roughly 80% of consequences come from 20% of causes

Or for test cases to bugs: "roughly 80% of bugs come from 20% of test cases!"
Does "Boundary Value Analysis" and "Equivalence Partitions/Classes" account for every corner case? No. You should still find boundaries that create corner cases: often found at integrations or intersections of code!
In actual reality, it's hard to find obscure bugs/errors in code during the development and testing phases of the SDLC. In my experience, these are often found by accident in production, reviewing logs, random exploratory testing, etc.

what is the MASPAR case study?


From norm to scalar product

Question: In the Eculidean Space, one can automatically define a norm if a specific scalar product is given. On the contrary, it's not always true. A p-norm is a scalar product if and only if p=2. My question is what condition do we need in order to move back?
Comment: See http://math.stackexchange.com/questions/21792/norms-induced-by-inner-products/
Answer: I'm not sure if this is what you're asking:
A norm on a vector space is induced from a scalar product if and only if the parallelogram law $\| x - y\|^{2} + \|x + y\|^{2} = 2\|x\|^{2} + 2\|y\|^{2}$ is satisfied.
One direction is obtained by expanding the scalar products. If the parallelogram law holds, then one can verify that the expression given by polarization is a scalar product inducing the norm:
\[
\langle x, y\rangle = \frac{1}{4}( \|x + y\|^{2} - \|x - y\|^{2})
\]
in the real case and
\[
\langle x, y\rangle = \frac{1}{4} \sum_{k = 1}^{4} i^{k} \|x + i^{k} y\|^{2}
\]
in the complex case.
Added much later: For a good outline of the somewhat painful proof of the non-trivial direction, see Arturo's answer here.
Answer: Maybe more generally, while every norm gives us a metric, a metric is generated by
  a norm, I think, if the norm is translation-invariant.
Comment: This is not true (I guess you mean to say if the metric is translation invariant). For instance $d(f,g) = \sum_{n=0}^{\infty} 2^{-n} \frac{\|f^{(n)} - g^{(n)}\|_{\infty}}{1 + \|f^{(n)} - g^{(n)}\|_{\infty}}$ is a metric on the space of bounded smooth functions on $\mathbb{R}$ that cannot come from a norm.
Comment: More generally, a vector space equipped with a countable family of semi-norms separating points can be equipped with a translation invariant metric. The topology can be induced by a norm if and only if there is a bounded convex neighborhood of $0$. This is proved using Minkowski functionals, see e.g. Rudin FA, Thm 1.39.
Comment: Sorry, in my first comment I should have said $C^{\infty}([0,1])$, the space of smooth functions on the unit interval.
Comment: Yes, of course, I meant the metric is translation-invariant. I have been having a senior day today; getting a head-start (way too soon) on becoming senile. Sorry.

From norm to scalar product


How to write a "functioning" addict protagonist and it not get repetitive?

Question: A sub-plot of my story, is that the protagonist is struggling with addiction to alcohol due to past events (which happen in the book). I'm worried that all the scenes will come off the same because he is always drunk. How do I show that he is drunk every day (or almost every day) and spiralling down into a full blown addiction, while also not being repetitive in every scene? (Keep in mind he is still functioning, just drunk while doing it).
Answer: Without knowing more about your character I cannot be specific but the revelation is probably dripped . . . similar to the style of a good "whodunnit", a nuanced 'show' of clues.

Why is he always sucking on a breath mint?
Have him make simple errors (forgetfulness).

"I'll see you tomorrow," he said, pulling on his coat.
"Tomorrow's Saturday," replied Jane. "The office is closed on Saturday."
Or . . .
"Can you cancel my meeting with Tom?"
"You asked me that this morning. I did straight away. You were standing here when I made the call."

Have him refuse to attend social events where he knows there's alcohol.
Have somebody ask him why he no longer drives his car.
Show phone calls waking him up during relatively sociable hours, and when the caller says, "Did I wake you?" - Have him lie. He will miss lot of calls when passed-out or in no fit state. He will provide a string of lies; _the phone was on silent, the battery was dead, the phone was in the other room, I left my phone at X.

Together with loss-of-appetite and a general lack of enthusiasm, these are a few pointers. Feel free to use them, or not.
Answer: This Character won't Appear Drunk
If a character is self medicating with alcohol, they probably aren't getting wild-college-party-blackout-drunk every night. They are drinking enough to calm themselves - to "take the edge off."
If this character is a ways down the path to alcoholism, he will need to drink a LOT to appear intoxicated. And alcoholics often know that appearing drunk all the time is a warning sign to others - he will attempt to look normal, even while slowly killing himself with drink.
I'd look up the symptoms of alcoholism, and show them about this character. A couple off the cuff examples:

He hides his drinking - taking a pull from a flask when no one is looking, or hiding booze in his room
He drinks alone - there's no social function to his intake
High tolerance - when he drinks in a social setting, other characters note that he has had a lot, and he demonstrates that it has barely affected him
Needs a drink to get to sleep
Needs a drink to feel normal

So the technique here is to show him going about his life, and having these things gently intrude on the story. Maybe he has to stop at a liquor store on the way home because he's out of booze. When it's closed, he's distressed. He needs his nightcap to get to sleep.
Slowly let these events become more and more intrusive, and eventually it is obvious - both to the other characters and to your reader - that this guy is an alcoholic.
Answer: I'll Get The Bus Today
There may well be other changes in behaviour as well...
So, if your character is drinking a lot at night, they might well decide to catch the bus the next day because they know they are still intoxicated, and therefore can't drive.
Calling in sick, or working from home.
Self conscious about body odor because alcohol does make you smell more - so sneaking off to the bathroom to pop more deodorant on.
Someone mentioned eating less, but I don't know, I've seen examples were early stage drinking problems, there is more eating and weight gain.
Occasionally, having a pick me up in the morning.
Perhaps also, a moment where the drinker decides 'that's it, I'm stopping' but within a week is drinking again.


Why do functions in complex analysis behave so well? (as opposed to functions in real analysis)

Question: Complex analytic functions show rigid behavior while real-valued smooth functions are flexible. Why is this the case?
Comment: This shouldn't be a full-fledged answer, but I'm told the keyword is "elliptic regularity."
Answer: Well, real-valued analytic functions are just as rigid as their complex-valued counterparts.  The true question is why complex smooth (or complex differentiable) functions are automatically complex analytic, whilst real smooth (or real differentiable) functions need not be real analytic.
As Qiaochu says, one answer is elliptic regularity: complex differentiable functions obey a non-trivial equation (the Cauchy-Riemann equation) which implies a integral representation (the Cauchy integral formula) which then implies analyticity (Taylor expansion of the Cauchy kernel); the ellipticity of the Cauchy-Riemann equation is what gives the analyticity of its fundamental solution, the Cauchy kernel.  Real differentiable functions obey no such equation.
Another approach is via Cauchy's theorem.  In both the real and complex setting, differentiability implies that the integral over a closed (or more precisely, exact) contour is zero.  But in the real case this conclusion has trivial content because all closed contours are degenerate in one (topological) dimension.  In the complex case we have non-trivial closed contours, and this makes all the difference.
EDIT: Actually, the above two answers are basically equivalent; the latter is basically the integral form of the former (Morera's theorem).  Also, to be truly nitpicky, "differentiable" should be "continuously differentiable" in the above discussion.
Comment: Historical note: I think Goursat was first to remove the continuous differentiability hypothesis from Cauchy's theorem.
Comment: Dear Terry, since I like nitpicking too, here are two results:
a) if a function is only supposed differentiable in a domain of C, then its derivative is automatically continuous and the function is analytic.
b) if a function is continuous in a domain in C and if its integrals
over closed contours are zero, then the function is differentiable and a) applies (Morera).
Since you know this infinitely better than I, I wonder what you meant in your last sentence .
Comment: Ah, right, one doesn't need continuous differentiability to prove Cauchy's theorem.  (One does need continuous differentiability for the real variable Stokes' theorem, which is why I was unnecessarily conservative, but of course one can do better in the complex differentiable case, thanks to elliptic regularity (or the slick Bolzano-Weierstrass type proof by contradiction for Cauchy's theorem).)
Comment: Yes, and Goursat was born the year after Cauchy died, so it was a long time coming!
Answer: One answer is that property of being complex analytic is equivalent to being a solution to a differential equation (namely the Cauchy-Riemann equations) whereas there is no analagous formulation for being a smooth function. Once you have this formulation it should be immediately clear that complex analytic functions are rigid because solutions to differential equations are rigid. The whole idea of boundary value problems and initial value problems is predicated on the fact that knowing a solution to differential equation in a small area determines its values everywhere, which is precisely the type of rigidity that complex analytic functions have.
So you might ask why do complex analytic functions satisfy the Cauchy-Riemann equations. Well every real smooth function from R^2 to R^2 has a derivative, which is a 2x2 matrix. Requiring the function to be complex differentiable is the same as requiring that matrix to be a "complex number", i.e. a matrix of the following form: first row = [a, -b], second row = [b, a]. Well this condition is precisely the Cauchy-Riemann equations.
Comment: I would add that it is a complex number only in the one-dimensional (complex) situation.  The CR equations actually say that the derivative map is complex linear and it is only in dimension one that the space of complex linear maps from C to C is canonically C itself.  In higher dimensions, this is not the case.
Answer: The book Visual Complex Analysis gives a good explanation: locally, analytic functions are rotations and dilations.  Disks go to disks.  A smooth function of two real variables may map disks to ellipses.  That is, a real valued function can distort disks in a way that analytic functions cannot.
Answer: To expand on Dinakar's comment about boundary value problems, the physical intuition one should have here is that the real and complex parts of a complex differentiable functions are harmonic functions (this is just a restatement of the C-R equations).  An important way harmonic functions arise is as solutions of the steady-state heat equation, so one can think of the values of a harmonic function on a contour as temperatures and the values of a harmonic function in the interior of the contour as the steady-state distribution of temperature determined by the distribution of temperature on the contour.  When the contour is a circle one can compute this distribution by convolving with the Poisson kernel; this is a special case of Cauchy's integral formula.  The Poisson kernel itself is the canonical example of a "good kernel," and it finds application in Fourier analysis for that reason.  One generally expects convolution by a good kernel to have nice properties.
In turn, one reason why diffusion should have anything to do with complex differentiability is that in both cases one wants path integrals to be homotopy invariant, in the first case because path integrals should give the difference in potential and in the second case because this is the correct generalization of the fundamental theorem of calculus.
Answer: Here is a related discussion from combinatorics and more: http://gilkalai.wordpress.com/2009/06/29/test-your-intuition-6/#comment-2057
A very nice explanation by John Baez (in two installments) can be found here
http://golem.ph.utexas.edu/category/2006/10/knowledge_of_the_reasoned_fact.html#c005571
and here
http://golem.ph.utexas.edu/category/2006/10/knowledge_of_the_reasoned_fact.html#c005623
Comment: I see that the second of these also explains elliptic regularity (from the comment under the OP).
Answer: Consider the definition of derivative at a point a, which is formally the same for real functions of a real variable and for complex functions of a complex variable:
f'(a) = lim_{h -> 0}(f(a+h)-f(a))/h.
In the real case, h is real, and approaches 0 along the real line, from the right and from the left. In the complex case, h is complex, and approaches 0 from any possible direction. This makes it more difficult for the limit to exist, and thus for complex functions of a complex variable to have a derivative. When such a function is viewed as a pair of real functions of two real variables, that is, when we write
f(x + i*y) = u(x,y) + i*v(x,y), u and v real valued,
the existence of the above limit translates into the Cauchy-Riemannn equations:
u_x = v_y, u_y = -v_x .
This again shows that a function of the form u(x,y) + i*v(x,y) is smooth in the complex sense only if it satisfies the rigidity imposed by the Cauchy-Riemann equations.
Answer: Read the book Complex Made Simple by Ullrich.
Answer: A complex function is analytic if and only if locally it can be represented by a power series.  This means that (at least locally) an analytic function is determined by countable data (namely, the Taylor coefficients of its local expansion).  This is not true for smooth functions on the real line.  In my thinking the rigidity of analytic functions stems from this countable determinacy.
Another instance of this countable determinacy is of course the identity theorem.
Comment: A smooth (or even just continuous) function on the real line can also be determined by just countable data: its value on rationals.
Comment: Yes, but I think this is just a rephrasing of the question.  Why, conceptually, is analytic equivalent to complex differentiable?
Answer: Simple answer: because there are so many real-valued smooth functions, and so few complex analytic functions.
(Which is just a smug way of rephrasing Armin Straub's answer. The key is that analyticity is such a strong requirement as opposed to smoothness.)


Why is quantum mechanics called 0+1 dimensional QFT?

Question: I know that quantum mechanics is sometimes called 0+1 dimensional quantum field theory. What is the meaning? How should we understand it?
Answer: In field theory, a field can be thought of as a map from the spacetime $M$, usually a Lorentzian manifold---a particularly popular choice is $\Bbb R^{1,n-1}$ (Minkowski space)---to some other space. For instance, a scalar field $\phi$ can be viewed as a map $\phi:M\to \Bbb R$, or equivalently as a global section of the trivial (real) line bundle over $M$. The spacetime $M^n$ has one timelike direction and $n-1$ spacelike directions, and one can say that one studies $(n-1)+1$-dimensional field theory.
When doing mechanics, what do we use for a "field"? The position of the particle(s)! The position depends only on time, and hence we have maps $x_i:\Bbb R\to \Bbb R^n$ (in case the space in which the particles move is not simply $\Bbb R^n$, the target may be some other Riemannian manifold of dimension $n$) and fitting this into the general QFT picture we can identify $\Bbb R$ as our "spacetime", where we now have no spatial directions and only a timeline direction. Thus, we may call the theory a $0+1$-dimensional field theory. After quantization, one obtains a $0+1$-dimensional quantum field theory.
Comment: Excellent answer. Just a question: say we're talking about Galilean QM and QFT, both dealing with particles/fields of spin 0. If we take many-body QM, it's equivalent to an associated QFT (conversely, if we take a Galilean QFT, we can use the creation/annihilation operators to find the many-body Hamiltonian), or this is what many people are arguing (I can attach a link if you like). Following your arguments, this many-body QM is still a 0+1-dimensional QFT. But it's also equivalent to a QFT with scalar fields, so a 3+1-dimensional QFT. How do we reconcile the two?
Comment: I think when they say "Quantum Mechanics" in this context they are referring to QM with a fixed number of particles.  If you are in many-body QM as studied in condensed matter physics, I believe that is indeed closer to a QFT than QM, and the equivalence pretty much breaks down.  They still call it QM in that case because it is non-relativistic.


Will a person burn in hell fire forever even if he had faith but never followed Islam ?

Question: If a person believes in Allah and Prophet Muhammad S.A.W and all the seven articles of faith in Islam but that person did what he desired and wanted despite the fact that he had faith but he did what he desired and wanted. So is that type of person also doomed ? Will there be any concession for this type of person ?
Comment: Such questions are unanswerable because we don't end up judging you, God does.
Comment: When Allah Himself answers a question, however, it is okay to share that answer with the questioner. That is what the Book of Allah was revealed for - to guide mankind out of the darkness of wrong thinking and sinful conduct. No one is require to guess about what is necessaryto attain salvation in the akhirah because Allah made it plain in His Book.
Comment: Consider these ayah, in addition to those I cited in my answer: "Truly, whoever comes to his Lord as a sinner - for him is Hell. In it he shall neither die nor live." Qur'an 20:74. Look these up also .... 4:107; 3:133-135 (esp. the end of 135); and 2:81-82. My point is that the Qur'an is clear in stating that we can't insist on living contrary to the Guidance of Allah (which is the very definition of sinfulness) and still hope to be received in mercy on the Day of Judgment. To hold on to such hope is self delusion. It is better and wiser to just make tawbah and start living right.
Comment: @IbraheemMuhammad So does this mean a persons faith in Islam is useless if he does what he wants and desires ? Do you mean for that person there is no way out of hell fire then ?
Comment: I won't go so far as to say that someone's Imaan is 100% worthless. I read a hadith qudsee in An'Nawawi's 40 Hadith Qudsee  where the Prophet (alaihi salaam) said that, on the Day of Judgment, Allahu ta alaa is going to allow him to pray for the members of his Ummah whose sinfulness landed them in Hell. The hadith said that Allah is going to grant the Prophet's prayer, GRADUALLY RELEASING PEOPLE BASED ON THE SIZE OF THE IMAAN IN THEIR HEARTS. Those with the smallest Imaan will end up staying in Hell the longest. But, Young Muslim 1000, Hellfire should be avoided, period.
Answer: As'salaamu alaikum.
We muslims are in this world to do the work  necessary to achieve salvation on the Day of Judgment. There is a basic criterion for the attainment of salvation:
(1) Imaan (faith); and
(2) Amil-us-Salihaat (good works).
To attain salvation you must have both.
Good works without correct Faith in Allah are worthless, because Allah has said that He is not going to give the good works of the Faithless any weight on the Day of Judgment.

"Shall we tell you of those who will lose most in respect of their deeds? Those whose efforts have been wasted in this life, WHILE THEY THOUGHT THEY WERE ACQUIRING GOOD BY THEIR WORKS? They are those who deny the ayah  of their Lord and the fact of their having to meet Him. VAIN WILL BE THEIR WORKS, NOR SHALL WE, ON  THE DAY OF JUDGMENT, GIVE THEM ANY WEIGHT. That is their reward - Hell - BECAUSE THEY REJECTED FAITH and took My ayah and My Messengers as a joke."
Al-Kahf 103-106

On the other side of the same coin, having Faith but then failing to do any good deeds is also not enough to win anyone salvation.

"Are they waiting to see if the angels come to them, or your Lord (Himself), or certain other signs of your Lord?! The Day that certain of the signs of your Lord do come, no good will it do a soul to believe in them then, if it didn't believe before, NOR EARNED RIGHTEOUSNESS THROUGH ITS FAITH."
Al-An'am 158
"Whoever works righteousness, man or woman, and has Faith, verily to them shall we give a new life, a life that is good and pure, and We will bestow on such their reward ACCORDING TO THE BEST OF THEIR WORKS."
Al-Nahl 97

So that's it right there. It's not enough to merely say, "I believe", because a pair of lips can SAY anything. Allah wants us to demonstrate that we mean what we say by putting work in for Him and His Deen.
Think about it: a "muslim" is one who submits to the Will of Allah. If a man never does anything that Allah has commanded  him to do, nor abstained from that which Allah told hin to stay away from, then that man is NOT one who submits - he is one who rebels (a faasiq).
Insha'Allah, you will understand and be helped by this answer. Ma'as'salaam.


Restrict Users from accessing data using dataloader

Question: Does anyone know how I can restrict users from exporting/deleting data using data loader?
Thanks in advance
Answer: You can restrict the user by disabling <code>"Api Enabled"</code> permission. But this is not a vaible solution as it disables all other api interactions with salesforce.
Please vote for this idea.
https://success.salesforce.com/ideaView?id=08730000000DitKAAS
Comment: The problem is how would Salesforce know that a particular SOAP API call is coming from Data Loader versus another software tool that uses the API? Do you want an "I am dataloader" string and rely on the client software correctly identifying itself?
Answer: The Force.com platform enforces permissions to data at the object access layer, so if the user has permission to view an object and if the user has API access rights, then they can access that object via a tool that uses the API such as workbench or dataloader, or a tool they wrote themselves.
This is the correct design. It's not realistic for Salesforce or any webservice to control access mechanisms -- for example, users could write their own bots to screen scrape data from the site. As Salesforce is a webservice, it can't control the software on user's machines that initiates the HTTP requests to retrieve data -- access control enforcement by Salesforce can only apply at the data layer.
If you want to exert further control over your users to specify how they access Salesforce (or any other webservice), you need to install endpoint security solutions to prevent use of unauthorized client software running on your users' computers, as well as other mechanisms to prevent users from bringing their own devices to your network which do not have the security software installed, and of course limiting access to your org only from your controlled intranet.
It is a good practice to use endpoint security mechanisms, since these are the linchpin of securing your org. Network access mechanisms don't have enough information to solve this problem on their own -- they need to be combined with endpoint control software.
If you don't care about things like bots and only want to put some obstacles in the way of using tools like data loader, then you have some choices:

remove API access rights from the user, to force them to use the UI to access objects. This assumes they wont use screen scraping software.
If the data you are trying to protect is limited in nature and you want to prevent API access to some objects only while maintaining access to other objects, you can try to remove all object access rights for the objects you are trying to protect (e.g. remove access from the profile) and then create custom visualforce pages (or lightning components) to expose the data. These would have apex classes that ignore the profile level perms. However you still have the screen scraping problem and this is a brittle, high touch solution that would prevent use of standard mechanisms for access control -- you are implementing your own access control layer as a replacement for Salesforce's standard mechanisms and so would need to implement your own security management code, define your own custom access control lists, etc.


Shape keys cloth simulation - GLB file size

Question: I'm using Blender to export GLB animation files for Web use. These animations are cloth simulations that are then transformed into shape keys by exporting an .fbx and .mdd file then imported back into blender. So essentially each frame becomes a shape key. This makes the file very large. How do I reduce the number of shape keys without wasting too much time? Is there an addon or script that can help?
Comment: Thank you for the warm welcome! Yes, I mean reducing the amount of keyframes to achieve a smaller file size. I tried manually deleting every other keyframe but this breaks the animation for some reason and makes it go weird.
Comment: Hello and welcome to BSE! do you mean reduce the amount of keyframes? Depends how many you want to remove and how far down you want to go. Like if you remove every other keyframe, you could theoretically reduce the size by 50%. Is that what you want?
Answer: You can try run this script which will remove every other keyframe for all selected objects:
<code>import bpy

selected_objects = bpy.context.selected_objects

for obj in selected_objects:

    if not obj.animation_data:
        continue

    for fc in obj.animation_data.action.fcurves:
        k = fc.keyframe_points
        for i in reversed((range(1, len(k), 2))):
            fc.keyframe_points.remove(k[i])
</code>


positioning the cursor

Question: Whenever I type a SMS or an email or anything on a text field, I find it difficult to position the cursor at my desired place. Its easy to place by the end or beginning, but not in the middle of the word. Are there any mouse position keys ( left right keys ) or any other trick I am missing?
Answer: First you push on text until cursor appears, then position cursor by moving the finger.
Comment: @franklins: I find it very easy, as the cursor appears above your finger, not under it.
Comment: Actually @franklins I think the cursor is the same color as your accent color. Is it?
Comment: yes I get that. But the challenge is to place the exactly where I want specially its long word. Its like try until you succeed.
Comment: woah now I get it really well.. I have to wait for the blue cursor and scroll down, so that the cursor is on the word.. then its really easy... Thank you Oleg and Paradroid...
Comment: o.. ye .. i didnt realize that till then..., well now you know my current theme color..

positioning the cursor


packages are customer objects or standard object componenents

Question: Is all the packages are custom objects objects are packages are created to work with standard object componenets as well ?
Comment: Packages can only contain custom components, but they can contain custom components for standard objects (custom fields, picklist values, translations, etc.).
Comment: can we create a component to work with standard object (eg : case , oppurtunity) to trigger certain action during DML transaction. Instance, like a picklist inside case object, which triggers certain custom action based on the it's selection.
Comment: You can make workflow rules and triggers for standard objects.
Answer: A package can include its own custom objects and also custom fields added to standard objects. Other components including Visualforce pages and triggers (so Apex code) in the package can then reference both the package's own custom objects and custom fields and the standard objects and fields (and other standard components).
A design decision for a (managed) package is which Salesforce license the package will work with; if the package only references e.g. Account and Contact then it can work under a Salesforce Platform license users but if it references e.g. Lead and Opportunity then it will require Salesforce license users. (See What is the difference between the "Salesforce" and "Salesforce Platform" licenses? for more detail.)
Comment: [Here](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_types_list.htm) is some documentation on what exactly can be included in packages... and what [cannot](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_unsupported_types.htm)


Addition of powdered peanut butter

Question: I want to add peanut Butter to my batch How much powdered peanut butter can I add to a 5 gallon batch?
Comment: What sort of beer are you making? What's the starting gravity? What sort of grains or extract are you brewing from?
Answer: There's a recipe for peanut butter beer in my book.  We recommend 12 oz. of PB2 powder, dissolved in 6 oz. of 150 proof spirits.  Let that sit for a few days, then put it in a keg and rack the beer onto it.  Let it cold crash for a week, then rack the beer off the slurry into a fresh keg.
Comment: It is a brown ale! Would it be a problem if I added the Powder(PB2) when I transferred it to the secondary?
Comment: I can only recommend the technique I wrote about above.  I don't know how any other method would work.

Addition of powdered peanut butter


Number of parameters for AIC for a particular model

Question: I know there have been a few well answered questions on this topic, but i have found myself in a bit of a special case this time.
I am using AIC for model selection, and i am having trouble counting the number of parameters.
Our project involves a multilinear regression with quite a few parameters, which we are trying to cut down. We are doing it on magnetometer data for a particular location on the earth's surface. We have many years worth of 1 minute cadence time series data, for both the predictor and response variables. Based on a-priori reasons and previous studies, we are making multiple different models for varying times of day.
It might appear odd at first, but the different times of day correspond to different orientations of the station with respect to the sun, and we know that the response of the data to the predictor variables is very different for different times of day. We also have multiple different locations that we are trying to model. So there will be a different model for each station. All the stations use roughly the same predictor data, though there are some differences as some stations have missing data etc.
So i have p different stations, each with q different models, each of which has r different parameters. So in my 'global' model, I have p*q models, for a total of p*q*r parameters.I am trying to get a measure of AIC which measures the performance across all the stations and the whole data set. I want this so i can compare between the global models produced when I vary the number of input parameters, r.
What I'm wondering, is do i calculate an AIC by doing this:
AIC=n*ln(RSS across ALL stations & times/n) + 2*p*q*r
Or do i need a different AIC for each station, or even a different AIC for each station and time interval, giving a total of p*q AIC measurements for each global model? Or is this simply a fools errand? Obviously I'd like the 1st option best, but a different AIC for each station would still be manageable
Any help would be greatly appreciated, and if I've left out anything just let me know
Answer: I would stay focused on definitions.  A model with station (location) as a factor is still a model.  Time periods could be combined.
The Akaike information criterion (AIC) is a measure of the relative quality of a statistical model for a given set of data. As such, AIC provides a means for model selection.
Sincerely,
Mary A. Marion


What happened to the missing Martians from the 1990 movie Total Recall?

Question: What happened to the missing Martians from the 1990 movie Total Recall? I'm not asking about the newer remake, as it deviates greatly from the Schwarzenegger film. Does the answer lie in the Phillip K. Dick story "We Can Remember It for You Wholesale"? If so, what happened to them?
Comment: There are no Martians in the PKD short story, past or present.  That stuff was apparently made up for the movie.
Comment: I always assumed that they made the reactor for us, before leaving the planet.
Comment: If Quaids memories were fabricated, then there were no Martians to begin with...
Answer: Well, considering that the last martian turned off the atmosphere before leaving one could assume they all left.  If they all died their would be no reason the last one would shut it down before it died.  If it was left on there wouldn't be enough power/fuel left for Quaid  re-engage it. So in all likelihood they left Mars and probably the Solar System.
Since the atmosphere requires the turbinium reactor in the mines either the martians originated on Mars and created the reactors to preserve martian life or they came from elsewhere and used the reactors to terraform Mars. Most likely Mars was terraformed by an outside force and when they no longer had use of the planet they mothballed the reactors in case a day came that they needed them again.
Either way the movie does not explicitly spell out what happened to the martians.  Either they left or died, and they may or may not have been native to Mars.
Comment: Maybe the air-conditioning went into power-saving mode when it detected that no users were present.
Comment: Maybe they terraformed Mars to use it as a research base to observe the habitable planet nearby as not to disturb existing life on it. Perhaps they left when they realized an intelligent species was evolving among the Earthian life forms and were getting at risk of being discovered.
Answer: I read the novelization many years ago, which explains an awful lot more than the movie. As memory serves, towards the end Quaid had a brief moment of downloaded memories which tells him about the ant-like aliens slowly dying while trying to save the world, dying just before finishing their project. Again, I haven't read it in years, but I think the implication was that Mars was a colony of theirs- which makes sense as one would assume that a native Martian would be fine with the habitat of the planet.


Replace some LEDs with Diodes

Question: I have a COTS solar battery charger that has a number of different LEDs identifying the battery level, if its charging, etc.  Its going to live in the shed, so 99% of the time no one will see its pretty array of lights.  Would it be OK to replace these LEDs with diodes and would it save any electric?
Thanks in advance.
Comment: No, diodes have different forward voltages than LEDs. But maybe you can just omit the LEDs?
Answer: Without a schematic it's pretty hard to be sure, but 'nine times out of ten' the LEDs could be snipped out with no effect on the functionality. Replacing them with diodes would stop the light emission, but would almost surely use more energy, or could even possibly damage the circuitry. That's because LED driving circuits usually present a fairly fixed voltage with a resistance that's designed to cause a certain current to flow through the LED.
For example, a 3.3V circuit driving a 2.4V LED to 7.5mA would use a 120\$\Omega\$ resistor. If you replace the 2.4V LED with a 0.7V diode it will draw almost 22mA or almost 3x the current (and therefore, since it's all supplied by 3.3V, almost 3x the power, and over a given time period, 3x the energy).
Answer: The most suitable component will be zener diode, in case you don't want to generate light. One 3V3 diode may do the job, watch for the current rating. No, you will not save any energy by replacing LEDs by zener diodes. On the other hand, taking the LEDs out you may miss important information about the actual state of your equipment. Is it worth?

Replace some LEDs with Diodes


Modelling or modeling?

Question: When I want to talk about creating a structural model of a building or bridge, should I say modelling the structure or modeling the structure?
Answer: Both are correct and acceptable. Modeling is commonly used in the U.S. while modelling is used in the UK and many other places.
The last consonant often gets doubled in present participle and past participle when it's a part of a stressed syllable.
For example, the t in 'submit' is a part of a stressed syllable so it's doubled in present participle (submitting) and past participle (submitted).
The last t in 'target' is a part of unstressed syllable so it doesn't get doubled in present participle (targeting) and past participle (targeted).
However, the final -l- in unstressed syllables gets doubled in present participle and past participle in British English and many other dialects.
British English:

travel → travelling, travelled
label → labelling, labe**ll*ed
cancel → cancelling, cancelled
model → modelling, modelled etc.

American English:

travel → traveling, traveled
label → labeling, labeled
cancel → canceling, canceled
model → modeling, modeled etc.

(You might also want to read the Wikipedia article on doubling of consonants.)
Answer: It depends on which English dialect you are referring to:
Modeling vs. modelling:

In American English, the verb model becomes modeled and modeling. Outside North America, the preferred participles are modelled and modelling, with two l's. Canadians prefer the double-l forms, though the single-l forms appear about a third of the time. (In contrast, the double-l forms are almost nonexistent in 21st-century American writing, and the single-l forms are similarly rare outside North America.) These spelling preferences extend to modeler (U.S.) and modeller (outside the U.S.).

(The Grammarist)

Modelling or modeling?


Emitter follower augmented input current

Question:
Hello, I have this emitter follower augmented ( I think that's his name in english)
but I don't know from where is the beta+1 on the Iin ecuation?
Comment: Your circuit is a current-mirror with beta helper not an emitter follower
Comment: You're asking why \$I_{B3} = \frac{I_{E3}}{\beta+1}\$? And "Q3 is in forward active mode" is not enough explanation?
Comment: Yes that's what I'm asking.
Edit: I looked into that and it  explains why.
Answer: Q3 is in forward active mode because the base-emitter junction is forward biased and the base-collector junction is reverse biased.
In this mode we have the very well known characteristic
$$I_c = \beta I_b .$$
Since the current coming out of the emitter is (by KCL) the sum of the base and collector currents,
$$I_e = I_b + I_c = I_b + \beta I_b$$
and thus
$$I_b = \frac{I_e}{1+\beta}.$$
(Note: circuit theory purists would normally take \$I_e\$ to mean the current going in to the emitter, so there'd be some sign changes in the equations above)


Use of "up" in "back up", to mean going in reverse

Question: Why do we use the term "back up" when we are going in reverse? This is sometimes confusing for young English Language learners.  Going backwards is understandable, where does the word "up" fit in? Are we moving in two directions?
Comment: Here you see the three uses of to back up - http://www.oxfordlearnersdictionaries.com/definition/english/back-up?q=back+up
Answer: The word up can have literal spatial meaning with respect to a vertical or horizontal axis.  To climb up a ladder. To walk up a ramp. To take the elevator or lift up to the 10th floor. We're going up to London (destination).
But it also has a more abstract figurative meaning, originating in the semantic realm of motion, specifically as it relates to the commencement or initiation of actions.  The actor moves from a state of inaction, understood (at some deep metaphorical level) figuratively as a kind of recumbency, to a state of action.

He said, "I told you to back up, motherf_cker !"  So I backed down and backed up.

P.S. Compare German auf, e.g.  Hör auf !  (i.e. "desist!").
Answer:
Why do we say "back up" when we are going in reverse?

The word up has many definitions, but here it means to a source or origin. The word back here is acting as shorthand for backwards or drive in reverse. Thus putting the two together, we get the following statement:

Drive in reverse toward your point of origin

But that's a mouthful; saying, "Back up," is so much easier.
Comment: Can you cite something credible that says that *up* means "to a source or origin"? How would this differ from *down* as meaning the same?
Comment: Absolutely. This link is to from the American Heritage Dictionary online. Preposition definition #3. [link](https://ahdictionary.com/word/search.html?q=up). This is the reason why you see medical terminology using far more narrowly defined terms to describe location: distal vs proximal, dorsal vs ventral, medial vs intermedial vs lateral, and so on).
Comment: The word _up_ used without some good context can indeed be confusing. For example, let's talk about rivers for a moment. Many rivers run south; when you go down (as in position on a map) the Mississippi or the Rio Grande, you're also going down (as in away from the river's source) the river. But if you go down (as in position on a map) the Nile, you're actually going up (as in toward the river's source), and vice versa. You see, the Nile flows north into the Mediterranean Sea, whereas the Mississippi and the Rio Grande flow south into the Gulf of Mexico.
Answer: Of course, you are right, it is difficult to find the logic behind "up". My guess would be "to back" is derived from "to go back(wards)" and "up" is just an enforcing element as in to finish sth up.
Comment: I disagree. The logic is simple. 'Back up' meabs to go back to the previose state, place, marker. 'Hey, it was a mistake to come to the third floor. Her flat is on the fifth. Let's go back up.' exactly means what it says. To go back up the stairs to the fifth floor. In computers this term exusts since MS DOS for sure. 'To back up' means go to parent speaking of folders, directories, menus or anything else.
Answer: As noted "back" in the phrase "back up" or "backing up" as used to describe going in reverse is easy to understand.  For me the connection to up was made when I drove a 1960s era column shift vehicle.  What is often referred to as a "three on the tree" to describe a three speed manual shift with shifter on the column.  To place the car in reverse one had to pull the shift lever back and then push up.  Thus "back and up" was the action taken to go in reverse.  For me I equate "backing up" to the "back and up" shifter movement.
I can't say with any authority if that contributed to the term or if that shifter movement was some automotive engineers idea of a bad pun.  Seems reasonable that in future times people may believe up in "backup" as applied to data storage comes from the concept of "the cloud" being up.
Answer: When it comes to verb-particle phrases, it is often not possible to give a generally applicable rule. It's just important to be aware that English as many of these, and learn them individually. Other "up" verb phrases where the "up" seems arbitrary include "shut up" (stop talking), "hook up", "look up" [a word in the dictionary], "catch up", "put up" (as in to put someone up at your house = to let someone stay at your house overnight), and "lock up".
Answer: Yall are focused on the words too much. It comes from the old manual transmissions that had "3 on the tree" or a manual shift lever on the steering column. To put the vehicle in reverse you had to pull the shifter back and up
Comment: Do you have any proof for this? Can you refute the others' claims? You can [edit] your post at any time to include more details.
Answer: This phrase doesn't actually make a lot of sense literally, especially pertaining to the word "up" in the sentence. This is because this is an inseparable phrasal verb, which means that the part with meaning (back) cannot be separated from the part that doesn't have meaning (up).
You can think about it this way in order to separate the lexical part:

To back something up

You can also understand this is through context:

I am backing up by 10 meters.

The opposite would simply be:

I am walking forward by 10 meters.

In both of these examples, movement is happening in only one direction.
If you are interested in a very helpful list of phrasal verbs including this one, you can find one here.
Also see
Omnidisciplinarianist's answer for another great way to understand this.
Comment: Who says *up* doesn't have meaning? In the sentence you give as an example of the opposite, doesn't *forward* have meaning?


Transaction hash on a degree certifiate

Question: About a week ago I completed an online course from a reputed university. When I got the certificate, at the bottom I noticed a 'Blockchain Hash' followed by a long string of characters. When I clicked on it, it took me to a 'transaction details page'. My question is why is this here? Is this to authenticate the certificate?
Comment: Wow which university is this exactly?
Comment: Can you share a photo and a link to the transaction? This is super interesting.
Answer: Blockchain is an Distributed Immutable Ledger meaning that once a data is stored in a blockchain it remains in the blockchain as long as it exists. So, it can not be deleted nor can it be changed.
With the hash provided to you, it seems that the hash(Probably SHA256) was generated with your certificate as the input. One of the hashing property is it is collision free i.e. each Hash is unique in its nature. So, if you change even a single character on your certificate the hash will change.
So my observation is by using blockchain and hashing property, the certificate provider is giving you an optimal and ever-lasting proof that you have indeed completed your course and if someone asks for its validation you can simply generate the hash through the used Algorithm(probably SHA256) and tell them please verify it by looking in the blockchain. And they have to believe it because blockchain again is Imutable and Unchangeable Ledger.

Transaction hash on a degree certifiate


Pathfinder NPC starting money?

Question: I've been searching everywhere but I can't find any information on what the starting funds for a level 1 warrior is. Do they not get any?
Answer: Actually, NPCs get significantly more than (most) PCs at level 1!  You can find the relevant funds here-- it's unfortunate that they aren't listed in the class descriptions like the PC classes nor the WBL section, but that's probably because all NPCs get the same funds and also they have to spend them a little differently.
A typical first level Warrior has 50 gp worth of weapons, 130 gp worth of armor and other protective equipment, no permanent magical stuff not included in the previous two categories, 40 gp of consumables like potions and scrolls, and 40 gp of other miscellaneous non-magical gear.

Pathfinder NPC starting money?


Why is the cosmological constant a scalar?

Question:
Maybe my understanding is just off, but the cosmological constant is just a scalar, right?
What are it's units?
Why a scalar? - was a tensor 'cosmological constant' ever considered or is it just not conformable to the math or physics of the field equations?
Answer: Yes it is, its units in the SI system are $m^{-2}$ and you can guess it from a dimensional analysis of the Einstein field equation. From this equation you can also guess that imposing a scalar value is the simplest approach to the problem, there are probably theories and models less simpler than this, but I believe that the scalar value is still used because it was originally proposed by Einstein to impose the existence of a static universe.
The Einstein field equation is:
$R_{\mu \nu} - \frac{1}{2} R g_{\mu \nu} = \frac{8 \pi G}{c^4} T_{\mu \nu} - \Lambda g_{\mu \nu}$
Answer: As mentioned in another answer, it was first added by Einstein to make the universe static. As to why it is a scalar, I paraphrase from Straumann (2013).

It is natural to postulate that the ten potentials $g_{\mu\nu}$ satisfy equations of the form
  $$\mathcal{D}_{\mu\nu}[g]=T_{\mu\nu}$$
  where $\mathcal{D}$ is a tensor field constructed pointwise from $g$ and its first and second partial derivatives. Furthermore, this tensor field should satisfy
  $$\nabla^\mu\mathcal{D}_{\mu\nu}=0$$
  in order to guarantee $\nabla^\mu T_{\mu\nu}=0$.
  [Some remarks follow.]
Theorem (Lovelock) A tensor $\mathcal{D}_{\mu\nu}$ with the required properties is in four dimensions
  $$\mathcal{D}_{\mu\nu}=aG_{\mu\nu}+bg_{\mu\nu}$$
  where $a,b\in \mathbb{R}$.

In four dimensions, the field equations are quite unique. $a=(8\pi G)^{-1}$ is determined by taking the Newtonian limit. $b=\Lambda/8\pi G$ is chosen such that the field equations have the simple form you are used to. In four dimensions, it is not possible to have anything else other than a cosmological constant scalar.
A more physical interpretation is this: a constant tensor in spacetime would violate cosmological isotropy. It would pick out a preferred direction in a given coordinate system.
I should note that there exists a generalization of the Lovelock theorem to higher dimensions, but I am unaware of the proof. In any case, the associated length scales of something like Kaluza-Klein extra dimensions must be very small such that we needn't worry about more than 4 dimensions in standard GR. (See any text on string theory for extra-dimensional stuff.)


Online optimization

Question: What is the difference between online and offline optimal control?
I got confused in concept. I am working on an stochastic optimization algorithm that is based on dividing the time horizon into equal time intervals and solving a finite horizion optimization for each intervals,then I want to expand this algorithm to optimal control, when can I claim that my method is online?
Answer: The term comes from the machine-learning community, and is simply a variation of the name online learning. The major difference between this and offline learning is that you feed your data-sets in sequentially instead in a single batch process. For optimisation, it often means that you are doing optimisation with a model you know to be inaccurate, and each step you want to both perform your optimisation as well as improve your model (essentially you do online-learning of your model), for example by checking the predicted state with the actual state, or the predicted cost with the actual cost.
Note also that the terms online and offline optimisation are sometimes used less formally to simply mean run-time or not. I.e. a common challenge in model-predictive control is that computing the solutions can sometimes be too slow: then a possible approach is to compute solutions for the entire state-space of interest offline, and then simply implementing it as a look-up table. The challenge here is computing the entire state-space will be infeasible for many systems of interest (especially if the state-space is continuous) due to the curse of dimensionality.
Comment: How do you know the term comes from the machine learning community?  I found the term "online optimization" used in a control theory context in this [paper](https://link.springer.com/chapter/10.1007/978-94-011-0135-6_15) from 1995. I haven't found an earlier use of the term "online learning".
Comment: I don't actually and could be wrong. I just have heard it more often used in the first context, and only in the second context in the field of MPC. In the first context, I'm quite sure it comes from the machine learning community, simply because it has no meaning in control. In the second, it probably comes from the controls community. I would argue that depending on the meaning intended, it comes from the one or the other community. Make sense?
Answer: I believe it is fair to use the term online for your method since using the finite horizon window, you only calculate the optimal solution within your time horizon. As such, your controller may (and will) change as your system evolves and your horizon moves.

Online optimization


Rearranging Partitions?

Question: Is it possible to rearrange the order in which hard drive partitions appear on disk?  Of course, there would be no point in doing this to a SSD, but I have heard that for a HDD the operating system closer to the physical outside of the disk will load faster due to less read/write head movement.
Comment: Note that you will need to test yourself. The outer track is usually faster, but just how the outer track is numbered does not have to be the same on each drive. E.g outer most track could be track #0, our track #largerst track number.  (Please ignore that we address blocks these days since early SCSI and ATA-LBA and that if track numbers are shows that these are made up with fake data).
Answer: Yes, it's possible with tools such as parted, but this affects sequential access, not random access which is the usual bottleneck with hard drives, so it's not worth the effort, you won't see any difference in everyday usage.
See also: Does the order of partitions matter?

Rearranging Partitions?


Doubling Sequence

Question: What would be the formula for finding the number of sequences needed to reach some value when we know that the start value doubles on each sequence. So, for example for a problem where we know that the start value is $2.5$ and we want to find out in how many sequences if the number doubles on each sequence $(2.5, 5, 10, 20, 40...)$ it will reach $1000$?
Answer: If the sequence is $a, 2a, 2^2a, \dots$, then the $n$-th term is $2^{n-1}a$.
Given a number $b$, you want to find the smallest $n$ such that $2^{n-1}a \ge b$, that is
$$
2^{n-2}a < b \le 2^{n-1}a
$$
or equivalently
$$
n-2 < \log_2 \frac{b}{a} \le n-1
$$
This means that  $n=1+\lceil \log_2 \frac{b}{a} \rceil$.
Answer: Note that if the starting term of the sequence is $a$ and the common ratio is $r$, then the $n^{\text{th}}$ term of a geometric progression is given by $G_n = ar^{n-1}$.
In this case, we have, $a= 2.5, r=2$. Thus, we need: $$[2.5](2)^{n-1}>1000 \implies 2^{n -1} >400 \implies n-1 >9 \implies n >10$$

Doubling Sequence


Co-worker's music

Question: How do I tell a co-worker to turn off her music or at least wear headphones? My boss seams to be ok with her listening to the music, but it really bothers me. I have tried to ask her to shut her door or turn it down, but she doesn't.
Comment: Do other coworkers experience this same discomfort as you? Perhaps if you get others to ask her to turn down the music in group would be more effective.
Comment: So, Play your own music... Then if your manager complains, they have to do something about both of you...
Answer: "How do I tell a co-worker to turn off her music?"
You don't. You are not your co-worker's boss, and you can only "ask", not "tell".
Some steps you can take:

Ask her nicely if she wouldn't mind turning her music off or down. Sounds like you have already done this with no effect.
Ask again, but making it clear that it really bothers you and is interfering with your work (if it is). Make sure you stay polite.
Ask your boss if he/she could do something about it, making it clear again the effect this is having on you. Sounds like you've already done this with no effect.
Put up with it. Maybe get some noise cancelling headphones of your own.

Since the music is being played through speakers not headphones it would seem likely that other people in the office have no objection, and maybe even like it. There are workplaces like that. Do not be the person who insists that there be quiet because you like it that way, even if other people prefer the opposite.
Comment: I have "noise-cancelling" headphones for this very purpose. They are cheap ones and function more as an earplug that plays music, than active noise canceling headphones. I'll even leave them in with no music playing sometimes. Also works great for ignoring people you don't want to speak with.
Answer: If your boss is okay with the music there might not be much you can do other than nicely asking. You can't really force someone to do something though- especially if that person's boss doesn't agree with you.
Since you mention doors in your post- perhaps you can shut your own door to make your personal work environment more quiet. If your coworker has a door and you do not- perhaps you can bring your own noise cancelling headphones and block out their noise with some of your own- or better yet- if your office space has common areas throughout the building you can move to one of those if it will be quieter for you.
Office spaces certainly come with distractions and sometimes there isn't really much to do about it. Good luck

Co-worker's music


Why is motion tweening changing the size/proportion of my movieclip?

Question: I am having a really odd problem with Flash CS4. I have a MovieClip with the dimensions 652x400. When I create a motion tween for the layer containing the clip, and move the playhead to the last frame of the tween, I check the dimensions of the same MovieClip, and it's been changed to 660x408, regardless of the fact that I haven't even put in a keyframe at the end of the tween. What's weirder still is that the object looks the exact same size at the end of the tween as it does at the beginning, despite the fact that it's gained 8 pixels on each side. Flash seems to be arbitrarily resizing my MovieClips. Has anyone had this problem before and can anyone shed some light?
Answer: Okay so I've done some experimentation, and have figured out what's causing the discrepancy in the dimensions. The MovieClip has a blur filter on it, from the first tween frame to the last. What's odd is that even if this filter is set to 0px x 0px blur throughout the tween, the last frame is still 660x408. Essentially it still changes the dimensions whether or not you choose to actually use the blur, the fact that it's even on the MovieClip is enough to change it. Anyone with any clue as to what's going on?
Answer: Do you have any subclips inside the MovieClip? Are you entirely sure it's a MovieClip and not a Graphic? Animating graphics on the timeline can have strange effects.
Comment: it is a MovieClip containing several subclips. I guess that might be enough to freak flash out, but I don't know.