Check if page view is example node/page

Question: I'm having some trouble trying to put an if else statement into my "page.tpl.php". I don't remember (I did it in the past), how to check something like that,  but with some other page for example "www.example.com/home-2" or www.example.com/info . In my case is a page view, I would really appreciate any help you can provide.
Answer: Well if I understand you right...
In template.php
function mytheme_preprocess_page(&$variables) {
  $node = menu_get_object('node');

  if (isset($node) {
    $variables['node_type'] = $node->type;
  }
}

In page.tpl.php
<?php if ($node_type == 'your_type') : ?>
  // something here for node type your_type
<?php endif; ?>

Additionally, you can simply add new template suggestions.
In template.php
function mytheme_preprocess_page(&$variables) {
  $node = menu_get_object('node');

  if (isset($node)) {
    $variables['node_type'] = $node->type;
    $variables['theme_hook_suggestions'][] = 'page__node__' . $node->type;
  }
}

After clearing your cache, you can create page--node--(node_type).tpl.php and put page specific markup for that node type there.
Answer: Yes, the first two anwsers did the trick.
I knew that i can do the theme_suggestions, but i didn't want to create more files so the menu_get_object worked like charm.
PD: I did it before but i couldn't remember how (i deleted those files).
THANKS!!!
EDIT: The solution in my case was to put the
  if (isset($node)) {
    $variables['node_type'] = $node->type;
  }

into the template.php
and then put my custom code with a conditional (for example):
<?php if ($is_front || $node_type == 'info_list'): ?>

into the page.tpl.php
I hope it helps somebody.
Comment: Okay cool. Mark as accepted if that is your solution.
Comment: If you combine the two answer to get your solution you can edit this answer with the full description of how do you solve your problem, is better for other users

Check if page view is example node/page


Which Mac is good enough for iOS development?

Question: Are you an iOS development? Please tell me which mac hardware is good enough for that. I am gonna use it in about 3 years or more. I am intended to buy a macbook pro 2015 with 13.3", core i5, RAM 8GB, SSD 128GB. It's not so expensive but of course not cheap for me. I am just a student in an university right now, i haven't earned money so i want to save money as much as possible, but it should work well. That hardware is okay or can be less? I know that is an old question but i want to make sure before buying one. Thank you so so much for helping me.
Comment: The model you mentioned is enough, but you can also go for any mac laptop (pro, air and even the new macbook) just remember that xCode uses a lot of memory so I advise you to get 8Gb RAM and enough disk space for your projects
Comment: You're on a computer right now. Are you sure it won't do the job? Also, does your university have a computer lab with iOS development tools you're allowed to use?
Answer: I am using a Late 2011 MacBook Pro 15" with 4GB of memory and a 750GB hard drive (non-SSD). Xcode 7 is slower than previous versions (especially the emulator) but usable.
But using an SSD on a laptop with 8GB memory is more than up to the task of developing for Mac OS X or iOS.
Some points to consider:
1) 128GB storage is not large so you will probably need more external storage depending on what you download and store on your laptop.
2) While 8GB memory should be fine for 3 years (at least), if the memory cannot be upgraded after purchase then consider 16GB memory if you can afford it.
One annoyance I find, when developing, is that you can always use more screen space. You will find yourself opening and closing a lot of panes / windows in Xcode on a 13.3" display.
Comment: Eh... 128 GB is fine. It's not a lot, sure, but he's only doing iOS development and regular stuff. Unless he's installing a *lot* of extraneous applications or Windows VMs that shouldn't be an issue. Also, so long as he occasionally power cycles his machine and doesn't keep an insane number of browser tabs open, it doesn't feel likely that 8 GB will ever be a legitimate bottleneck.


Sizing transistors for a CMOS circuit?

Question:
Say we have this cmos circuit any advice how you would size up the transistors assuming that the gate is minimum-sized. Ive done some reading and I am struggling to understand. Is there an definition to define this?? I feel like it is really simple.
Thanks
Answer: For minimum sizing, we usually say that L is minimal. What we actually scale is the W.
The NMOS in a inverter of minimal size is defined as being of size "1". All other sizes are in reference to this.
Depending on the coursebook you ask, a PMOS is said to be "2 times worse" than a NMOS of the same size. So our default inverter looks like this (I used to more common transistor symbol found in most digital/VLSI design textbooks):
[
What we usually want, is that when the output is pulled to 0 by a certain set of inputs, the resistance to ground (or rather, the current capability of the gate) is the same as that of a single inverter. This means, if you have 2 transistors in series to ground, you need to make them 2 times bigger to compensate.
I've redrawn the pulldown network from the gate in your question.

When we look at this, we can see that E gives us a path from the output to ground. Therefor, we can keep this minimal, and it's size will be 1.
C', D', A and B form parallel/series branches. In the worst case (worst case where we still have a output equal to 0, ofcourse), only one transistor of each parallel pair will be on. So, we will have 2 gates in series. This doubles their resistance, so we need to also double their size to compensate. In other words, these transistors will be size 2.
Answer: This method can be used as a shortcut for finding the size easily. So here for the pmos circuit the maximum worst delay that can be generated is by having three transistors in series. so that may be t1 t3 and t5 or the next possible combination would be t2 t4 and t5. we know that 2nmos = pmos size. so, we first multiply 2 and then for three transistors in series it should be multiplied again with 3. so, 6 is the size for pmos. and for nmos the worst case of delay that can be generated is by using 2 transistors in series the combinations might be t7 t9 or t8 t10. so, 2 would be the size of pmos transistors.

Sizing transistors for a CMOS circuit?


SVNADMIN: lslocks and rmlocks disagree

Question: When I run the command: svnadmin lslocks My_Repo| grep -B2 user_name, I get about 10 files which are locked. Other people see that this user has them locked in TortoiseSVN.  When I run svnadmin rmlocks My_Repo on these locked files I get a message that "it isn't locked".
Comment: This is happening with one specific user who claims they have had strange locks showing up in their name ever since they had a crash while in a working copy on their desktop.  I am not sure what the server is confused about though, why does lslocks show locks and rmlocks see no locks?
Comment: what does the user actually see?
Comment: The user sees "file is already locked by ", exactly what you would see if the file or directory is actually locked.
Answer: Wow, this one wasn't hard after all.  If the Path has spaces in it, svnadmin rmlocks will consider that to be a different argument delimited by a white space!  I got around this issue by using: svnadmin lslocks Software |grep Path|sed -e 's/\(^Path: \)\(\/.*\)/\2/' -e 's/ /\\&/'|while read my_path;do svnadmin rmlocks Software "$my_path";done

SVNADMIN: lslocks and rmlocks disagree


Empty orbitals in Transiesta

Question: I have noticed some difficulties in converging Transiesta calculations when including empty orbitals in the basis set, particularly when a non-zero bias is applied.
In particular, I have tried to simply converge graphene structure and I
could easily converge the calculation by excluding the empty orbitals. Including them, I could still converge zero-bias case but not the non-zero cases. Since I used quite long tails, I extended the divide region to approx. 6/7 layers. I understand that in the case of graphene, the energy window of interest is well described even by excluding these orbitals. However, I will include some atoms in which I included empty orbitals to properly describe their pristine band structure (in particular, B and N and I reproduced hBN band structure).
My question is: is it advised not to include empty orbitals in transiesta calculations?
Comment: TBtrans is a 1 time execution code, there is no self-consistency in TBtrans, so what do you mean by "converging"?
Comment: I'm sorry, I meant the transiesta run before this. Again, I managed to converge it but it seems very slow. I imagined that generally speaking. adding more orbitals could make the calculation slower (and the convergence?) but I was winding if there is anything else I was missing.
Comment: @nickpapior this is the last day of the bounty, do you think you can help so that the $50 bounty doesn't go to waste?
Answer: There is per see nothing to prohibit the use of empty orbitals in TranSiesta calculations. In fact, in some cases they are very much required (vacuum spaces between STM tip and sample for instance).
However, there are a few details that require extra care.

Adding empty orbitals in the scattering region, but not in the electrodes, may require an extended region of electrode layers between the actual electrode and the device region.
The placement of empty orbitals can greatly affect the self-consistency depending on their relative position and how close they are to other orbitals.

So the answer is no to your question. But extra care should be taken when using empty orbitals in the device region and not in the electrode region.
Comment: Thanks Nick. Can I ask you for more information about the cases in which they might be required? I have vacuum in some cases. WHat is their role in this case?
Comment: I'll mark this as answered for now!
Comment: @Laura just a reminder that you have only 12 hours remaining to award the bounty (if you want to award it to an answer). Maybe fewer than 12 hours when you actually see this.
Comment: @Laura, what does empty orbitals do in an LCAO calculation? If you can answer this question, then you know what it does in *all* situations! :)

Empty orbitals in Transiesta


How can I get all of my Gmail contacts into my Mac Contacts?

Question: I was able to import all of my Gmail contacts into my iPhone but my Mac doesn't include them.  How can I get all of my Gmail contacts into my Mac contacts app?
Answer: On Lion/Mountain Lion, go to the Preferences on your Contact app, choose Accounts and then On My Mac, and there should be a checkbox Synchronize with Google, you will just need to provide your Gmail credentials.
Just as a precaution, make a backup of your contacts first. Just need to go to Gmail, select Contacts, then the More button, Export to download all your contacts to your hard drive.
Comment: out of curiosity, why the need to make a backup of contacts first ?
Comment: Just in case the Contacts app makes some unexpected changes to your gmail contacts and mess them up.
Comment: This was really helpful! Is there a way to keep synching the contacts? So if I add one to my gmail contacts it will automatically add it to the apple mail/contacts client? Thanks so much!
Comment: @Alison consider posting this as a new question.
Answer: There is an easier way to do this. Pull up your contacts in Gmail, select the "more" botton, click the export contacts option, it will give you the option to export them as vCards. Export as vCards to the desktop. Pull up mac contacts, click import and select the file you dropped on the desktop. You are done.
Comment: easier and safer as leftover cruft from apple contacts doesn't corrupt google contacts


How do World Events work in Pocket Planes?

Question: When I am part of a World Event, how are the prizes distributed. When it says top 10 gets "X" does everyone in the top 10 group of flight crews get it or the top ten of every separate flight crew that reached the quota for flights. Also another question is whether the quota for flights is just your flights or the total flights of everyone in the crew.
Answer: The ranking applies to the whole group, meaning every contributing member in the top X group gets the prize.
A contributing member is someone who worked towards the goal, usually a handful of contributing actions are enough to be eligible to the prize. The quota is cumulative between the whole group, meaning not all members need to participate for a group to reach the top, but only participating members will be eligible for the final prize.
Comment: The number of items required in order to win the award is located under "flight crew --> prizes". Generally it is 50 jobs, so it says "Deliver 50 jobs to qualify for prizes." You also have to be in a flight crew in order to win prizes. I highly recommend TOUCHARCADE. It nearly always comes in first place.


Chevy 454 rebuild do I need to replace bolts?

Question: I am rebuilding my 454 Chevy engine do I need to replace the old bolts or will the old bolts work properly. I understand that some bolts stretch and can not be reused.
Comment: It might be helpful to include the engines year.  The 454 was [made for about 50 years](https://en.wikipedia.org/wiki/Chevrolet_big-block_engine)
Comment: Welcome to Motor Vehicle Maintenance & Repair! If you don't know the year, look at the rear of the engine directly above where the oil filter goes. There is a pad there which should have the block casting numbers. Then, at the front of the engine on the opposite side, there should be numbers stamped into the machined metal right in front of the head. Getting us both of these numbers (complete numbers) will go a long way.
Comment: Without details we aren't going to be able to help you, is it a 454 made yesterday that blew a head gasket or is it an antique motor? are you talking about the bolts that hold the coil packs on or the bolts that hold the main caps on?
Answer: If you are making the effort to do a high quality rebuild then I would fit new bolts for the head, camshaft/rocker carrier(s), main bearings and big ends and flywheel ie all the important ones.
If you are just going to "get it running" to sell on... then you may well consider reusing bolts, except the ones that stretch as you have recognized they need renewing anyway (although some ignore that anyway) ...
Answer: The big block Chevrolet (BBC) engines did not come with torque to yield (T2Y) bolts in them. As long as the bolts are in good shape (not bent or broken), they can be reused with confidence.
If you chose to replace any bolts, only the head bolts would be possible to do without further machine work. If you change out the rod bolts, you'd need to have the large end of the rods resized. The new bolts will place the cap in a different location, which would mean the bearings would not behave correctly and would require machining.
The same goes for the main bolts. If you went with new bolts or stud replacements, again, it would require it to get machined. This is typically called an align bore of the main caps.
Mind you, neither of these things are bad to have done. If you are looking for a very good rebuild job, something which will last you a long time as well as give you the best performance, installing ARP studs in the mains and new rod cap bolts will help the engine spin a lot higher and hold together better. All of it costs money, so you'll need to decide which is better for your situation. Really, though, as long as the engine was doing okay prior to it being torn apart, there should be no fear of reusing the old bolts.


Why would the compressor provide more pressure than necessary? Isn't the pressure determined by the resistance?

Question: I clearly misunderstood something
Answer: The pneumatic device requires both the correct pressure AND flow rate to work properly. Conversely, the compressor produces a different flow rate at each particular pressure.
If the compressor does not have a pressure and flow-rate combination that matches the pressure and flow rate that the pneumatic device requires, then one of two scenarios will occur if you try to run it off the compressor without a regulator:

If the compressor is too small to run the pneumatic device directly, then the flow rate too low which would reduce the pressure and the pneumatic device would not work properly.

If the compressor is large enough to run the pneumatic device directly the result flow rate would be too high and the pressure would increase, possibly damaging the pneumatic device.

If the compressor is too small you use a reservoir tank that the compressor pressurizes to higher than the pressure you need and then you regulate the pressure back down. You can't run the pneumatic device continuously since the compressor can't keep up, but if you run short enough so that pressure never gets too low and infrequently enough so the compressor can top off the tank you it will work.
If the compressor is too large then you can run the pneumatic device without a reservoir tank but you still need the regulator or else the compressor's will produce a pressure that is too high and a flow rate that is too high and damage your pneumatic device. Of course, you can also use a reservoir tank so that the compressor doesn't need to run continuously, especially if the compressor can produce more air than the pneumatic device uses.
This is very similar to how voltage and current work in a electric load. The load requires a particular voltage and current to function properly. If you expose it to a voltage too high the current that flows through load will be too much and it will be damaged. If the voltage is too low the current that flows through the load will be insufficient. Unless your battery matches the voltage required by the load and can supply the required current without the voltage sagging, you can't run the load off the battery directly. You need a regulator.


Present Continuous+never for emotional tone

Question: As we know Present Continuous is used with always / constantly to express some emotional nuance (often negative).
e.g. My sister is always borrowing my clothes without asking!
Can we similarly use never
e.g. He is never telling the truth.
Comment: Idiomatically speaking, you definitely *can't* combine ***never*** with the continuous participle the same as ***always***. If there's a *reason* for this (as opposed to just *established idiomatic usage*), maybe it's to do with the fact that continuous actions require *time* during which to happen, which ***never*** explicitly denies exists for the cited action.
Comment: But we can use _never_ with states that _are_ continuing - "He's never at home when I call" - "You're never in a good mood early in the morning."
Answer: No, the usage of [ "always" + continuous ] to express annoyance about a regularly occurring event is a fixed structure, and doesn't allow any other adverbs of frequency to be used in the place of "always" and keep that function.
The sentence "He's never telling the truth" is good grammar, but is just a neutral statement with no nuance of negativity. It could mean many things in the right context -- including expressing a regularly occurring event -- but none of them add the nuance of annoyance:

He files a complaint every week or so, but he's never telling the truth.

In this case, "he's never telling the truth" roughly means in each case, it turns out that he's not telling the truth. While that situation may or not be annoying, the grammar doesn't imply it the same way "always" would, like in this example:

He files a complaint every week or so, but he's always lying.
Answer: While it is true that the present continuous tense does not always mean something is 'ongoing', if something never happens then it is neither present, nor continuous.
So, you would not say "my sister is never borrowing my clothes". You could say:

My sister never borrows my clothes.

There are some occasions when it is idiomatic to use 'be' with certain verbs in the present-continuous tense and negate the statement - for example, instead of saying "don't worry about me", you could tell someone "don't be worrying about me". Note that, unlike your example, this is not a statement of what doesn't happen but rather what you are asking not to happen.
Further, I wouldn't agree that 'always' and 'continuously' are "often negative" - That would depend entirely on the context. For example, you could say "my sister is always helping me", and that would be quite nice, wouldn't it?
Comment: -1 The fact that continuous is used has nothing to do with whether the event itself is continuous. Future plans aren't continuous, and neither is my sister borrowing my clothes. To indicate that something happens on a regular basis without any other nuance, we use *present simple*: *My sister **borrows** my clothes.*" To indicate a such a regular event (not a constant one) with the nuance of annoyance, we use "always" + *present continuous*. It's also possible to use "never" with continuous forms.
Comment: @gotube that wasn't the point at all. I didn't say that we can't use the continuous tense if something isn't continuing... just that, in this case, it **never** happens. I was appealing to the OP to use logic and see why the present continuous tense could not be used.
Comment: Your logic still doesn't flow. If something that never happens isn't present, then why does the correct sentence with "never" have the present simple tense? I'm sure you're familiar with the function of *[ "always" + present continuous ]* to express annoyance at something that *happens* regularly. This question is only about whether *[ "never" + present continuous ]* has that same function. It does not.
Comment: @gotube The 'present simple' is also the **present indefinite**. It isn't just about events, but conditions that exist. When you negate it, the condition doesn't exist. It's that simple. We don't use present continuous for these kinds of statements, but I think you know that and are just doubling down on this minutiae detail to avoid admitting that, ultimately, the answer is correct.


How to get a DIB implemented in a C++/COM library into a .NET client using that COM object

Question: We have a COM object implemented with C++/ATL that includes a method which will return a DIB.  We are also writing a .NET application that will use this COM object.  Since we are writing both, we have the liberty of deciding how best to return this DIB from the COM object.  To clarify, would it be best to return a native windows handle to a DIB or a byte array or is there some other way to easily transition a windows DIB into a .NET Image object?  And, related to that question: once I have this returned DIB how can I get it into a .NET Image object?
Answer: COM/OLE has a standard interface for representing graphical images called IPicture (and its scripting-friendly version IPictureDisp).
COM provides an implementation of these interfaces for you.  You can get it to build one for you by calling OleCreatePictureIndirect().  You just hand it a PICTDESC structure with the graphic you have, and it gives you back an interface.  You should be able to hand that interface back to the calling program.  This will also make your object compatible with other COM clients like VB6.
Back in .NET land you can turn an IPicture into an Image using Microsoft.VisualBasic.Compatibility.VB6.IPictureToImage().
Answer: Have a look at the article DIB to System.Bitmap on CodeProject. It has the code to convert from a DIB to a Bitmap. The idea is that the DIB is represented using a IntPtr.


What are some big brand Dunkel beers in the United States?

Question: I love Dunkel's (German Dark Lager) every time I have them but live in a small town without much local access to imported or small brewery beers (unless they are a bigger name). What I want to know is what are some brands of Dunkel that are more common with distributors that I may be able to get a local retailer to stock or order?
Answer: What are some big brand Dunkel beers in the United States?
First of all what are Dunkels?

Dunkel is the German word meaning dark, and dunkel beers typically range in color from amber to dark reddish brown. They are characterized by their smooth malty flavor. In informal terms, such as when ordering at a bar, "dunkel" is likely to mean whatever dark beer the bar has on tap, or sells most of; in much of north and western Germany, especially near Düsseldorf, this may be Altbier. - Dunkel

Depending on where you live you may be able to find some big brand name Dunkels. In Washington state I generally go to BevMo, in Bellingham.  They usually have most varieties of everything that is available.
They have in stock Warsteiner Dunkel and Erdinger Dunkel, Hofbrau Dunkel, Weihenstephaner Hefeweissbier Dunke, Ayinger Altabairisch Dunkel and Weltenburger Barock Dunkel.
Occasionally, they are out of stock, but then so are other outlets. Check around and you will be able to locate some Dunkles here or there. The bigger outlets are best to deal with.
If BevMo is unable to obtain a certain variety, look elsewhere. They are in several different states.
Answer:
Sam Adams Dunkel Lager
Spaten Munich Dunkel
Ayinger Altbairisch Dunkel
Paulaner Munich Dunkel
Weihenstephaner Original Dunkel
Hacker-Pschorr Munich Dark
Hofbräu München Dunkel
Warsteiner Premium Verum Dunkel
Sierra Nevada Tumbler Autumn Brown Ale
Bell's Brewery Kalamazoo Stout


Credit card deposit to accout

Question: How do I deposit money to a bitcoin account from a credit card?  I just need to pay an acquaintance something I owe him and he wants it added to his bitcoin account
Answer: You will need to buy bitcoin, then send that to your acquaintance. Other option is to convince your acquaintance to accept another payment method.
Most bitcoin sellers will not accept credit card because it is very easy to lose money from chargebacks.

Credit card deposit to accout


How to get a QGIS useable style file from OS .xml and .xsl files?

Question: Ordnance survey provide some style files to support their vectormaplocal product. The style files appear to come in pairs, similarly named but one with a .xml extension and the other .xls   The two files together seem to be designed to define the style but my problem is how do I get the two into a format that QGIS can handle?
Answer: Here, the XSL file is a style sheet language file (XSLT, or eXtensible Stylesheet Language Transformations)  for transforming the XML file into other XML documents or other objects such as HTML, plain text, pdf, etc.
A priori nothing to do with QGIS, especially if one looks  OS MasterMap® style guidance

Transforming GML using XSLT
These styles are also supplied as an XML Style sheet (XSLT, or eXtensible Stylesheet Language Transformations), which includes the style descriptions from the OS MasterMap user guide in an XML format, for all OS MasterMap layers (excluding Imagery layer).
For those interested in using XSLT with OS MasterMap an example is provided below that applies the OS MasterMap style guidelines to the independent polygon GML data to produce SVG. Both files below are required and should be used in the same directory as the data being converted.
....

and the example files have nothing to do with QGIS
QGIS style files (qml) are also a XML format. Theoretically, it would be possible to create another style sheet language file to transform the Ordnance survey XML into a qml file.
But happily, QGIS, support another XML format, the SLD format (Styled Layer Descriptors, see SLD Support and other QGIS 1.8 Style Features of Underdark) and you can download these styles in SLD format in  OS VectorMap Local "NEW Styled Layer Descriptor files" or in Styled Layer Descriptors (SLDs) for vector products
Comment: Thank you Gene.  I was in the process of reading through some of the documentation associated with the xml and xls files but had not come across the reference to the SLD files. I don't know how I missed them on the OS website. I do find that tracking down related documents is sometimes difficult on the OS website.  Most of my problem is not having the knowledge to understand much of what I read :(  Also thanks to Underdark for her info on SLD Support etc, I'm working through it :)


Can you use dextrose in a yeast starter?

Question: If you don't have ay DME on hand is it ok to use dextrose as the sugar in a yeast starter?
Answer: The yeast will grow and multiply in dextrose.  Supposedly, though, while they grow up in the dextrose they begin to down-regulate the genes required for fermentation of maltose.  So when you pitch them into the maltose rich wort, they struggle a bit before fermentation really takes off.  How big of an impact it has on the final beer is hard to say.
Furthermore, dextrose is a nutrient poor medium.  DME is more than just a sugar source.  It has nitrogen and other trace elements as well.  So some yeast energizer would be needed as well in dextrose to hope to get much quality growth.
In an pinch without DME, some people have had luck purchasing a couple bottles of Malta-Goya from the local supermarket.
Comment: For those who are wondering what "Malta-Goya" is, I googled it (wanting to know myself): http://en.wikipedia.org/wiki/Malta_(soft_drink)
Comment: Carbonated wort, essentially.


How can I connect in Illustrator two circle's tangent with another curve (or circle section)?

Question: I am trying to connect these two circles in purple with curves (in red) with some kind of an arc but i just can't find a way of doing this perfectly, with accuracy and without a plugin, i just can try to fit them as good as i can but i need these connections to be super precise and snapped if possible. Thanks a lot!:
;
Comment: Switch to **Outline mode** (window menu) and be precise in anchor placement, then switch back to preview mode to pull the curve.
Answer: ADD: The simplest workaround in Illustrator is at the end of this answer. Jump directly to it if you do not like elementary geometry nor methods which are either non-exact or need extra software.
==========
There's an infinite number of possible curves which are tangential with 2 given circles, Actually there exists an infinite number of possible circle arcs which fit. Let's construct one of them. Let  R (red) and B (blue) be the given circles and G (green) be a circle which should be moved to be tangential with R and B. In the next image the dashed green circle is drawn to the approximated final place of G:

The radius of G must be long enough, but otherwise it's arbitary.
The dashed circle is placed by eye and one can easily see the place is not exactly OK.
Proper placement in advanced CAD software would be found by setting tangency constraints and the program would move G to the right place. Ideally you could set the starting point of the tangent arc on one circle and play with the place where the arc meets the other circle. The radius would adapt.
That functionality isn't available in Illustrator without CAD style extensions. We solve the case with elementary geometry.
Start by moving G so that it's tangential with R in the bottom node. It will snap exactly if Smart Guides and Snap to Point are ON, no other snaps! Select G and drag the bottom node with the white arrow:

You see that the right placement of G can be achieved by rotating G around the center of R. But making it snap needs some auxiliary drawings. Rotate tool alone wouldn't do the trick. Let's draw horizontal radiuses to circles B and G. We can construct the auxiliary drawings with them:

We draw a new circle in the center of B. The radius of the circle is the sum of the radiuses of B and G. Move the radiuses to a row and draw the new circle (orange) by holding Alt+Shift to start from the center of B

The center of G should be on the orange circle. But another circle is still needed oget a crossing for proper snap.The other auxiliary circle is at the center of R and it's radius is the difference of the radiuses of R and G.
The magenta line is drawn from the center of G to the center of R. It's the wanted radius. The magenta circle is drawn by holding Alt+Shift:

The magenta line is technically unnecessary, but it can help when drawing the circle due the numerous snap candidates which can cause easily errors .
The next step is to select  G and rotate it with the rotate tool around the center of R. Set the rotation center and drag the center of G to the crossing of the magenta and orange circles:

You can insert a new node to the green circle at the crossing. It can be used to delete the unnecessary part of the G.
This solution is not practical, it's more like elementary math exercise. An advanced CAD style plugin or a CAD program would be handy. As well one could eyeball the shapes with high zoom in.
If the curve can be arbitary you draw a tangential Bezier curve with  2 clicks and drags with the Pen tool. You must again eyeball the handle if you are going to be fast.

As said, with a CAD plugin the process would be easy and fast. I don't have such software, but we can try it in a CAD program. This CAD is freeware which unfortunately doesn't have tangential arcs, only tangent lines.
At first draw 2 tangent lines to your circles with the "draw tangent" tool:

In theory a single common tangent line exists but it's possible it doesn't meet the circles in the artistically wanted place. 2 tangents give some room. The corner must be rounded:

The result is a circular arc which has a piece of line at the other end:

Mathematicians would say "it's not the smoothest possible, it's curvature has a step in the joint of the line and the arc". But it can be visually good enough.
In illustrator without extension plugins you can draw the tangents as 90 degrees rotated radiuses, only move them and scale the length. Split off the extras, join the lines and round the corner - all with Illustrator's own tools:
Comment: The question would be better if youd star with the short explanation. Just saying.
Comment: OK, inserted a shortcut.


Sum of Homothetic Functions

Question: If two utility functions represent homothetic preferences, will their sum also be homothetic?
Answer: Defn: A function $h:\mathbb{R}^2\rightarrow \mathbb{R}$ is homogenous of degree $k$ if for every nonzero $\alpha$, $h(\alpha x, \alpha y)=\alpha^k h(x,y)$.
Defn: A function is homothetic if it is a monotonic transformation of a homogenous function.
Lemma: If $f$ is homothetic, i.e. $f=g\circ u$ for some strictly increasing $g$ and homogenous $u$ then
$$
\frac{\frac{\partial f}{\partial x}}{\frac{\partial f}{\partial y}} = \frac{g'(u(x,y))\frac{\partial u}{\partial x}}{g'(u(x,y))\frac{\partial u}{\partial y}}=\frac{\frac{\partial u}{\partial x}}{\frac{\partial u}{\partial y}}
$$
is homogenous of degree zero.
Let
i) $u_1(x,y)=x+y$,
ii) $u_2(x,y)=\log(2x+y)$
Then, $u_1$ and $u_2$ are homothetic functions since they are monotonic transformations of homogenous functions (of degree 1). Let
iii) $u_3(x,y)=x+y+log(2x+y)$. Then
$$
MRS_{u_3}=\frac{\frac{\partial u_3}{\partial x}}{\frac{\partial u_3}{\partial y}}=\frac{1+\frac{2}{2x+y}}{1+\frac{1}{2x+y}}=\frac{2x+y+2}{2x+y+1}
$$
which is not homogenous of degree 0.
Hence, sum of homothetic functions is not necessarily homothetic.
Comment: (+1) for including the (not so widely known) lemma. Perhaps you could consider including also its simple proof, so that it is clear that the MRS is homogeneous of degree zero, irrespective of the degree of homogeneity of $u$.
Answer: A homothetic preference means that for some utility function representing the preferences,
$$u(\alpha x, \ \alpha y) = \alpha u(x, \ y)$$ for any bundle $(x, \ y)$.
So now consider the sum of two different homothetic utility functions, $w$.
$$u(x, \ y), v(x, \ y)$$
$$w(x, \ y) = u(x, \ y) + v(x, \ y)$$
$$\alpha w(x, \ y) = \alpha u(x, \ y) + \alpha v(x, \ y)$$
$$= u(\alpha x, \ \alpha y) + v(\alpha x, \ \alpha y)$$
$$= w(\alpha x, \ \alpha y)$$
Comment: It is highly likely that the definition of homotheticity of a function is more general than what is defined here. What you are defining here is more of the definition of homogeneity of degree 1.
Comment: note: $u(x,y)=x+y+5$ is not homogenous but it is homothetic and it represents nomothetic preferences.
Comment: Indeed the definition given is for homogeneous functions, which is a subset of homothetic functions.
Comment: You guys are correct, I am making a stronger assumption than homotheticity.

Sum of Homothetic Functions


Rules Regarding Sewing a Talit for my Bar Mitzvah son

Question: I want to sew a Talit for my Bar Mitzvah son. Please help me with the rules/Mitzvah. I need to understand the do's and don'ts of making a talit. I heard you can't have shaatnaz in the talit, but many of them are made of wool with different fabric at the coteret.
Comment: Good for you, @mom! This is a beautiful idea!
Comment: As it happens one can have shaatnas in tsitsis. When the tallis is made of linen. But today since no 'tcheiles' we dont.
Answer: The essential parts of a Kosher Tallith:

It has exactly 4 corners; classically square angles.

A Tallith need not be square; it's usually rectangular, so as to reach from the head to the thigh, and to be wrappable around the body comfortably.

Each corner has a hole to put the 4 Tzitzit through. This hole is typically reinforced so it doesn't tear from the weight of the Tzitzit.

Typically the corners are reinforced with more fabric, about 2" x 2".

This hole must be no more than three fingers-lengths away from the edge of the Tallith and no closer to the edge than the distance from the top knuckle of one's thumb to the end of the finger.

Measure straight from the edge of the Tallith; not at an angle.
A hole too far from the edge or too close to the edge invalidates the Tallith.

This cannot be repaired once unless the Tzitzit are untied and the retied after the repair.

All this and more can be found in the Kitzur Shulchan Aruch סימן ט - הלכות ציצית - and translated here.
A Tallith also typically has an Atarah - a crown - some pretty piece of fabric which is worn as the top of the Tallith.
The important part of the Tallith are the Tzitzit; these have to be manufactured by people who have learnt the relevant Halachot to ensure they are kosher. They also have to be tied and knotted properly, as explained in the source I provided.
Comment: @Lee - I thought I covered that with "so as to reach from the head to the thigh, and to be wrappable around the body comfortably". BTW: The Aruch HaShulchan 15:4 says that only a Tallith Gadol needs a shiur. A Tallith Kattan does not.
Comment: Doesn't the beged (cloth) have to cover a certain area of the wearer's body in order to merit tzitzit?


Fetching Case history into agent console in service cloud live agent

Question: I am learning service cloud live agent. When a customer chats with an agent, if the customer's case is already added, then the agent is able to view the case history in service cloud console. How is that possible? Is it using some information (like email) filled in pre-chat form?
Thanks in advance!
Answer: That's correct. Every contact has an email address (required field). The contact's related cases are loaded into the console page layout via a query.


In English language acquisition, is it really important to stick to any standard accent?

Question: English, as a global language, has unavoidably a lot of varieties. When we learn English do we really have to stick to one specific variety ? If yes why and which?
Comment: Are you familiar with the [English Language Learners Stack Exchange](http://ell.stackexchange.com)? I think your question might be more suited to that site.
Comment: US Midwestern, obviously.
Comment: Queen's English, if you please. :)
Comment: More seriously, the important thing is to speak in such a way that your listener understands what you say, which in the global village is harder than it sounds.
Answer: Great question. Yes, English has many varieties, but as far as I know only two of them are normally taught in a classroom context: British English (assuming Received Pronunciation) and American English (assuming General American).
To make a decision, ask yourself:

Which version will be more useful to me? (Professionally, travel-wise, etc.)
Which version am I likely to more easily imitate? (Maybe you have a knack for RP, but not GenAm.)
Which version will I hear more often?
Which version sounds more appealing to me? (Some learners feel that RP sounds more "prestigious" or "proper", etc.)

Note that whichever version you choose, you will be understood by most English speakers around the world, despite the pronunciation and speech pattern differences.
However, let me offer several pragmatic advantages of going with GenAm:

GenAm dominates the media. You'll have no shortage of movies, shows, etc., and those are important (and entertaining) learning aids.
GenAm dominates the internet. Think YouTube, podcasts, lectures, etc.
This is a bit of a guesstimate, but there are many orders of magnitude more speakers of General American than those of RP. According to Wikipedia, RP is spoken by roughly 3% of the British population. By contrast, General American (or its close approximation) is very common in the US.

So for example, if your job puts you in a position to communicate with a British person, chances are, this won't help your RP very much. But if the guy or gal is American, they'll probably be speaking GenAm.
To answer your other question: No, you don't have to stick with a specific variety. It's up to you. Many people seem to mix and match and feel just fine :) Just make sure you can understand both General American and RP and you'll be good to go.
Comment: Good answer, @A.P.  And if Lexis English is still flipping a coin between RP and GenAm, you might bear in mind that all British people are very familiar with GenAm  -  we hear so much on TV, radio and in movies  -  that GenAm might really be the modern lingua franca.
Answer: The Transatlantic version was popular some decades ago: a rhotic mix of American and British pronunciation without any regional nonsense and with emphasized clarity.
Today, the American Theater Standard is most likely what one should aim for. It is rhotic. It is free of drawn-out vowels. It is very light on nasal sounds. No affectation. No Eastern Seaboard, Brooklyn-inspired sing-song tones. No mouth-filled-with-marbles that today passes for genuine British talk. No Cockney sound-chewing, no Irish brogue or west country lilt. In other words, it is clean, sensible, and, when used correctly, quite beautiful.


How to change markers on zoom change in google map api

Question: I have a map and I'd like to change the marker image, when zoom is greater then 5.
I know how to detect zoom change, but I don't see how to change the image.
Answer: That should be quite easy. I gave a look to your code, and it looks like you are not keeping a reference to your markers. This is the first thing that you should do.
Therefore create a markers array:
var markers = [];

And within your setMarkers() function, push each new marker into this array:
markers.push(marker);

Now you will be able to iterate over your markers with a for loop: for (i = 0; i < markers.length; i++).
Ideally, we should also store the two icons of each marker in the marker object itself. JavaScript objects can be augmented with custom properties very easily. To do so, you may want to change your setMarkers() function as follows:
function setMarkers(map, map_bounds, locations, iconLevel1, iconLevel2) {
  for (var i = 0; i < locations.length; i++) {
    var loc = locations[i];
    var myLatLng = new google.maps.LatLng(loc[1], loc[2]);

    var marker = new google.maps.Marker({
      position: myLatLng,
      map: map,
      icon: iconLevel1,    // iconLevel1 by default
      title: loc[0],
      zIndex: loc[3]
    });

    // Add custom properties to the marker object
    marker.iconLevel1 = iconLevel1;
    marker.iconLevel2 = iconLevel2;

    // Add the new marker to the markers array
    markers.push(marker);

    map_bounds.extend(myLatLng);
  }
}

Finally, it seems that you are already handling the zoom_changed event correct. First of all, I suggest checking if the zoomLevel has changed between 1 and 2, in order not to iterate through the markers array if there is no need. If there is a change, simply call the setIcon() method for each marker, and pass the custom property iconLevel1 or iconLevel2 depending on the zoomLevel:
var zoomLevel = 1;

google.maps.event.addListener(map, 'zoom_changed', function() {
  var i, prevZoomLevel;

  prevZoomLevel = zoomLevel;

  map.getZoom() < 5 ? zoomLevel = 1 : zoomLevel = 2;

  if (prevZoomLevel !== zoomLevel) {
    for (i = 0; i < markers.length; i++) {
      if (zoomLevel === 2) {
        markers[i].setIcon(markers[i].iconLevel2);
      }
      else {
        markers[i].setIcon(markers[i].iconLevel1);
      }
    }
  }
});

The above should work, but you may want to refactor your for loop as follows, using the subscript notation instead of the dot notation to access the properties of the markers:
for (i = 0; i < markers.length; i++) {
  markers[i].setIcon(markers[i]['iconLevel' + zoomLevel]);
}

Answer: I don't like to write lots of code so I solved this for my own project in this way:
var z = myMap.getZoom();
var m = new google.maps.Marker({
    position    : new google.maps.LatLng(myLat, myLng),
    icon        : myMarker( z ),
    map         : myMap
});

The function myMarker() is a custom function where I pass the zoom level and return plain image data. You could easily just generate a url using string concatenation:
icon        : 'myMarkerIcon_level'+ z +'.png'


Poincare-Bendixson Theorem

Question: Can someone sketch some ideas of how to use the Poincaré-Bendixson Theorem to prove that there must be a fixed point contained inside a periodic orbit?
Comment: This certainly doesn't hold for discrete or higher dimensional dynamical systems (ex: billiards in polygons), so I take it we can assume the system is continuous and 2 dimensional?
Comment: I have a feeling that that statement is false. I do not have a counterexample though.
Comment: I cant see the question, the image link isn't showing either.
Comment: @Alex: is there even a Poincare-Bendixson theorem in more than 2 dimensions? In anycase, certain topological assumptions must be made about the domain, else just consider the rotations on $\mathbb{S}^1\times \mathbb{R}$.
Comment: @Brad: please flesh out your question. Your statement is presumably true under certain assumptions, none of which you stated in the question. Please put more effort into describing what exactly it is that you want to know.
Comment: @Willie: Certainly not without limiting assumptions.
Answer: I interpreted the question as follow:
Let $f : \mathbb{R}^2 \to \mathbb{R}^2$ be a $\mathcal{C}^1$ vector field. Suppose there exists a periodic orbit $\gamma$. According to Jordan-curve-theorem, $\mathbb{R}^2 \backslash \gamma$ admits only one bounded connected component $D_{\gamma}$. Show that $D_{\gamma}$ contains a fixed point.
In fact, you only need a weak version of Poincaré-Bendixson theorem:

Theorem: Let $f : \mathbb{R}^2 \to \mathbb{R}^2$ be a $\mathcal{C}^1$ vector field and $x \in \mathbb{R}^2$. If the $\omega$-limit $\omega(x)$ is nonempty, compact and does not contain any fixed point, then $\omega(x)$ is a periodic orbit.

Notice that it is also true for $\alpha$-limits, since by reversing time an $\alpha$-limit becomes an $\omega$-limit while the phase portrait is unchanged.
By contradiction, suppose $D_{\gamma}$ does not contain any fixed point. Then, by Poincaré-Bendixson theorem, for all $x \in D_{\gamma}$, $\omega(x)$ and $\alpha(x)$ are periodic orbits. In particular, there are infinitely many periodic orbits in $D_{\gamma}$.
For any periodic orbit $\tau$ in $D_{\gamma}$, let $K_{\tau}=\tau \cup D_{\tau}$ (where $D_{\tau}$ is defined like $D_{\gamma}$ but for $\tau$). We get a family of compacts $\{K_i : i \in I \}$ linearly ordered by inclusion, indexed by some unbounded set $I \subset \mathbb{R}_+$. Without loss of generality, we can suppose the family $\{K_i : i \in I\}$ nonincreasing (otherwise, take $\tilde{K}_i= \bigcap\limits_{j \leq i} K_j$).
Because any $x \in \mathbb{R}^2$ is between its $\omega$-limit and its $\alpha$-limit, $\bigcap\limits_{i \in I} K_i=\emptyset$.
Now, take $i_n \in I$ such that $i_n \underset{n\to + \infty}{\longrightarrow} + \infty$; then $\bigcap\limits_{n \geq 0} K_{i_n}=\emptyset$. So we find a nonincreasing sequence of compacts converging to the emptyset, a contradiction (since $\mathbb{R}^2$ is complete).
Answer: What is meant here with inside is inside as in the Jordan-curve-theorem. The proof can be done using it as well as the Schauder-fixed-point theorem - see for example the proof in the book by G. Teschl (to be found on his homepage).

Poincare-Bendixson Theorem


What happened to Tauriel after the events of the Battle Of the Five Armies?

Question: I know this is probably a difficult question to answer, since as far as I know Tauriel is a character that was created just for the movies, but if anyone has any quotes from the director or cast or producers or whatever, I would love to know what happens to her. She was one of my favorite characters, and I feel like they kind of just left us hanging with her.
Comment: Welcome to SFF:SE. We recommend a look at this [guide](https://scifi.stackexchange.com/help/how-to-ask) on how best to ask questions here.
Answer: According to the actress who portrayed her, her guess is that she simply returned home. As you say, this character was entirely an invention of the film so her opinion is as valid as anyone else involved in the making of the movies.

HC: What do you think happens to her after the events of "Five Armies"?
EL: You know, it's going to sound very mundane, but I think she goes back to Greenwood — which would hopefully now be Greenwood;
slowly but surely it would evolve out of Mirkwood and return to
Greenwood — and she goes back to work. It sounds so boring, but
ultimately, she has a job. She has a responsibility. She's the head of
the Elven Guard. She's not head of the Elven army — that is Prince
Legolas and King Thranduil — but she's the head of the Elven Guard,
and they protect their realm. And maybe she doesn't go back to being
head of guard, maybe she's been softened and wouldn't resume her old
position, but in a way I feel like maybe she would be even more
impassioned to protect what she loves, to protect her home, to protect
what's important to her, but maybe she'll do it now with more
compassion and a little bit of softness.
Evangeline Lilly on 'The Hobbit': It 'changed my mind about acting'


Are questions from volunteering on topic?

Question: As the question says, are questions on topic if they come from volunteer activities, rather than from a paid workplace? To be clear, I am asking about situations that might also arise in a workplace (such as interpersonal disputes), but happened in a volunteer capacity.
Comment: Shameless plug: [Area51 Proposal for Non-Profits](http://area51.stackexchange.com/proposals/96178/how-can-i-create-a-succession-plan-for-my-organization/96181) here
Answer: I agree with Chad's answer, that as long as they meet the same standard as other questions, they should be fine. The situations that arise in a volunteer organization are often very similar to those at a paid job. We've certainly had some highly voted questions that are about volunteering and not paid jobs.
Peaceful and professional way to drop out of a volunteer project that's gone bad
Administrator thinks I, an IT volunteer student, am hacking the school network
Answer: They are not explicitly off topic.  But it would still have to meet the same standard as any question about a paid job would. Questions about where to volunteer, how to volunteer at a specific organization, or the like are still off topic.
Answer: Yes. Whether people are paid in money, experience or personal satisfaction, volunteers are still largely held to the same standards as regular employees and encounter the same problems. Volunteers are expected to show up they commit to a schedule, work amicably with colleagues and customers, are held accountable for their work and have certain goals to meet. Some volunteering projects are run more strictly and seriously than paid departments.
The abomination that is the unpaid internship is also on-topic here and while that is just a shade closer to a "real job" than volunteering, in practice (and in my opinion) they boil down to the same thing.
Answer: Yes, they are treated just as fairly as other questions on this site.  The same exacting standards and attention to relevance are applied as many of the situations may apply, with obvious exceptions such as pay, et cetera.  However, many other situations are the same such as coworkers who are obnoxious and noisy, what to do with lunchroom thieves, how to change careers, et cetera ad nauseum.
We'll mark them as off topic and close them just as quickly as other posts about paid positions.
Answer: There is a volunteer tag, but the topic isn't mentioned explicitly in What topics can I ask about here?:

What topics can I ask about here?
The Workplace Stack Exchange is a Q&A site about the workplace and other career-related topics. With your help we're working to build a library to every question about the workplace related to:

Finding employment (resumes/cv/cover letters, recruiters, hiring-managers, interviews, negotiations, etc.)
Maintaining employment (promotions, pay increases, harassment, bullying, poor working conditions, communication problems, etc.)
Leadership in the workplace (motivating people, encouraging people, making decisions, holding hard conversations, intervening in unproductive situations, asking for and giving help, etc.)
Terminating employment (notice period, breaking the news, handing over work, reference letters, relieving letters, etc.)

What questions are off topic here?

Questions seeking company-specific advice on workplace regulations or policies, or legal advice
Questions that lack a clear goal we can address or focus on ranting about problems rather than trying to solve them
Questions asking for advice on a specific choice (including reviewing resumes, CVs, cover letters, e-mails, as well as specific salaries, billing rates, market worth, etc.)
Questions that aren't a good fit for the Stack Exchange format (see also Good Subjective, Bad Subjective for information on how to ask a subjective question suitable for the Stack Exchange format)

I suggest mention this topic explicitly in this page. See: Should topic about volunteering be mentioned explicitly in the help center?


Could one fit a root application in sim card

Question: In the third Mr.Robot episode a character inserted a Micro-SD card in a smartphone in order to root it and gain information, so I thought maybe someone could fit a root-kit on a Sim-card. Would that be possible to achieve in terms of the space available on a Sim-Card?
Comment: Size seems dependent on the exploit used to get root.
Answer: Some SIM cards have a capacity for 128KB (or more) of storage, easily large enough for a small exploit, perhaps a rootkit plus remote execution vulnerability. Conceptually, phones have a sandbox that protect them from the SIM's data, but there are known vulnerabilities that can be exploited. Technically, these cards aren't supposed to contain executable code (they should contain only data), but there's nothing prohibiting this rule. After all, they are basically small processors with permanent storage (Software-on-a-Chip, or SoC).
One such article that I found suggests that the sandbox can be defeated, and also that no carriers have bothered to patch this exploit, simply because "nobody's using it." Admittedly, this article is already two years old, but for most vendors, that's almost as good as yesterday in terms of carriers, who rarely spend time patching even critical exploits, much less exploits that supposedly aren't used in the wild.
A well-versed hacker, such as Mr. Robot is supposed to be, could easily write code that could exploit a phone, even if it hadn't been previously rooted. Of course, if the phone were already jailbroken, perhaps to enable a custom OS or unlock features such as tethering or changing carriers, the exploit might be even easier. Mind you, I'm not aware of an explicit exploit that exists in the wild, only example/proof-of-concepts, but it appears that the author of Mr. Robot has bothered to do their homework within the realm of possible. Please keep in mind that Mr. Robot, like almost all television shows, are science fiction, usually based on fact, but not historical evidence.
It's also well-known that a hacker that has physical access to almost any system basically has full control of the system. For example, a hacker can easily crack all Windows passwords using Linux-on-a-disc, and a hacker with sufficient knowledge and resources could hack any phone, even one with full encryption enabled (but this is a very specialized, and very costly technique).
Comment: "Technically, these cards aren't supposed to contain executable code (they should contain only data)" — No, SIM cards always contain code. It's supposed to perform some crypto operations with a key that doesn't leave it. There can be [applications running on a SIM](https://en.wikipedia.org/wiki/SIM_Application_Toolkit), you'll find them sometimes on basic phones (feature phones and then smartphones mostly killed that).
Answer: The fast answer is - no, not without using exploits. The reason is not the space in SIM card, but permission. As you receive your SIM card from mobile operator this card have quite good security and will not permit you (easy) to install applications inside.
Moreover (based on my humble knowledge) SIM card do not have access to the phone filesystem and can't do changes there (please someone to correct me if I am wrong). The standard way of operations is phone (OS) send command to the SIM card, get the result and do some operations, based on the result (for example verify PIN, check if operator which signal is strogest is in FPLMN and so on)
And usually the size of smartcard domain where you can (eventually) install some portlet is quite small


Is ListView visibility for Roles shared accordingly to Hierarchy?

Question: I've made a custom list view and restricted its visibility by role, what happen is that the list view is visible for the specified role and all its upper parents in the roles' tree . Is it a standard behavior? in case it is, is there a way to avoid it ?
Answer: When roles are enabled this would be the expected behavior. If this is a custom object, you can deselect the "Grant Access Using Hierarchies" checkbox to disable roles above from having visibility of an owner's records. Otherwise, you're going to need to use a Private sharing model along with sharing groups.
Answer: Yes, this is standard behaviour. The reason is that ListView is also an Object and one specific List View is record. If this list view is shared with Role, it will be automatically shared based on princip "Grant Access Using Hierarchies"
For list View it is not possible to control if they will be shared using Role hierarchy.


How do I rename a FAT SD Card using a MacBook Air?

Question: I'm trying to rename a 16GB SD card (Untitled) using a MacBook Air but the Disk Utility won't let me rename/erase/reformat it. I am able to open the device and see all of its content but cannot rename it. The reason I want to rename it is so that 3rd party apps on an Android Smartphone can write to the SD card. Right now, only the native Android file manager can write to the Sd card. Inserting the micro SD card into the adapter and then inserting the adapter into the card reader of the MacBook Air puts the device on the desktop. When I click on the label name, it turns blue but I still can't change the name.
Answer: sometimes there is a tiny tab on the SD adapter (or standard SD card) that prevents read/write to the card. Make sure this isn't set to "lock."
Otherwise: What version OS are you running? Can you write or delete files from the card?
Answer: Open terminal and use diskutil list to find the disk number of the SD card. Then change disk2 below to the number, making sure you physically disconnect any disks you can't afford to erase if you make a mistake with the numbers.
diskutil eraseDisk MS-DOS UNTITLED disk2


What optimization (maximization/minimization) methods exist contours with lots of kinks?

Question: I am wondering what methods exist out there for optimization on problems where your contour has lots of small sharp kinks. For example, suppose we have a contour where there are lots of lots of spiky, but sufficiently smooth maxima. In this case, if we were to use an optimization procedure such as gradient descent, we must set our gradient descent step size to be very small, in case we "leap" over a maxima that is too small for our step size to detect. Is there any existing literature for controlling this? Thanks!
Comment: Have you heard of simulated annealing?  https://en.wikipedia.org/wiki/Simulated_annealing
Comment: There are many global optimizers. I've found that the literature is a bit dated, so I created a colab notebook to make recommendations. It helps you choose a Python global optimizer package, and strategy therein, from Ax-Platform, bayesian-optimization, DLib, HyperOpt, NeverGrad, Optuna, Platypus, PyMoo, PySOT, Scipy classic and shgo, Skopt, nlopt, Py-Bobyaq, UltraOpt and maybe others by the time you read this. Please say what your objective function is and I can provide a precise answer, or read https://medium.com/geekculture/a-simple-way-to-choose-a-python-optimization-package-250e1d3b83c9
Answer: The state-of-the-art for non-convex optimization in a complex, ill-conditioned and multi-modal landscape is Covariance Matrix Adaptation - Evolution Strategies, aka CMA-ES, which in various versions (such as BIPOP-CMA-ES) has scored first in several global optimization contests (see e.g. the Black-Box Optimization Benchmarking, BBOB 2009).
You can find a lot of information, code for several languages (C, C++, Java, Matlab, Octave, Python, Scilab), research papers and tutorials about CMA-ES on Nikolaus Hansen's website.
The relevant paper is:
Hansen, Nikolaus, Sibylle D. Müller, and Petros Koumoutsakos. "Reducing the time complexity of the derandomized evolution strategy with covariance matrix adaptation (CMA-ES)." Evolutionary computation 11.1 (2003): 1-18;
which you can find on the first author's website linked above. I also recommend his tutorial paper, which you can also find on his webpage.
The disadvantage is that CMA-ES requires a lot of functions evaluations to be effective (e.g., usually not less than $10^3$-$10^4$, and even more); however, it is able to solve problems that are just impossible for other solvers.
A possible alternative, if your target function is costly to evaluate, is to use Bayesian Optimization (BO) assuming noise in the target function; this would smooth away kinks in the target distribution. See also this question and my reply there to get some references about BO or other optimizers.
Comment: +1. Thanks for joining our community. I hope that you continue to make these kinds of high-quality contributions.
Comment: (+1) I initially read the first line as "The state-of-the-art for non-convex optimization is a complex, ill-conditioned and multi-modal landscape", which also seemed accurate.


Are some tail wheels made out of solid plastic?

Question: Are any tail wheels on small planes made of hard, rounded, plastic-like material?
Comment: Welcome to aviation.SE!
Answer: You can see that sort of thing on ultralights that land at 25-30 mph where they may use a solid once-piece wheel made of some elastomeric plastic or rubber.  Smaller airplanes however, will use a rubber tire on an aluminum wheel with proper bearings, due to the very high rolling RPM once you are landing above 40 mph (or at least a bushing that can take high speeds and loads).
The smallest ones usually have solid rubber tires and once you get to a certain size, say on airplanes over 1500 lbs or so, they will be pneumatic tires.  For example, an Aeronca Champ usually has a solid rubber tailwheel, but it's heavier and faster Citabria descendant has a pneumatic tailwheel tire.  You can browse typical tailwheel tires here.
Comment: Once the part is "certified", triple the price. The extra money won't go in your pocket; it's eaten up in regulatory compliance costs.   You will notice that the uncertified homebuilt tailwheels are far cheaper because there are no regulatory hoops.
Comment: $1,000+ for a solid rubby wheel on a caster. I should get into the niche aircraft parts business.
Answer: Quite a few sailplanes (e.g. Schweizer 2-22, 2-33) are currently equipped with plastic skateboard wheels for tailwheels, even though that may not have been the part that was originally prescribed.


How would the fresco in the Hall of 500 be repaired after Vayentha fell through it?

Question: When Robert Langdon and Sienna Brooks are above the Hall of 500, Sienna falls down to the floor. She is unhurt, and shortly later, Vayentha comes in and attempts to kill Langdon. Sienna pulls Vayentha down, and she (Vayentha) falls straight through the floor into the Hall of 500. It is very clear that the fresco is very, very badly damaged. How would it ever be repaired? Would Langdon ever let Sienna do such a thing?
Answer:
Would Langdon ever let Sienna do such a thing?

In matter of life and death he would let her do because for him any piece of art is less valuable than life (also true in real life ).
Following instances support my above statement.

In Da Vinci Code Langdon throw away the Cryptex for saving Sophie Neveu's life.
In Angels and Demons he tore apart a page from Newton's notebook because there was less time.
Also in Angels and Demons he tried to break glass wall of Vatican's library when he was suffocated inside.

A piece of art will not matter when someone is trying to shoot you. Your flight and fight response will always be in favor of saving life first.

How would it ever be repaired?

Conservation and restoration of paintings

The conservation and restoration of paintings is carried out by professional painting conservators. Paintings cover a wide range of various mediums, materials, and their supports (i.e.- The painted surface made from fabric, paper, wood panel, fabricated board, or other).
Comment: I get the second part, but don't you think the first part should be stressed more here? How would it be repaired?
Comment: @AravindSuresh: If you are thinking it was a real ceiling it wasn't. It's CGI.
Comment: Of course it's CGI.
Comment: @AravindSuresh: Check my modified answer. I have linked how conservation and restoration of art materials is done.


does dell have a utility to update all drivers and firmware for my server?

Question: I installed Dell Openmanage Server Administrator, and while it'd show me version numbers of firmware, it wouldn't tell me they were out of date/an update was available.
Does Dell have something that'll do this?
Answer: Yes they do. It's called Server Update Utility.
Answer: You can also use Dell Repository Manager.
This will bring the firmware packages from Dell on your own machine and build a bootable disk that will take care of all the upgrades.
This will require a reboot of the server and the CD will run smoothly, doing all your upgrades (you don't need to do anything).
A walkthrough can be found here:
http://lonesysadmin.net/2011/03/07/the-easiest-way-to-update-a-dell-servers-firmware/
Answer: Check out this Dell article:
http://www.dell.com/Support/Article/us/en/04/SLN296511
Basically they post a bootable ISO for every server updated up to once a month on more active machines (there is a list of machines there).
URLs look like:
https://dell.box.com/BootableR520
Anyways, these ISOs try to install every single update for a machine.
I would always update the lifecycle, idrac and bios as well as PERC/RAID firmware the old fashioned way, then run something like this. Ive seen a lot of Dell servers brick themselves with bulk updates that involve simultaneous upgrades to BIOS/iDRAC/lifecycle/PERC so do those the normal way or through lifecycle manager.
Answer: Others have mentioned the SUU for 1:1 updates and the IT Assistant for centralised management. There are SUU ISO's available for download for all Dell Servers.
If you have a recent (11G) server - like the R310\410\510\R610\R710 then you also have the option of using the built in LifeCycle Controller\Unified Server Configurator. Press F10 at boot and you have a built in version of the SUU plus some more. The USC can be configured to directly synchronize with the Dell ftp site or a controlled staging area and will let you download and patch all of the embedded components (BIOS, controller Firmware, iDRAC and the LifeCycle Controller itself). There have been many improvements to the capabilities in recent updates (roll back of firmware updates, automatic configuration and firmware updates on part replacement for example) so it's a good idea to update the LifeCycle Controller first if there is a new version available.
Answer: There's the SUU if you want to update one server, and IT assistant for centralised updating (and monitoring) of many systems.
Answer: SUU is still available but it is a huge download, and dell's server is slow.
You can alternately install "Dell Repository Manager", which will let you download the firmware for the particular machines you have, rather than everything in their catalog.


Help in self-studying mathematics.

Question: Is this a reasonable list for who seek to learn mathematics by "self learning" program?
and is it a well sorted list to follow?
http://www.math.niu.edu/~rusin/known-math/index/index.html
Comment: It depends on what you mean when you say "learn mathematics". What mathematics are you interested in? What is your actual level?
Comment: Does this answer your question? [Learning mathematics as if an absolute beginner?](https://math.stackexchange.com/questions/22513/learning-mathematics-as-if-an-absolute-beginner)
Answer: Our very own Pete Clark, now of the University of Georgia faculty, was once upon a time a very talented undergraduate student at the University of Chicago. Back then, he and several of his fellow U of C honor students compiled a list of their recommended textbooks at various levels and posted it online. It does need to be updated, but I think you'll find it quite helpful. In fact,I've been asking Pete to revise it for a few months now. I hope he'll eventually find the time to do so.
Here it is:
http://www.ocf.berkeley.edu/~abhishek/chicmath.htm
Comment: The person who originated the Chicago mathematics bibliography, Chris Jeris, has contacted me to tell me that he is trying to revive it.  I don't have the details on hand at the moment, but probably an internet search will suffice.
Comment: @Pate Thanks for the heads up-I just might drop your old classmate an email asking him if he'd like me to contribute.
Comment: thank you can guys for help, i appreciate it.
Answer: Dave Rusin's web site contains many interesting nuggets of information, but it is not, and is not meant to be, a coherent course of study.
Answer: The list you provided is quite concise. Notice however that a reasonable load of classes would be something like 4 per semester so with a 4 year program, you will cover around 32 of the list at best (unless you skip around). That's why you should just cover basic core classes first (real analysis, complex analysis, algebra, ODE/PDE, etc).
MIT Open Courseware will have a broad range of lists that include topics you listed and you can find lists of courses by going to any university mathematics program website and looking at the curriculum requirements (which will usually have a suggested program).
Comment: I must disagree Khan Academy is a good resource.
Comment: i am looking for a chronological list of mathematics topics to follow as a guide. if you can take a look at the link provided and tell me if it's a good list to abide by.
Comment: Pardon, I read the question incorrectly.
Comment: Honestly, google searches for lecture notes tend to be much more useful than the notes at MIT Courseware. They do have nice video lectures though.

Help in self-studying mathematics.


In Micah 7:6 why are "the peoples of your house your enemies"?

Question: in Micah 7:6 we read:

אֹיְבֵי אִישׁ, אַנְשֵׁי בֵיתוֹ

loosely translated as: the enemies of a man, the peoples of his house
Why would this be so? What is the context here?
Comment: Michah is describing how evil his society become: "The godly man is perished out of the earth...they all lie in wait for blood...the best of them is a brier...for the son dishoroureth the father, the daughter riseth up against her mother...a man's enemies are the men of his own house" (JPS). Does this answer your question or are you looking for something else?
Comment: @Amichai I am trying to understand why this specific example is used (one which I don't believe is found elsewhere in the old testament). Even in an evil society you wouldn't expect a person's own family to be his enemies.
Comment: To me this seems like a perfectly reasonable hyperbole.
Answer: In context, the phrase seems to be the culmination of a series of illustrations of the depravity surrounding the prophet:

The best of them is like a brier,
    the most upright of them a thorn hedge.
The day of your watchmen, of your punishment, has come;
    now their confusion is at hand.
Put no trust in a neighbor;
    have no confidence in a friend;
guard the doors of your mouth
    from her who lies in your arms;
for the son treats the father with contempt,
    the daughter rises up against her mother,
the daughter-in-law against her mother-in-law;
    a man's enemies are the men of his own house.

—Micah 7:4-6 (ESV)

Some translations render this as "his own servants" or otherwise indicate that it isn't referring to blood relatives.  That might be a good translation, but the previous lines indicate that close relatives, even spouses, are under suspicion of doing harm.  We see similar warnings elsewhere:

Let everyone beware of his neighbor,
    and put no trust in any brother,
for every brother is a deceiver,
    and every neighbor goes about as a slanderer.

—Jeremiah 9:4 (ESV)

And:

Even my close friend in whom I trusted,
    who ate my bread, has lifted his heel against me.

—Psalm 41:9 (ESV)

A number of passages in the Hebrew scripture draw a disjoint between trusting people and trusting God.  For instance:

Thus says the LORD:
"Cursed is the man who trusts in man
    and makes flesh his strength,
    whose heart turns away from the LORD.
He is like a shrub in the desert,
    and shall not see any good come.
He shall dwell in the parched places of the wilderness,
    in an uninhabited salt land.

—Jeremiah 17:5-6 (ESV)

The next stanza echoes Psalm 1, which compares a person who trusts in the Lord to a tree planted beside a stream.  Jeremiah continues by saying that even our own hearts can deceive us.  By implication, the only person we can trust is God; we are, in a sense, our own enemy.  The call to trust God (and Him alone) is pervasive in the Bible.
Conclusion
Micah speaks within a long tradition of warning Israel against its sins.  While it might seem that as God's chosen people, an individual could trust that if they followed the rest of their culture, God would approve their actions.  But Micah warns that trusting your neighbor and following their example can be dangerous since even the best can be a metaphorical snare.
Comment: This constellation of texts gets some attention in this article: D.J. Reimer, "[Interpersonal Forgiveness and the Hebrew Prophets](http://books.google.co.uk/books?id=6L73DjDjjSIC&lpg=PP1&pg=PA81#v=onepage&q&f=false)", in *[Prophecy and the Prophets in Ancient Israel...](http://www.amazon.com/dp/0567473643/)*, ed. by J. Day (T & T Clark Int'l, 2010), pp. 81-97. FWIW!
Answer: This appears to be an allusion to:

[Exo 32:25-29 NLT] (25) Moses saw that Aaron had let the people get completely out of control, much to the amusement of their enemies. (26) So he stood at the entrance to the camp and shouted, "All of you who are on the LORD's side, come here and join me." And all the Levites gathered around him. (27) Moses told them, "This is what the LORD, the God of Israel, says: Each of you, take your swords and go back and forth from one end of the camp to the other. Kill everyone--even your brothers, friends, and neighbors." (28) The Levites obeyed Moses' command, and about 3,000 people died that day. (29) Then Moses told the Levites, "Today you have ordained yourselves for the service of the LORD, for you obeyed him even though it meant killing your own sons and brothers. Today you have earned a blessing."

In the momentary absence of Moses (which was a type of Christ's hiatus as he went to "receive a kingdom") the Israelites are transformed from the LORD's flock into a wild, idolatrous fools. The picture is Moses arriving on the scene and discovering a frat party or a rave. So Moses gathers the faithful to slaughter the vile mob. In return God gives them a blessing. Jesus is predicting that when he returns with his saints in 70ad in flaming fire to take vengeance on the Jews who rejected him, the saints who turn on their brethren and kill them will be blessed.

[Luk 19:11-19 NLT] (11) The crowd was listening to everything Jesus said. And because he was nearing Jerusalem, he told them a story to correct the impression that the Kingdom of God would begin right away. (12) He said, "A nobleman was called away to a distant empire to be crowned king and then return. (13) Before he left, he called together ten of his servants and divided among them ten pounds of silver, saying, 'Invest this for me while I am gone.' (14) But his people hated him and sent a delegation after him to say, 'We do not want him to be our king.' (15) "After he was crowned king, he returned and called in the servants to whom he had given the money. He wanted to find out what their profits were. (16) The first servant reported, 'Master, I invested your money and made ten times the original amount!' (17) "'Well done!' the king exclaimed. 'You are a good servant. You have been faithful with the little I entrusted to you, so you will be governor of ten cities as your reward.' (18) "The next servant reported, 'Master, I invested your money and made five times the original amount.' (19) "'Well done!' the king said. 'You will be governor over five cities.'


Upgrading the Greater Totem ward trinket

Question: At level 9, you can upgrade Greater Totem to either Greater Vision Totem (1 pink, permanent) or Greater Stealth Totem (3 x 3 min wards). How should I decide the upgrade path to take, and as a non-support when should I consider paying the 475g for an upgrade?
Answer: If you are a non support you have 2 options:
First option
Sweeping lens (most commonly used in higher elos)
You can switch your trinket for a sweeping lens to clear wards. This allows more baron control or you can clear wards to force a enemy to come near a bush so you can kill them. Of course you don't want to use it versus a team comp that has champions who can easily check a bush on high range (Lux/Lucian for example)
Second option
Vision ward
If you need permanent map control and/or the cleanse of a normal ward you can use a sight ward. If positioned right a sight ward can grant you vision for a really long time (deathbush for example). I usually take this option on most non supports, since you got a permanent ward on comparatively low cooldown and you can also clear a dragon/baron area. It just allows more utility.
Of course you can also upgrade it to a normal sightward but that isn't that benefitial. Of course it's a good thing if you are still in the laning phase after 30 minutes but generally the rule boot upgrades > trinket upgrade counts. And if you could afford both you can easily buy a chain west/pickaxe/blasting wand situational to the champ you are playing.
You usually want to upgrade your trinket last or if you got 475 gold to spend and you have no problem of farming that gold up again after you leave the base.
As a support both rules count but there are some exeptions
First option
Buy it if you are a support that relies on bush stealth (Blitz/Thresh/Leona) and you can instantly charge/grab an opponent that comes to close.
Second option
Buy it after you finish your sightstone so you have 3 normal wards and 1 pink ward almost all the time.
Comment: I always got the red trinket as support thinking yellow was useless after I got sightstone. Never thought about upgrading for pink wards, though they both serve similar purposes anyways.
Comment: Well you usually need a lens if you are vs teemo\vayne\akali or stuff like that. But yeah usually young get the lens since you get an oracle from it
Comment: It might be worth mentioning that if they don't clear out your pink ward the upgraded ward trinket becomes somewhat useless unless you want to replant the vision ward where the sweeping lense upgrade can be used everytime its up


Decompile Mac applications

Question: When I download Mac applications they come in a .app extension. When I right click and view package info I see a lot of files in it. What are these files? Does it
mean the apps are open source? Also how can I go about on decompiling an application? On Windows I was able to use s hex editor and decompiling sofware to mess with the internals in making the app do new things. How does it work on the Mac??
Answer: .app folders are called bundles. They are a simple presentation for application and allow easy move or uninstallation. Mac OS uses bundles in every places when it needs to show one entity that contains multiple files (Frameworks, Preferences Pane, Plugins, etc.).
See http://developer.apple.com/mac/library/DOCUMENTATION/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW13 to learn more about how they are structured.
Comment: This is a good summary, but I wanted to add that being able to view the files used by an application has nothing to do with that application being "open source." The license you obtained with your application should indicate whether or not it is open source, as well as other usage rights/restrictions.
Answer: Most applications on OS X are distributed as bundles, which looks like a file but is really a folder containing other files and folders. These "other" files and folders are resources used by the application. On OS X, resources (images, sound files, etc.) are distributed as separate files, rather than one big file containing all the resources -- thus you don't need a hex editor to view these resource files.
The contents of a <code>.app</code> bundle typically contain items like this:
<code>.app/                  <- The app bundle
  Contents/
    _CodeSignature/    <- Used to verify an application
    Frameworks/        <- Frameworks used by and distributed with the application
    Info.plist         <- Application metadata
    Library/           <- Files that enable various OS X functionality
      QuickLook/       <- Custom QuickLook renderers
      Spotlight/       <- Custom Spotlight importers
    MacOS/             <- Contains the actual binary code executed when double-clicking on the application
    PlugIns/           <- Application plugins
    Resources/         <- Resource files, such as icons, UI layouts, sound files, image files
</code>
Note that every application on OS X contains a layout like this, regardless of whether they are open-source apps or not.
Answer: .app "files" are folders containing multiple files. What you're seeing are the files distributed with the program, not the source code.
The best analogy I can think of is if Windows programs were distributed in .zip files and you just dropped them in C:\Program Files to install them instead of extracting them. (So the files you're seeing are the files you would see in that program's "Program Files\program name" folder on Windows)
Comment: Not really so much archives, as you can navigate into the .app directory directly at the command line, which you can't do with an archive.
Comment: @Matrix Mole, I haven't done any research on this, but I'd guess that that's just some OS X magic, like how Windows will let you treat Zip files as folders.
Comment: Nope, it's literally just a folder with a specific folder and file layout, and the info.plist combines it all together into a "virtual" file sort of, the icon file is in /Contents/Resources/APPNAME.icns and the info.plist points to that, which OS X then displays the folder as, making it appear to be a file, but in reality it's not.
Comment: @MarcusJ Ah, [so it is](http://en.wikipedia.org/wiki/Application_bundle#OS_X_application_bundles). Interesting. I guess that's why people distribute them instead a .dmg file..

Decompile Mac applications


Is infrared blocking film effective in reducing temperature inside a room?

Question: I was going to put a foil on windows, but found a film that is alleged to reflect rays from infrared spectrum, thus preventing 60% of sun heat of entering a room.
Any criticism on it?
Or personal experience? Will it really help?
Comment: 3M has a film that will do what you ask and it only tints the window a little
Answer: My house has no central air and lots of huge windows on the south, so it gets a bit toasty in the summertime.
I installed window film (brand is "Vista Window Film" if it matters).  I don't know what it does in terms of which part of the spectrum it blocks (IR or not?).
It has done a fantastic job.  It colors the view just a bit, though you only really notice when comparing against a non-tinted window.  Temperatures are bearable in the summer now.
Comment: Also, installing double pane windows specifically with e-glass will do the job quite well. If you walk past the windows in the morning, you will feel a beam of reflected heat due to them repelling infrared radiation transmission. You probably will notice a similar effect on windows with IR blocking film. Replacing all the windows with eastern exposure reduced morning room heating quite noticably which made for less heat in the afternoon.


Quickly testing a function that is a part of a big DLL project

Question: I use VS2010 for C++ development, and I often end up doing work in some dll project and after everything compiles nicely I would like to try to run dummy data on some classes, but ofc the fact that it is a dll and not an exe with main makes that a no go. So is there a simple way to do what I want, or Im cursed till eternity to c/p parts of a big project into small testing one?
Ofc changing the type of the project also works, but I would like to have some almost like iteractive shell way of testing functions.
Comment: Will then you could use the free open source version NUnit (http://nunit.org/). Also VS 2010 Pro does (http://www.microsoft.com/visualstudio/en-us/products/2010-editions/product-comparison)
Comment: Have you looked at Unit Tests?
Comment: afaik VS2010 in prof version doesnt have any UT capabilities. I could be wrong, like I said afaik.
Comment: Isnt NUnit just for .net, I use both native and .net(CLI) C++. Also check this out: http://msdn.microsoft.com/en-us/library/ms182532.aspx  It says perm or ultim
Comment: Well you do get Unit Test also according to Wikipedia (http://en.wikipedia.org/wiki/Visual_Studio#Editions). You should have access under the Test in creating new project both native and manage version (at least in VS 2012). Sorry I also assumed that you were using some .NET features but the Native version should work. However http://msdn.microsoft.com/en-US/library/ms243171(v=vs.100).aspx states differently...........GAHHHHH
Answer: I know this isn't a library or anything, but if you want to run the dll on windows simply without framing it into anything, or writing a script, you can use rundll32.exe within windows. It allows you to run any of the exported functions in the dll. The syntax should be similiar to:
rundll32.exe PathAndNameofDll,exportedFunctionName [ArgsToTheExportedFunction]
http://best-windows.vlaurie.com/rundll32.html -- is a good simple still relevant tutorial on how to use this binary. Its got some cool tricks in there that may surprise you.
If you are wondering about a 64-bit version, it has the same name (seriously microsoft?) check it out here:
rundll32.exe equivalent for 64-bit DLLs
Furthermore, if you wanted to go low level, you could in theory utilize OllyDbg which comes with a DLL loader for running DLL's you want to debug (in assembly), which you can do the same type of stuff in (call exported functions and pass args) but the debugger is more for reverse engineering than code debugging.
Answer: I think you have basically two options.
First, is to use some sort of unit tests on the function.  For C++ you can find a variety of implementations, for one take a look at CppUnit
The second option is to open the DLL, get the function via the Win32API and call it that way (this would still qualify as unit testing on some level).  You could generalize this approach somewhat by creating an executable that does the above parametrized with the required information (e.g. dll path, function name) to achieve the "interactive shell" you mentioned -- if you decide to take this path, you can check out this CodeProject article on loading DLLs from C++
Answer: Besides using unit tests as provided by CppUnit, you can still write your own
small testing framework. That way you can setup your Dll projects as needed,
load it, link it, whatever you want and prove it with some simple data as
you like.
This is valueable if you have many Dlls that depend on each other to do a certain job.
(legacy Dlls projects in C++ tend to be hardly testable in my experience).
Having done some frame application, you can also inspect the possibilities that
CppUnit will give you and combine it with your test frame.
That way you will end up with a good set of automated test, which still are
valueable unit tests. It is somewhat hard starting to make unit tests if
a project already has a certain size. Having your own framework will let you
write tests whenever you make some change to a dll. Just insert it into your
framework, test what you expect it to do and enhance your frame more and more.
The basic idea is to separate the test, the testrunner, the testdata and the asserts
to be made.
Answer: I'm using python + ctypes to build quick testing routines for my DLL applications.
If you are using the extended attribute syntax, will be easy for you.
Google for Python + ctypes + test unit and you will find several examples.
Answer: I would recommend Window Powershell commandlets.
If you look at the article here - http://msdn.microsoft.com/en-us/magazine/cc163430.aspx you can see how easy it is to set up. Of course this article is mostly about testing C# code, but you can see how they talk about also being able to load any COM enabled DLL in the same way.
Here you can see how to load a COM assembly - http://blogs.technet.com/b/heyscriptingguy/archive/2009/01/26/how-do-i-use-windows-powershell-to-work-with-junk-e-mail-in-office-outlook.aspx
EDIT: I know a very successful storage virtualization software company that uses Powershell extensively to test both it's managaged and unmanaged (drivers) code.


In a wireless network which is the Radius client, the switch or the wireless access point?

Question: I'm sorry if this is a noobish question. If you have some cisco switch connected to d-link wireless access points, which acts as the Radius client?
Answer: Whichever is acting as the "Authenticator" (https://en.wikipedia.org/wiki/IEEE_802.1X#Overview).

The main parts of 802.1x Authentication are:

A supplicant, a client end user, which wants to be authenticated.
An authenticator (an access point or a switch), which is a "go between", acting as proxy for the end user, and restricting the end
  user's communication with the authentication server.
An authentication server (usually a RADIUS server), which decides whether to accept the end user's request for full network access.

https://kb.netgear.com/1209/What-is-802-1x-Security-Authentication-for-Wireless-Networks
From this it looks like you can have the switch authenticate the access point (to prevent someone plugging in a different access point) but that the access point itself could be authenticating the clients too.
The switch would likely only authenticate what is plugged into it and I doubt would be wireless client aware.
See also : Does WPA2 Enterprise also authenticate clients to the 802.1X protected switch port?
Comment: What about this: http://www.cisco.com/c/dam/en/us/td/i/100001-200000/190001-200000/190001-191000/190652.ps/jcr:content/renditions/190652.jpg
Comment: LWAPP (en.wikipedia.org/wiki/Lightweight_Access_Point_Protocol) support appears to be required in that scenario. As the AP itself behaves like a switch (allowing more devices to connect) I looked up how 802.1x works with additional switches and found : https://networkengineering.stackexchange.com/questions/6162/how-can-i-implement-802-1x-when-i-need-to-use-intermediate-switches .. it looks like you certainly can chain.. hmm
Comment: Ah. So the Wireless Access Point can also act as a supplicant itself? Is that necessary?
Comment: If you're on a network that requires it before your AP can even communicate on the LAN then yes. Also it depends on your threat model, are you worried someone will plug in a rogue access point (in the lobby?) or is your AP in an area (data centre) that's not a risk? Here's how I'd configure a particular AP being a supplicant : https://supportforums.cisco.com/document/12559646/configure-8021x-supplicant-settings-wap131-and-wap371


What's the best practice for creating a cronuser for WordPress CiviCRM installs?

Question: I am working on setting up the cron job using cv on a fresh CiviCRM and WordPress install. The docs are unclear on where to set up the "cronuser" user (WordPress user? CiviCRM contact?) and how to set the permissions needed for the cron to run successfully.
Answer: The cronuser is a CMS user, so in your case a WordPress user.  I tend to give the cron user a strong password and don't use that user account for anything but cron.  As far as permissions, they need a good deal but it depends on the jobs running.  CivICRM for WP now has the ability to create a CiviCRM administartor role (in the menu under settings  /wp-admin/admin.php?page=civi_options) - I'd start with that and remove unneded capabilities based on your cron/scheduled jobs.
Answer: I think it depends on what cron solution you are using.
Since you say cv, I'll assume that you are running anacron or the like from the command line on Linux. I suggest that you run it as the user that owns the website. If you use Apache on Debian for example, the default web user is www-data.
In my case, for security reasons, I make the sites owned by a user I call www-dev and so I run the Civi cron jobs as that user.
You can access that user's crontab using sudo even if they aren't allowed to login like the www-data user: sudo crontab -e -u www-dev.
You just need to be sure that whatever user you choose has write capabilities on the directory.
As for the WP user, if you're using the command line I don't think it matters as you never provide the password on the command line. I just use my own admin account. For example I use a crontab entry like this:
*/5 5-22 * * *  /usr/local/bin/cv api job.execute --user=AdminUser --cwd=/var/www/wordpressroot > /dev/null

I suggest you set the MAILTO= in the crontab file as well so you get an email if there is an error.
Comment: This helped me immensely -- thanks for the description and clear example!


How does API request limit count

Question: Our org has hit API Request Limit again yesterday which is 25k in 24 hours. Since it is not a small number I am wondering how does that count. Suppose we were running a test class, how many API calls will be used? By understanding that we can analyse what is going wrong.
Answer: Every call to the API counts. This doesn't include test methods, because they can't call the API. API requests include Salesforce for Outlook, mobile apps, the Data Loader, etc. If many users are using Salesforce1, or if you have many integrations, such as synchronizing with Oracle or a third-party system, can consume many calls. For example, with a batch size of 200, if a user uploads 20,000 records, that is 100 API calls. A process that synchronizes just once every five minutes between Salesforce and an external system would use at least 288 calls per day, assuming no data was modified. It could easily be thousands of calls per day if there is a lot of activity in your organization. Apps that do not cache session IDs (e.g. those that login every five minutes when performing a sync) would consume extra calls. The Force.com IDE can easily consume hundreds of calls a day per user. You can work with Salesforce support to try and identify which apps or integrations are causing excessive API usage. The limit is aggregated every hour, and the last 24 hours are used for the total. This means if you use 10,000 calls in an hour between 12pm and 1pm, those calls will count against the limit until 1pm the next day. If this is an unusual case, it most likely has to do with a user uploading a large amount of data with the data loader.
Comment: Thank you for your reply. Our scenario is we four developers are all working on writing and testing unit tests yesterday which brings a large amount of API requests. We were using Mavensmate for the unit testing which I believe should be tooling API. But it shouldn't matter that much because I don't believe the execution of tests will count... Weird
Comment: Calling the tooling API *does* count, but the tests themselves do not. It's not usual to run up many thousands of API calls when using Mavensmate or the Force.com IDE. For this reason, you should develop using Sandboxes, and only deploy to production when you're ready.
Comment: I agree with you. But our scenario is a little bit complicated. We are using TSOs instead of sandboxes to develop code and doing version control using Git. I am just wondering why it has consumed thousands of calls
Comment: A single async deployment could run 50 calls or so if the servers are delayed significantly, since async deployments are polled periodically. You'll want to review your Mavensmate settings to see if you can reduce your calls.
Comment: Thank you for your reply. We still haven't figured out the reason but I think we are on the way now. Thank you for providing all the info which are greatly helpful.

How does API request limit count