Replace 3 way switches with Four way switch

Question: three way switchesI have two three way switches operating two different lighting circuits in a 2 gang box. Power feed for both circuits is in the same box.
Is there a way to combine both circuits and replace the two 3-ways with one 4-way switch?
Comment: Conceptually: Left box = lights 1, right box = lights 2, middle box = power in for 1 and 2. So the key question is: Do the common wires (switched hot) from left and right come back to the middle and go from there to the two sets of lights? Or does the common wires and neutrals extend from left to lights 1 and from right to lights 2? If it is the first (commons back to middle) then this should be trivially easy. If it is the second then it gets quite a bit more complicated.  **Switch box pictures showing wires/cables would help a LOT.**
Comment: Please see pics.
Comment: two gang box has two three way switches.  power comes into this box and is jumpered to commons on both switches, neutrals from both lights are wire nutted to the feed neutral.
Comment: There are two switches like the second pic. One for each light system.  I'm confusing myself!  This is a 3-way switch system at the top and bottom of my stairs that operates a light in the stair well. Another 3-way switch system at the bottom of stairs and the outside basement door that operate the basement lights.  Power comes into the two gang box at the bottom of the stairs.  I want one four way switch system.  one switch at the top of the stairs, one at the bottom and one by the door.  All switches will turn all basement and stairwell lights on and off
Answer: Since this is all on a single incoming feed...
Since you have a single incoming power feed, you should be able to take the incoming hot, send it to one of the three way switches, then have the travelers come to a 4 way in the middle of the box, and then send them off to the other 3-way and get your load back from that to split to the two outgoing lighting feeds.
If this was two separate circuits...
Merging two 3-way switches for two separate circuits into a single switch is possible, but requires an actual DPDT switch such as a Leviton 1282, not a 4-way switch.  Note that the 1282 has a center position that is totally OFF; this may be desirable, or simply something you'll have to work around.
You would also need to handle-tie the breakers for the two circuits together as per NEC 210.7, which may require moving breakers around in your panel:

If two or more branch circuits supply devices or equipment on the same yoke or mounting strap, a means to simultaneously disconnect the ungrounded supply conductors shall be provided at the point at which the branch circuits originate.
Comment: One breaker, power is split in switch box
Comment: @Gary -- updated, although photos of the insides of the switch boxes would certainly be helpful (don't have remote X-ray vision to see what's going on over at your place!)
Comment: I misspoke when I said two circuits.  It is one breaker feeding the switch box and then power is jumpered between the switches so the breaker box will be fine.
Comment: I'm trying to find a wiring diagram for such an arrangement, could you provide one?
Comment: I'm trying to have one 4 way setup to turn on both lights. I want all lights to be off or on together
Comment: @Gary -- if they're on two separate circuits from the panel, then what I've described is the best you can do without relay or smart-switch wizardry.
Answer: Based on comments, the three boxes are: top, bottom, outside. Top and outside each have a switch and an onward cable (switched hot/neutral) to lights. Bottom has incoming power and a switch & cable to top and a switch and cable to outside.
There are certain configurations where this might work without new cables. I don't think this is one of those configurations. The basic problem is that you have three wires (ignoring ground) between the various switch boxes. Two wires in each are travelers, which in theory could be travelers to a bottom 4-way switch instead of to a pair of three way switches. However, you also need:

Neutral going to each light fixture via top and bottom.
Hot going to one 3-way switch (let's put it to top).
Switched hot coming from the last 3-way switch (outside) to all the lights - which means a wire looping back from outside to bottom to top.

That means 5 wires (traveler 1/traveler 2/neutral/hot/switched hot) from bottom to top and 4 wires (traveler 1/traveler 2/neutral/switched hot) from bottom to outside. 5 > 3, 4 > 3 - so this just doesn't work.
If this were a new installation, it would be done a bit differently, but would still probably need either 4-wire cable or in some sections both a 3-wire cable and a 2-wire cable. There is no easy way to do this kind of retrofitting.
Smart Switches to the Rescue
The solution is to use smart switches. Put the "main" switch at bottom, replacing the two 3-way switches in that box. We know that has incoming power and cables to the other boxes. Rewire the cables so that you have a simple hot/neutral/switched hot to top and outside. Then, depending on the type of smart switch, you either put in a "battery powered remote that looks like a regular switch" or a powered remote that gets hot/neutral but doesn't actually switch any hot lines. Those two switches (top and outside) simply signal the main smart switch (either wirelessly, which usually does not mean WiFi, or over the power line) to toggle the lights in a manner similar to a traditional 3-way/4-way set of switches.
There are a number of different smart switch varieties available. I won't recommend one because (a) we usually don't do that here as such items change and so the answer becomes obsolete quickly and (b) I don't have any specific ones to recommend at the moment. But if you pick one and want to know if it will work, feel free to ask about specifics.


How can I download correct versions of mscordacwks and mscorwks?

Question: I am trying to analyze an IIS memory dump usinf Windbg and SOS and ran into an issue with version of files mentioned above. My question is - is there a way I can download the different versions of these files? Assume that I have no access to the server and cannot copy them from the server. The versions I am specifically interested in is
mscordacwks_x86_x86_2.0.50727.3603 and the corresponding mscorwks dll.
Comment: Just adding this note - When all else fails, follow instructions :). Setting up the symbol path in Windbg (srv*c:\symbols*http://msdl.microsoft.com/download/symbols)
 will ensure that correct version of the mscodacwks is loaded.
Comment: I assumed you had already done that. However, in some rare cases this doesn't work and then you basically have to obtain the specific version manually.
Comment: You don't need mscorwks.dll as it will already be part of your dump file, but you do need the correct version of mscordacwks.dll.
Answer: For me, the following downloads the correct version of mscordacwks in WinDbg:
<code>.symfix c:\symbols
.cordll -ve -u -l
</code>
Using WinDbg 6.2.9200.16384 and a dump with .NET 4.0.30319.296 / 4.0.30319.18034. Unfortunately I don't have a .NET 2 dump available with different .NET version than on my machine.
For those who have access to the PC where the dump comes from, you can try Mscordcwks collector.


Is the mirror Captain Philippa Georgiou a member of Starfleet?

Question: The crew addresses her as Captain Georgiou several times in Such Sweet Sorrow but she has no uniform. Why is she still wearing s&m gear and being addressed as "captain" on the bridge of the Discovery?
Comment: This was explained in season 1. In order to allow her to work for Starfleet and keep the mirror universe a secret, she's posing as the Prime Universe Georgiou who they claimed was not dead but was rescued.
Comment: @BrianOrtiz Please make your last comment an answer.
Answer: Mirror!Georgiou negotiates with Sarek the terms of her freedom in "The war without, the war within":

GEORGIOU: You face annihilation. Is it not logical to do anything you can to save the lives of your kind? Give me what I want, and I can assure victory for the Federation.
SAREK: What are your terms?
GEORGIOU: Freedom.

As a result, Mirror!Georgiou is now posing as the real one, as seen in the last scene of that episode. The speech given by Admiral Cornwell strongly implies that this move is a desperate measure taken by Starfleet:

CORNWELL: Open a shipwide channel. We have all mourned the enormous loss of life due to this war. The acts of violence committed against us are the acts of a foe without reason, without honour. And they will not stop coming after us in the hopes of destroying everything that we hold dear. These are desperate times, and they call on us to do more than merely protect our people, defend our borders. (...) . So allow me to introduce you to the person who will chart your course to Qo'noS. Captain Philippa Georgiou.
GEORGIOU: Thank you.
CORNWELL: Though long presumed dead, Captain Georgiou was recently rescued in a highly classified raid of a Klingon prison vessel. She was transported aboard Discovery with my personal retinue. The mission to Qo'noS is a perilous expedition, and Starfleet is confident that Captain Georgiou is uniquely qualified to get you there and to do what needs to be done.
GEORGIOU: Specialist Burnham, I trust that this will be an auspicious reunion, despite our history. Now take your station.
BURNHAM: Yes, Captain.

So in short: Mirror!Georgiou is posing as the real Georgiou, who is still a member of Star Fleet.


What do I need to change in Box2D to work in pixels?

Question: Box2D seems to be set up in such a way that you cannot work in pixels (i.e. physics scale = 1). It produces very strange results as it hits maximum speed limits at low speeds and looks very strange. It only seems to work well at a physics scale of around 15 or 30. For me, working in pixels is the logical way to handle physics and movement in a game, as you are already using that measurement for lots of other things. I don't want to have postionX/30 all over my code, so what variables do I need to hack in the box2d source in order to make physics scale 1 work as if it was physics scale 30? I'm using the latest version from box2dflash.org.
Comment: In my experience the best thing to do is isolate the conversions to as few places in your code as possible, and learn and stick to the range of values that you find Box2D works best with. Or, of course, utilize a different physics engine.
Answer: I would advice against changing it, for a couple of reasons:
1) It might not be a trivial task; it's been a while since I last used Box2D, but I don't think it has changed much regarding that.
2) Using pixels can lead to very (I mean, VERY) large numbers, and to some computation errors.
Instead of having posX/30 all over your code, as you said, ¿why not try something like a static method ToPixelUnits (or whatever), which returns the pixels, so that you can use it when displaying things on the screen?
Comment: Also, you could try to create a Camera class (I was refraining myself from using OOP, but what the heck...), which handles the drawing. In each loop, you could pass a reference to the world to it, and then the camera would take care of the rest. Something like:  camera.draw(w) ===> void draw(World w) { for (Entity e: w.entities){ e.draw(e.posX/30, e.posY/30);}
Comment: Because for games when you want the highest performance possible, calling a method instead of using a static var is too costly.
Comment: @AttackingHobo: True, but nowhere in the question did he mentioned performance, so I opted for an easy, maintainable solution.
Comment: A CONSTANT value for a multiplier would work as well, and for the same effort yield faster code while even being easier to maintain.
Comment: @AttackingHobo: Fair point, that should do as well.
Answer: I have implemented a ratio variable on items/entities/objects. So whenever you need to update the sprite position for an "item" you use the ratio to determine the visual position in pixels. Then you don´t need to convert the units in box2d.
private function updateSpritePosition() : void
{
    _sprite.x = _body.GetPosition().x * _ratio;
    _sprite.y = _body.GetPosition().y * _ratio;
}

Answer: You can try what Gaston suggested or design a very simple class that takes care of the conversion implicitly** when you pass in the position values from Box2D (the class can also have overloaded operators to make the conversion even simpler). All your 'pixels' can then inherit from this class (or use it directly if they are not doing anything special). This will make your code look less cluttered as compared to function calls and also more scalable.

** by implicit I mean you will have to perform the conversion manually and in such a way that when a function such as SetPosition() is called, it performs the conversion which is then transparent to the client who is using the new 'pixel box 2D object'


My ubuntu on PC boots to a black screen, after installing firmware-b43-installer

Question: I wanted to make a hotspot and to solve a problem I ran the following command:
sudo apt install firmware-b43-installer
and rebooted the machine to see the effects, but I got a black screen, I can hear the drum sound prompting me to log in. I think the OS boots successfully but with a black screen. My ubuntu was 16.04, after this issue, I took that into recovery mode and upgraded it to 18.04, but the problem's not solved.I read this thread and some other posts but they didn't help me. Also I set nomodeset in Grub but I couldn't fix the main problem. So, my question is; how can I fix the black screen. I'm not very good at Linux.Any suggestions are welcome and thank you in advance!
Answer: The issue has fixed using the following page:
How to Fix Display Problems on Ubuntu
Thanks a lot her/him.


Array of abstract class

Question: Why can I not instantiate an abstract class but make an array of the abstract class?
public abstract class Game{
  ...
}

Game games = new Game(); //Error
Game[] gamesArray = new Game[10]; //No Error

Comment: Because you can put a all the subtypes of `Game` into the array, but an abstract class may not be instantiated as it is "incomplete".
Answer: Game[] gamesArray = new Game[10];

Instantiation means creation of an instance of a class. In the above scenario, you've just declared a gamesArray of type Game with the size 10(just the references and nothing else). That's why its not throwing any error.
You'll get the error when you try to do
gamesArray[0] = new Game(); // because abstract class cannot be instantiated

but make an array of the abstract class?

Later on, you can do something like this
gamesArray[0] = new NonAbstractGame(); // where NonAbstractGame extends the Games abstract class.

This is very much allowed and this is why you'll be going in for an abstract class on the first place.
Comment: No @Nitin, it's not really about declaration vs instantiation.  Writing `new Game[10]` instantiates an array - it just doesn't instantiate any Games.  The _declaration_ part is where you wrote `Game[] gamesArray`, which declares a variable of type "array of Games".
Answer: Because when you make an array of some object type, you're not trying to instantiate the objects.  All you're making is a number of slots to put references in.
new Game[10]; makes 10 slots for Game references, but it doesn't make a single Game.
Answer: Because you don't violate the abstract class rules.Essentially,
Game games = new Game();

is broken down to:
Game games; //Will Work because it's just a declaration
games=new Game(); //Will not work because it's instantiation

While creating objects is perfectly valid for abstract classes, initializing is not permitted.
Answer: - An Abstract class is one whose instance CANNOT be created.
- Creating an Array which holds the Object Reference Variable of that Abstract class are just the references not the object itself.
- An Abstract class as well as an Interface in Java is used for implementing behaviors which keeps changing. Consider the Abstract class like laying down some protocols for its concrete classes.
Eg:
public abstract class Vehicle{

}

public class Car extends Vehicle{

  public static void main(String[] args){

       Car car1 = new Car();         (Possible)
       Vehicle car2 = new Car();     (Possible)
       Vehicle car3 = new Vehicle();     (NOT Possible)

   }

}

Comment: `Vehicle car2 = new Car();     (Possible)
Vehicle car3 = new Car();     (NOT Possible)` How are these two statements different?
Comment: @Prateek... sorry dear.. it was a typo from my side.. i have corrected it... thanks for detecting the typo
Answer: Abstract classes cannot be instantiated, they can be extended.
Arrays are in fact objects, you just say to your JVM : hey buddy, make some room for 10 Game objects. That's all, you don't instantiate any Game objects.
Answer: Game games = new Game();
This is creating instance of Abstract Class Game which is not allowed.
Creating array with following
Game[] gamesArray = new Game[10];
is just as a declaring Game Object here it is not creating instance.
like Game game;
Either you declare 10 object of Game class or crating array of game both are same, just allocation of memory will be different.
Thanks
Tej Kiran
Answer: Abstract Class as name implies can't be instantiated. When you did Game[] gamesArray = new Game[10]; it is creating an array which can hold Game references. Lets try to relate it to a real life scenario.
Say you have an abstract class Animal. You can't instantiate it as animal is not a concrete class so Animal obj = new Animal() would fail. But Animal[] animalArray = new Animal[10] would create an array which can hold references to 10 animal type objects like dog, cat, horse and so on.
Answer: Abstract classes do not have methods entirely fleshed out. They are used as base classes that would be further extended by other classes that "inherit" them.
For instance, you can have an abstract class called Pet.
   public abstract class Pet{
        private String name;
        public void setName(String name){
             this.name = name;
        }
        public String getName(){
             return this.name;
        }
        abstract String makeNoise();
   }

That can be extended by inherited classes:
    public class Cat extends Pet {
         public Cat(){ ... }
         ...
         public String makeNoise(){
              return "Meow!";
         }
    }
    ...
    public class Dog extends Pet {
         public Cat(){ ... }
         ...
         public String makeNoise(){
              return "Bark!";
         }
    }

From there, you can have things in your code such as:
    Pet thisPet = new Dog();
    ...
    thisPet = new Cat();

And you can create arrays of Pets which would take in both Cats and Dogs as acceptable elements.
    Pet petArr[] = new Pet[2];
    petArr[0] = new Cat();
    petArr[1] = new Dog();

For more information, I'd recommend you look at the java tutorial section covering abstract classes here.

Array of abstract class


How to develop a real time file upload with Angular 2 and Node.js?

Question: Usually, while we upload it takes files to the temp directory first and then move it to the desired directory. But I'm working on Big Data e.g. uploading thousands of files at once. So I need to upload those files directly to the desired location and as each one of them uploaded to that directory, the user must see the changes on the dashboard in real time.
Also I need to show user

If any exception has occurred while uploading e.g. if a file causing a problem in the uploading process.
There should be an option to skip that file or retry upload.
Report to show the list of files uploaded successfully vs files that failed to upload.
If there is any network outage, the upload manager should keep retrying until the network is restored.
User can pause upload and can restart it on next login(if it is feasible)

This is about full manipulation of the upload process to give user the best user experience while uploading large sets of data.
Answer: You can use ng2-file-upload, it has most of the feature you require.
You can also find demo here.
For rest of the features you require, you can implement those on top of this library (It's better than writing your own code from scratch).


Helvetica-font-not-embedded

Question: I am writing a book using times font. It has MATLAB codes. I have used the listing package for generating matlab code in latex.
For the remaining text I am using times package.
But while trying to publish the book I am getting the error helvetica package not embedded. I do not want to use helvetica font as the publisher has a problem with that font. Can someone explain what is font embedding and how can I remove the Helvetica font.
Comment: Welcome! Can you explain a bit more or show us the error ? So you compile your file with no problem and in the procedure of publishing you see this error on somewhere else compiler ??
Answer: The problem may not be the Matlab code listings, but the figures from Matlab (and exported in EPS format) that you may be included in your document. When Matlab generate the EPS file, it does not embed the font used for the text labels of the graph (title, ticks, legend,...) In theory, you can instruct to Latexpdf, or latex+dvips+ps2pdf, to embed all fonts, but my experience is that the fonts used in included graphs usually are not embedded.
The best option is embedding the fonts in each figure, as is pointed here:
<code>ps2pdf13 -dPDFSETTINGS=/prepress fig_non_embedded.pdf fig_embedded.pdf
</code>
If the document cannot be generated again, this response can help to fix the entire document:

How do I embed fonts in an existing PDF?
Comment: I used the ps2pdf13 command given above but it gives error: Error reading a content stream. The page may be incomplete. File did not complete the page properly and may be damaged. How can I resolve it
Answer: I had this problem on a Mac with a PDF I was submitting to IEEE. Using Adobe Reader and Preview, I was able to get around this. I think any pdf printer might work in place of Preview if you are on a PC.
Here are the steps I took. You can individually fix each figure, or fix the whole document.

Open at pdf file using Adobe Reader.
Right click on image, and click "Document Properties."
Click "Fonts." Check to see if the font isn't embedded. Should say "Courier" or other font name.
If your pdf isn't a standard page size, click on "Description" and look at the page size. Write this down. Ex. 19.4 x 5.22 in.
Open the pdf up in Preview. Go to File->Print. If using a pdf that isn't a standard page size, click on Paper Size and choose custom. You will need to create a custom page size that is equal to the one you wrote down in step 4. Don't forget to zero the margins to 0 for all sides. After doing that, you'll need to set the scale of the print in the print dialog to 100%.
In the lower left of the print dialog (in Preview on a Mac), click "PDF" to print the PDF to a new PDF. Select the destination and print.
Open the new pdf up in Adobe Reader and verify that the fonts are now embedded.

I hope this helps.
Answer: One trick proved to be useful.
You can open your eps files generated from Matlab with a notebook, and replace all Helvetica into Arial. Then compile again to generate a pdf.
It works now!

Helvetica-font-not-embedded


How can I retrieve mail from an Exchange 2007 server?

Question: I need to write an application that can read email and attachments from a mailbox in Exchange 2007. What is the best way to do this? Outlook Redemption works, but is there a better way?
Answer: You could simply us POP3 or IMAP to access the mails on the Exchange server.
Depending on your environment you would probably find libraries that provide POP3 or IMAP implementation.
Comment: This would require the Exchange Server to have the IMAP access set up (which I know some Exchange environments refuse to enable).
Answer: There are several ways to do this. Starting from POP3 or IMAP (as indicated by Dominik) to more powerful options such as the ones listed at Exchange Development Technologies.
I would avoid starting new developments with APIs that are being phased out by Microsoft, so you may want to take a look at the Exchange Server 2010's version of the article above.
A safe bet would be to use Exchange Web Services (a.k.a EWS). You should be able to program against it using any language capable of doing SOAP Web Services.
If you are programming against .Net Framework 3.5 or above and Exchange Server 2007 SP1 or above, you can use EWS Managed API which is the client-side API for EWS and offers a much cleaner experience than the one provided by auto-generated web service proxies (via Add Web Reference menu item).
Answer: Use Microsoft Exchange Server MAPI Editor (MFCMAPI) which is a great tool to retrieve MSG (or EML) files.
I personally use the cfexchangeConnection in coldfusion to reach out to mailboxes (as well as all other items in exchange)


What is the difference between どうしたって and 是非?

Question: I have recently stumbled across the word どうしたって which according to the dictionary means "by all means, no matter what, at any rate". I was wondering how its usage differs from 是非 "certainly, without fail" as they both have very similar meanings. Does one have a positive connotation and the other negative? Are they interchangeable or not? If anyone could tell me the difference I would greatly appreciate it.
Comment: Welcome Ethan!  Though your intro and greeting were definitely well-received, I have edited them out because we tend to keep questions as brief as possible and to the point.  But this is certainly a good question, and the type of content we enjoy around here.
Answer: You are close. These are used in different types of sentences.
どうしたって (or どうしても) is usually followed by something undesirable or inevitable.

どうしたって無理だ。
No matter what, it's impossible.
他人の気持ちを理解するのはどうしたって難しい。
At any rate, it's hard to understand the feelings of other people.

是非 is an adverb that is used exclusively when you strongly invite or recommend something. I feel it's weaker than 必ず ("without fail"), though.

是非パーティーに来てください。
Please come to our party!
このゲームは是非プレイするべきです。
You should definitely play this game.
是非!
Yes, please do! / Definitely!
(after being asked whether they should do something)

(Note that both どうしたって and 是非 have other usages.)
Comment: @istrasci 是非とも is simply stronger, but I think 是非 is usually enough. Overusing 是非とも may sound like a salesperson's talk.
Comment: @OtheJared 是非 is not particularly formal, but something like 絶対 may be preferred in slangy speech.
Comment: Does 是非とも carry any additional weight over just 是非?
Comment: Would you ever say 是非 with friends or is it mainly for polite speech?


No operating system/no anything!

Question: I have a Samsung Galaxy s3  SGH-I747, I had rooted the phone and had success and tried different ROM's before deciding one I wanted to go back with and stick with.  I had booted my phone into recovery however and left it laying out (ADHD sidetracked me) returned and discovered a friend had accidentally wiped everything- INCLUDING MY BACKUP-he thought I said the backup was on the external sd card, which he noticed wasn't in.  So I have no back-up, no operating system and no firmware because of something with Kies? (it says this on the phone screen???)  which has me completely baffled, because I rooted with Odin.  So, no os, no rom, nothing.........what do I do?
Comment: First, what exactly is the message you get on the phone screen?
Comment: can you enter into recovery mode?
Answer: Copy a ROM from your PC to your phone. Flash the ROM in recovery. You may have to reinstall the Samsung drivers on your PC.
Don't worry about this. You still have recovery intact. Keep yourself a SD card with a ROM and GApps on it.
<code>*Always Do a Backup*</code>

No operating system/no anything!


Why does my Photos library differ in size looking in Finder vs in the "Get Info" of Photos?

Question: Hopefully I am under-thinking this issue. I've been going through my Photos library, deleting duplicates and lame pictures. When I went to look at the total library size, I got a different calculation in the Photos app compared to Finder. Photos says the library size is 603GB and Finder says it is 665GB. What is taking the extra 60GB? Is there something I'm missing here? Thank you for your help!
Answer: I assume Photos is reporting the total size of all the pictures (and just the pictures). This is sort of confirmed by selecting all the photos in the library and then using Get Info: this shows the same size as selecting the library.
Finder is showing the actual size of the library file on disk. This file contains all the photos but also a lot of other "meta" information about the photos, albums, places, faces, etc. that allows Photos to manage and display the pictures.
Comment: @jonegran01 Additionally, generated thumbnails and such wouldn't be shown in Photos but would in finder
Comment: Interesting, I didn't know the metadata was so large. Thank you for your help!
Answer: The photo library file on disk is actually a directory and you can descend into the directory.  Finder normally wont do this because it knows it is a special directory (you can right-click on it and pick 'Show Package Contents').
A better way to get more detailed info is to open the Terminal utility and use the command line:
cd ~/Pictures/GKJones\ Fam\ Library.photoslibrary
(or just type enough characters to be unique then hit the tab key to auto-complete)
Then use the du utility (display usage) to get a summary for each folder.  I'd probably use the "depth" option (-d flag) and set the depth to 1 (only summarize to 1 sub-directory deep ... otherwise you'll get a very long output).  Use the -h flag to put the values in human-readable format (the default is to display the usage as the number of blocks occupied)
du -hd 1
This will give you a list of all the sub-folders with the usage of each folder.
If you hold both [cmd] + [opt] while clicking the Photos icon to launch the app it will  offer to repair the library.  This takes a some time to complete depending on the size of your photo library.


Sent Rental Application Via Email with No Response... Is My Information in Jeopardy?

Question: I emailed a rental application for an apartment to a potential landlord.  I've spoken with them over the phone, saw the unit in person and they emailed the application and I emailed it back (because I live out of state)... along with personal information like my drivers license and paystubs. Now, I can't seem to get them to respond to me... I've followed up twice now since sending it (once a day) and I'm feeling uncomfortable about having sent it with not a single sort of response, not even a declined for the apartment or any such acknowledgement.  Not sure what I should do or if there is anything i can do at this point beside know better to not do it again.  any advice?
Comment: It sounds like you want to ascertain whether the contact information you employed- email address, phone number- are both correct- they refer to the right person/people- and are in the custody of the right person/people. Someone having keys to an apartment is not a guarantee of either. Ways to cross reference- property records- most cities and property sites have them online. Other tenants- should not be hard to find residents in a multi-unit dwelling. Neighbors- should not be hard to find people who live nearby. A local coffee shop may be willing to post something asking for contact info.
Answer: What you can do now
Many characteristics of houses in the US (I am assuming you live in the US) are a matter of public record. This includes ownership history. These records can can be consulted through the county recorder/county tax assessor's office. Many have a website you can use and offer records dating back to the sixties. I am not sure whether such inquiries come at a fee, but it stands to reason. Example here.
You could attempt to validate that the individual you dealt with actually owns the property.
What you could've done
Technical considerations:
From a technical standpoint, and realizing that most people outside this industry don't care about security of information in transit, a good idea is often to ask to share the information through the same public email service. Ideally this service is a reputable one. Take a look at this previous answer regarding exchanges between gmail accounts:
Is gmail-to-gmail still insecure? Why?
Make sure to zip your sensitive data with an application that has a respectable implementation of crypto, such as SecureZip and send the password(a reasonably random one) to said zip file through a different channel, like the phone.
Non-technical considerations:
Perform the above mentioned validation before the fact.
Realty agencies exist for a good reason. Make sure to conduct business through an experienced and recommended realtor that has a reputation to protect. This will also come to the rescue, should issues or misunderstandings arise during the life of your lease, saving you a lot of time and money.
Comment: Given the attitude of most rental agents I've worked with, asking them to unzip encrypted zip to get your rental application will likely just get your application to be totally ignored/put to the bottom of the list.


How is this question opinion based?

Question: Does GTX 1650 encode/render videos at better speed/performance than RX 6500 XT?
Answer: The question you ask is literally asking for our opinion on if one GPU is better than another GPU.
Now even if the community could answer this with a factual based with little to no objectivity, I would argue the question is still unhelpful, since there are dozens of websites that compare the benchmarks of both these cards. So even if the community were to reopen your question for not being opinion based (I definitely think your question is opinion based), it would be closed due to your lack of research.

Given all that, is 1650 better in video editing and render speed as compared to 6500 XT?

I rarely see questions that use the term "better" remain open. What is "better" is often in the eye of the beholder. How you get better "render speed" is well defined.

6500 XT renders video at very slow speed especially in Premiere Pro (maybe rendering is done by CPU and not this GPU. I'm not sure how it works.)

Sounds like the version of Premiere Pro you are using does NOT support hardware acceleration with the 6500 XT.  Which is the reason the rendering is down with the CPU, and thus would be the reason with everything equal, a system with the Nvidia card would be faster at rendering.
The 6500 XT is indeed not supported by Adobe Premier Pro when it comes to hardware acceleration. Likewise, the Nvidia card is supported, so hardware acceleration would be supported.
For a reopen vote to be possible, from this user's perspective, you would have to define what "better" is specifically and indicate what version of Premier Pro you are using.
Address the issues that resulted in your question being closed and I could see a path to it being reopened.

How is this question opinion based?


Best way to convert DOCX to EPUB?

Question: Which is best for converting DOCX to EPUB? Pandoc, LibreOffice, or Calibre?
Answer: In my experience, Pandoc doesn't preserve all the color and formatting. Calibre and LibreOffice do. Calibre, however, doesn't preserve comments and inline things, but LibreOffice does. So, LibreOffice (probably ∵ of it's extensive Doc format parsing abilities) is the best to convert to EPUB, and it outputs EPUB 3`s by default.
Answer: Calibre has worked well for me, but depending on how much special formatting, images, etc. you have, you'll need to do a lot of touch-up work. You may end up wishing you just started from scratch.
But having done a project like that once, I think it was still easier to convert using Calibre then make adjustments and changes.
I have not used PanDoc. LibreOffice is worth trying, too. Try both LibreOffice and Calibre and see which is better. They're both free, and both simple to use.

Best way to convert DOCX to EPUB?


Open the document in the browser

Question: I'm presenting some Search results to the user using REST API, is there something specific should I include in the link to the document so the document opens in the browser?
Comment: I thought that depended on the settings of the underlying library where the document is stored, if the behavior is to open in the browser it will. Not certain about this and haven't tested.
Comment: Let's say that the link is in the home page.... I checked the library options and the option for open in the browser is activated
Comment: what I mean is, if document X that is in library Y and presented on page Z, if user clicks the link, it should take the file handling options from library Y. That is my understanding in theory, I have not tried this in practice.
Comment: I said, I Checked the library and the options are fine... But still downloading the document with the link
Answer: The simplest solution is to append ?web=1 at the and of file url
Ex:
read mode:
https://server/site/lib/filename.ext?web=1
edit mode (if user has permissions):
https://server/site/lib/filename.ext?web=1&action=edit

Answer: You can obtain the file URL and concatenate with a constant as in the following code:
    function documentWebUrl(ctx) {
        var fileUrl = ctx.CurrentItem.FileLeafRef.FileUrl;
        ExecuteOrDelayUntilScriptLoaded(function () {
            var clientContext = new SP.ClientContext();
            var web = clientContext.get_web();
            clientContext.load(web);
            clientContext.executeQueryAsync(function (s, a) {
                var webUrl = web.get_url();
                var DOCURL = webUrl + "/_layouts/15/WopiFrame.aspx?sourcedoc=" + encodeURIComponent(fileUrl) + "&action=default";
                // here put some code to navigate or whatever you need to DOCURL ....
                //...
            });
        }, "SP.js");
    }

Comment: better use the static object `_spPageContextInfo.webAbsoluteUrl` to obtain the weburl instead of using an request
Comment: In general it's a sample on client side script to obtain the url in the following form `/_layouts/15/WopiFrame.aspx?sourcedoc=&action=default`.
Comment: Yes, I prefer to use _spPageContextInfo.webAbsoluteUrl

Open the document in the browser


What do we gain by representing solutions of Systems of Linear Equations as Parametric Equations?

Question: Consider the following system of linear equations:
\begin{aligned}
    4x − 2y &= 1 \\
    16x − 8y &= 4
\end{aligned}
We can eliminate $x$ from the second equation by adding $(−4) \times$ the first
equation to the second. This yields the simplified system
\begin{aligned}
    4x − 2y &= 1 \\
          0 &= 0 \\
\end{aligned}
The second equation does not impose any restrictions on $x$ and $y$ and hence can be omitted. Thus, the solutions of the system are those values of $x$ and $y$ that satisfy the single equation
$$
    4x − 2y = 1
$$
One way to describe the solution set is to solve this equation for $x$ in
terms of $y$ to obtain $x = \frac{1}{4} + \frac{1}{2}y$ and then assign an arbitrary value $t$ (called a parameter) to $y$. This allows us to express the solution by the pair of equations (called parametric equations)
$$
    x = \frac{1}{4} + \frac{1}{2}t, \qquad y = t
$$
My Question is: What do we gain by representing the 2nd-last equation in a parametric way? Are there any obvious advantages that I am not seeing ? I have some understanding of parametric equations but I am unable to relate the solution of linear system to the concept of parametric equations ? or stated otherwise how do they relate to each other ?
Answer: The following is more of a philosophical nature. It does not refer to your specific set of equations.
An equation $$\Phi(x)=0,\quad x\in X,\tag{1}$$ which might also be a system of equations, implicitly defines a solution set $$S:=\bigl\{x\in X\bigm|\Phi(x)=0\bigr\} \ \subset X\ .$$ For any trial point $x\in X$ it is easy to check whether it belongs to  $S$ or not, but we don't have a birds eye view over the set $S$. Solving the equation means producing an explicit representation of $S$ in the form of a "list". This list may be empty (if there are no solutions), or consist of exactly one entry, which is then called the solution of $(1)$. As long as $S$ is a finite set we can present it in the form $S=\{a, b,\ldots, p\}$. If the set $S$ is infinite we have to resort to a "production scheme" consisting of an index set $I$ and a function $f:\>I\to X$ that outputs for each $\iota\in I$ an element $x_\iota\in S$ in an essentially bijective way. Such an $f$ is then called a parametric representation of $S$.
In your example we can write $S$ in the form $S=f({\mathbb R})$ with
$$f:\quad{\mathbb R}\to{\mathbb R}^2,\qquad t\mapsto\left({1\over4}+{t\over2},\>t\right)\ .\tag{1}$$
Here $X={\mathbb R}^2$, the index set is the $t$-axis ${\mathbb R}$, and the $f$ in $(1)$is the "production scheme" for $S$.
Comment: Hi Christian, thanks for the quick reply. I was not being able to understand you completely. It would be helpful if you could provide an example.
Answer: Comparing
$$x(y) = \frac{1}{4} + \frac{1}{2}y$$
vs
$$x(t) = \frac{1}{4} + \frac{1}{2}t, \qquad y(t) = t$$
In the first you represent one of the original variables in terms of the other, describing your solution set with the mapping
$$y \to (x(y),y)$$
In the second it's not much different other than using an arbitrary variable, $ \ t$:
$$t \to (x(t),y(t))=\left(\frac{1}{2}t+\frac{1}{4},t\right)$$
Which only will yield the same set of $(x,y)$'s just like above.  But here you can make the substitution
$$\quad t\to 2t-\frac{1}{2} \quad $$
for example, leading you to another description of your solution set:
$$t\to (x_2(t),y_2(t))=\left(t,2t-\frac{1}{2}\right)$$
Which again yields that very same set of $(x,y)$'s.
Using an arbitrary parameter is a degree of freedom that, say, the first solution set description doesn't have.  It gives you a way of describing your solution set in more than one way, which will come into play later in your linear algebraic studies, and in higher dimensions.
Answer: In your example the solution of the linear system is a line.
Here are some representations of a line in 2D I use:
$$
y = a x + b \\
a x + b y + c = 0 \\
n \cdot (x, y)^\top = d \\
(x, y)^\top = (p_x, p_y)^\top + t\, (d_x, d_y)^\top \\
(1-\lambda) u_1 + \lambda u_2
$$
It depends on the problem, what form I use. E.g. the parametric case is interesting for physical problems, where we are interested in the movement of a point on the line.
If we move to three dimensions, I would need to update that list, e.g. using the intersection of linear equations / affine planes, I would need two of them, and they need to be linear independent:
$$
n_1 \cdot (x, y, z)^\top = d_1 \\
n_2 \cdot (x, y, z)^\top = d_2 \\
$$
But I could keep the parametric forms more or less:
$$
(x, y, z)^\top = (p_x, p_y, p_z)^\top + t \, (d_x, d_y, d_z)^\top \\
(1-\lambda) u_1 + \lambda u_2
$$


What are the fastest electron orbitals

Question: I read that the mercury has a low melting point because its outer shell electrons are pulled in close by its nucleus (large nucleus, sparse outer shell) and because its outer shell electrons have significant relativistic mass. I think I remember them being roughly 1.28x the rest mass of an electron. I calculated that as meaning they must travel at roughly 60% of the speed of light. But are there faster electrons? (in orbitals, not just free electrons)
Answer: This is the domain of relativistic quantum chemistry. This isn't something that has an easy upper bound, but you can imagine the 1-s orbital of ununoctium, if you'd like. On the extreme end you can imagine short-lived atoms in the vicinity of a magnetar
Comment: The extreme magnetic fields make electrons in atoms behave ultra-relativistically.

Regarding the first question, this is just a semi-classical guess (a la Bohr) but a 1-s orbital has greater speed than a 2-p orbital. Remember the Virial theorem $\langle T\rangle = -\frac{1}{2} \langle V \rangle$, or Kepler's laws if you like.
Comment: My guess is that the OP could use a little more explanation.  Why would the 1-s orbital of ununoctium be faster than 2-p of oxegen?  Why magnetars?

What are the fastest electron orbitals


Are the historical sources from the ancient history trustable?

Question: Are the historical books of Herodot or Polybius or any other historian from ancient history usually correct? Did they add some 'drama' in their books or did they desire to gain favor of those of high ranks, by praising them, by spreading their fame in some of their texts? Did we ever have proven historical inaccuracies in one of their books? For example, Polybius has written that Scipio Aemilianus cried at the destruction of Carthage. How can this be true? How did he know that as no one saw him?
Comment: Why would you assume that "... _no one saw him_"? Firstly, Polybius was with Scipio at the fall of Carthage, although iirc the claim that Scipio wept is actually in the account by Appian (not all of Polybius' Histories survives).  In any case, public displays of grief were good politics then - just as they are now.
Comment: @Meir: I'd hardly regard the US Civil War as modern day :-)  But we don't have to look further than the coverage of current events by different media outlets.
Comment: An interesting question, although I'm distracted by "trustable" as a boolean.  More interesting might be "How can we trust sources?" What do we need to do to engage with and understand sources of any age?
Comment: And also, why limit the question to ancient historians? Modern-day writers have their biases too, and even with well-documented events, it's quite possible to slant them one way or the other, in favor of or against the personages involved. (Try comparing a pro-northern and a pro-southern account of the Civil War, for example.)
Comment: In this case, I believe one of Polybius' sources for his histories was the family of the Corneli Scipiones. (He lived with them for a number of years.) So Polybius' ultimate authority for this fact would be either Scipio Aemilianus or someone who claimed to have witnessed this & told his family about this. (Other details from Polybius or other ancient historians I cannot be this certain about.)
Comment: The question amounts to "what is it that historians actually do for a living?"
Answer: Historians engage with such sources all the time. Just like any other historical source, they are evaluated in relation to other available evidence. It is true that ancient historians had different standards of evidence then modern ones, and this must be taken in to account. But all sources can include distortions and that is in no way unique to these sources.
If you want to know specifically whether Scipio Aemilianus really cried at the destruction of Carthage, you are going to look at other sources besides Polybius to help you determine that. Can you find out what source(s) Polybius took that information from? Can you least find independent sources (ones that could not be based on Polybius) that claim the same thing? Are there secondary sources (modern historians) who support this claim? This kind of thinking is a big part of what historians do.
Comment: There's also the considerations of what motivations Polybius (or his sources) may or may not have had to make up such a detail.
Comment: +1 for that brilliant first sentence.  Terse, impactful, delightful.
Comment: Thanks! But now that I think about it more though, it's not *all* the time.
Comment: Only when they're good?  Or we _wish_ it were all the time?   Still a delightful answer
Comment: Well it is all the time, Brian - it's just sometimes the method of engagement is "thank you, next." And your last sentence is what anyone thinking critically should do but sadly this is becoming less and less common even among "reputable" journalists.
Answer:
Question:  Are the historical sources from the ancient history trustable?

.

Short Answer:

Controversial topic. There is no blanket finding on historical texts accuracy or inaccuracy which enjoy's consensus support among historians.  Historians generally support the critical analysis of historical texts matching them against broad sources and references to determine each documents veracity.
.

Detailed Answer:

If we examine Herodotus.  Plutarch wrote "The Malice Of Herodotus", an essay criticizing The Histories for their inaccuracies and misrepresentations.
.
Herodotus is honored as the father of History.  He traveled to some of the lands he wrote about and interviewed locals.  He also conducted analysis of his history to attempt to maintain it's correctness across conflicting sources.  Similar to what modern Historians do without access to all of our resources.  Still Herodotus is Not to be taken as objective fact.  Today we know more than Herodotus did.  We have the advantage of archaeological finds, other writings, and scientific analysis which Herodotus did not.
Examples of Herodotus getting his facts wrong:

Book One of The Histories,  Herodotus says Babylon had 100 bronze gates around the city, that Babylon's walls were 100 meters high, 22 kilometers (14 mi) long, and 50 meters (164 ft) thick. He also says he saw a deep, water-filled trench that surrounded the entire perimeter of the city.   Archaeologists do not support Herodotus's "observations".   Babylon only had 8 gates and it's walls were not nearly as formatable or vast.
In Book Two, Herodotus writes about Egyption embalming techniques.  With modern medical technology we know Herodotus attributed embalming techniques were wrong.
"A lot of his(Herodotus's) accounts sound more like tourist stories, so we're reticent to take everything he said at face value," co-author of the study Andrew Wade told LiveScience.
In Book Three (Book 3, passages 102 to 105), Herodotus claimed giant insects(ants), the size of "foxes" in Persia were used in the mining of gold.  Not really something which stands up to the test of credulity.  Although some suggest Herodotus was describing squirrels or Himalayan marmot.  Even so, That's not an ant.

In Books Three and Four, Herodotus makes multiple mentions of a race of Cyclopes and griffons indigenous to Europe.  We've found no evidence of such a race of single eyed giants, nor of the griffons who Herodotus said guarded large hoards of gold.
In his An Account of Egypt Herodotus speaks a lot about the flooding of the Nile river.  He evaluates and dismisses three theories on why the river floods seasonally before proposing his own.  In his theory, Herodotus gets the months wrong.   Herodotus says the Nile retreats in the summer months due to the heat of the sun evaporating the water.  Only the Nile actually floods in the summer.  Herodotus Speculates about Egypt
All throughout his histories Herodotus, who was Greek, is overtly biased in favor of the Greeks.  Specifically in his description of the Battle of Marathon,  Herodotus says only 192 Athenians were killed vs 6,400 Persians.  Modern estimates place Athen's casualties at 1000-3000, (Battle of Marathon).  Most historians chalk Herodotus's numbers up to exaggeration.   Also Herodotus claimed that the 192 Greek warriors who fell at Marathon were buried in the middle of the battlefield, on the planes of Marathon.  Such a burial site,  supported by carbon dating doesn't exist.  The long time candidate for this site at Marathon (soros) actually predates Marathon based on the carbon dating of ceramics recovered from mound.  Modern historians today don't even agree the actual battle occured on the plains of Marathon, but rather debate a different site miles removed from the soros mound.
Lion cubs don't actually claw their way out of their mother's wombs, as Herodotus describes and the number of offspring of a species are not related to how fierce or dosil their species is as Herodotus reports.

This is a great question.   Unfortunately like many great questions there is no consensus which broadly categorizes ancient texts.  While some ancient historians like Herodotus had some understanding of objective history, even if they did not always live up to them; many historians did not.  Each document needs to be evaluated on it's own merits and critically analysed to discover it's objectivity and factual merits.
Comment: Good post!  You said: "While some ancient historians like Herodotus had some understanding of objective history".  I think it might be better to say that Herodotus was *inventing* the idea of objective history and that it took another 2000 years before it was accepted as the ideal. (Ancient writers were more concerned with explicating a person's character and providing explanations for later events than with the fussy details of exactly who did what to whom and when.)


Why did Hagar go back?

Question: This one has bugged me for a long time. Why would Hagar go back to a pressured existence especially when she was told that her son would become a wild man and a thief?
Comment: what makes you say that she wouldn't be happy with the outcome for her son that the angel depicted? [This midrash](https://www.sefaria.org/Mekhilta_DeRabbi_Yishmael.20.2.4?lang=bi) describes it as "a blessing". Not everyone has the same values we do, some people may think this is a positive thing. He will live in the desert, he will be a capable fighter and he will steal.
Comment: @Esther the reason is because we are told she was a righteous woman. One good example is, as Rashi says, that she was used to seeing angels. Similarly, in Maseches Meilah (I think around 20a or b) it says that Rabbi Shimon Bar Yochai bemoaned how she, a mere servant in Avraham's house, merited seeing three angels to help her, while he had to have the help of a demon. But I do think you might be on to something. Is there a way to understand that as a blessing? I'm still wondering.
Answer: Because God told her to go back:

And the angel of the Lord said to her, "Go back to your mistress, and submit to her harsh treatment." [Gen. 16:9-11]
Comment: This quote gives a distorted impression of what the angel said. The Hebrew has no mention of "harsh treatment": literally, it says "submit yourself under her hand", which most English translations render as "submit to her authority" or "submit to her." Also, you referenced verses 10-11, but didn't quote the promises of God there. These promises give Hagar hope in returning to a difficult situation, knowing that God has great plans for her.
Comment: @LarsH partly true. But it seems that the latter translation "harsh treatment" is also expressed by the Radak (on the word סבל). Sivlos (as in Sivlos Mitzrayim) can, according to the Sfas Emes, also come from the word "Savlanus" - e.g. a patient recognising that he is sick, but nevertheless dealing with it, accepting the sickness.
Comment: Good, clear answer. So was the part about what her son would become said just to test her? Why tell her that? (Basic reading suggests that it was something used to convince her to go back.)
Comment: @LarsH Fair point, but it is more of an ambiguous description. Rashi (Genesis 16:6) does indeed interpret this as harsh treatment, some Targumim support this, and there are midrashic statements that elaborate on the form this harsh treatment took. The Radak, Ramban, and Tur (ad loc.) even fault Sarah for this behavior, while other commentators have justified Sarah's behavior. Yet other commentators agree with you that this terminology does not imply harsh treatment.
Comment: @Fred I agree it is clear enough (in the text and context of 16:6) that Sarah treated her harshly. My objection was to the dubious translation and selective quotation of what the *angel said* in v9-11.
Answer: Although I am searching for the Midrash, I found a note years ago that the Midrash says Hashem was telling Hagar what would happen to Yishmael if she did not return to Sarah. Therefore, Hagar returned to her "pressured" life (i.e., profoundly meaningful, rather than misguided freedom to "do what I feel like") in order to give Yishmael the opportunity to grow in a loving, uplifting, and disciplined environment to curb his inclination from being a פֶּרֶא אָדָם
to one who could (and would) eventually do teshuva at the end of his life.
Comment: See Bereishis 16:11 regarding the machlokes in understanding  הִנָּ֥ךְ הָרָ֖ה וְיֹלַ֣דְתְּ בֵּ֑ן. Whether this angel was telling Hagar that she was - or would be - pregnant does not seem to alter this answer.
Comment: She was pregnant then?
Comment: @NJM could you please edit your answer for clarity? I'm not 100% sure what you're trying to say.
Comment: @EthanLeonard Please see edits and let me know what I can edit to help clarify.
Comment: @NJM ok, now I understand. In other words, he **could** have become a wild man regardless, but she was more likely to have a son like that if he grew up outside of Avraham's influence. Two important points though: she did have a pressured life in that her mistress was afflicting her to the point that she ran away from whatever part was profoundly meaningful. Also, barring any other answers to this question, if she could have chosen to avoid having a child like that at all, it is questionable why she did not. So her pregnancy is relevant.
Comment: @EthanLeonard Points well taken. 1) Some explain that Sarah treated Hagar just as well as she did before, but Hagar felt more arrogant now because she was going to have a child from Avraham and not Sarah - thereby "paining" Hagar because she needed to continue working despite her inflated self-esteem. 2) I'm not sure how she could have avoided having a child like Yishmael if she didn't return to Avraham. A son's character mirrors his mother's.
Answer: The Ramban explains that Hagar would've never become free from her mistress.

RETURN TO YOUR MISTRESS, AND SUBMIT YOURSELF TO HER. [The angel] commanded her to return and accept the dominion of her mistress. A hint that [Hagar] would never become freed from her, because the children of Sarah would rule over her descendants forever.

Refer also to the Sforno, for a similair approach:

והתעני, the additional comment after telling Hagar to return to her mistress, was an allusion to the future; it would be Hagar's destiny, as well as that of her offspring to submit to the authority of the Jewish people.

See also the Tur in Tur HaAroch.

שובי אל גברתך והתענו תחת ידיה, "go back to your mistress and submit to her oppression" The angel hinted to her that she would not regain her status as a free woman, and that the descendants of Sarai would rule over her descendants into the distant future.

See also the Midrash of Philo where it goes a little bit deeper into the concept of obeying a mistress in this case:

Why did the angel say to her, "Return to thy mistress and be humbled beneath her hands?" (Genesis 16:8).
As the letter is plain, we must rather investigate its inner meaning. The word of God corrects that soul which is able to be lured, and instructs it, and converts it, leading it to wisdom as its mistress, that it may not, through being abandoned by its mistress, rush at once into absurd folly. But it warns it, not only to return to virtue, but also to be humbled beneath its hands, that is to say, beneath its several excellencies. But there are two kinds of humiliation; one, in accordance with defect, which arises from spiritual infirmity, which it is easy to overcome, seize upon, and reprove. But there is another kind which the word of the Lord enjoins, proceeding from reverence and modesty; such as that humility which children exhibit to their fathers, pupils to their masters, and young men to the aged; since it is very advantageous to be obedient, and to be subject to those who are better than one's self; for he who has learnt to be under authority is in a moment imbued with a power which he alone may exercise; for, although any one were to be clothed with the authority of all the earth and sea, yet he would not be able to possess the royal supremacy of virtue, unless he had first been instructed and taught to obey.
Comment: Interesting bringing a Philo, and a very interesting point he makes, that seems to be the missing information from the other commentaries, although we can't speak for them. Great answer. I do note that this "forever" must be post-Moshiach because has it ever happened in history?
Comment: This doesn't really answer the question. If anything, it suggests that the command to go back wasn't even a command but rather a prophecy (although of course אין מקרא יוצא מידי פשוטו). The Philo especially is irrelevant here (and everywhere, since it's not a legitimate source.)

Why did Hagar go back?


Is this illegal to watch pornographic videos through the internet in UAE?

Question: After seeing a news in gulf news I'm asking all of you if you have any suggestions or experience then please share it.
A my friend was saying about this there for want to know in detail.
To watch porn videos it will be cause your arrest in UAE ?
Have you seen or heard about this?
Comment: @GeorgeY. No, it doesn't depend at all! whilst it is potentially "more" illegal to watch it on a public street, and you are certainly more likely to be caught doing it there, it doesn't fundamentally change the fact that it is illegal no matter where you watch it.
Comment: @GeorgeY. you don't think that home internet use is completely private, do you?
Comment: It heavily depends where one is watching it. On a public street? In a family restaurant? In your hotel room?
Comment: He asked whether this will **cause your arrest**, and I don't see any way how watching porn videos in your private hotel room could cause your arrest?
Comment: @RobertColumbia the question asked whether you can get arrested for this, not whether you think it is private or not.
Answer: Under UAE law it is illegal to posses or view pornography.  This covers any form of pornography, including Playboy magazines, pornography DVDs and Internet porn.
Most pornographic websites are blocked in the UAE (or so I'm told!), and whilst it may be possible to access them using something like a VPN, this breaks further laws around the use of a VPN or similar technology to circumvent the countries Internet filtering.
Viewing pornography whilst in the UAE can result in a fine of up to 1 million Dirham (around $300K USD) and up to 6 months prison.
Comment: The answer is legally correct, but practically speaking, enforcement is non-existent and the blocking is patchy at best.  The riot squad is not going to burst into your hotel room if you browse to some random porn site.
Comment: I second @jpatokal, I have watched hundreds of hours of porn in the UAE. As long as it's between you, the screen and the dude down there, then no one cares..
Comment: @NeanDerThal
Answer: As stated in the other answer, it is indeed illegal. I would then address the second question, "to watch porn videos it will be cause your arrest in UAE ?" There is difference as enforcement of certain illegal activities in UAE doesn't seem to happen. For example sex outside marriage is illegal in UAE, but lots of visitors practice it without consequences. A quick google search didn't find any single case of someone actually being arrested for watching porn in UAE, so the enforcement seem to be equally weak.
Practically, watching them in privacy, such as your hotel room, despite being illegal, should be safe. Unless your room is wired for video recording, it would be a challenge to prove that (a) you (b) watched porn. And there is no obvious incentive to do so.
However watching them in a public place, or using your employer's Internet access for this (if you work in UAE) can indeed lead to arrest.
Comment: The fact that your internet device downloaded porn from a website by itself does not prove that a) it was watched at all, and b) you were the one watching it.
Comment: "it would be a challenge to prove that (a) you (b) watched porn" Internet connection records that show that your device was connected to a port site and was downloading video content?


Little Big Planet PSP vs PS3

Question: Excluding the graphics quality, what are the differences between the PSP and PS3 versions of Little Big Planet?
Comment: I reworded the two questions into one. You can have small differences playing a game using an emulator, but that comes from the emulator side. Apart from adding features, they attempt to replicate the platform as best as possible, so in an ideal situation you will be playing the game exactly as you would on the playstation. I also find sometimes posters can see "emulator" and immediately think illegal. If I've missed the mark, OP, feel free to roll it back.
Comment: as long as user own a PSP and the game too, emulation would not be illegal as far as i know. I haven't yet checked out http://www.ppsspp.org/index.html
Comment: that's exactly right.
Comment: also ppsspp doesn't require any thing from a a PSP because it is a "HLE" emulator. Buying only the game will be enough,
Answer: Basically the key difference is the story and having completely different levels. Also the PSP doesn't have multiplayer.

Little Big Planet PSP vs PS3


Why did Esau prosper before Israel (Genesis 36 and Deteronomy 2)?

Question: Jacob was promised the land of Canaan for a possession; yet his brother Esau came into his own kingdom long before, according to Genesis 36 and Deuteronomy 2, despite the word given to Rebekah, "Two nations are in thy womb, and two manner of people shall be separated from thy bowels; and the one people shall be stronger than the other people; and the elder shall serve the younger." (Genesis 25:23) If Jacob was the Lord's anointed, why did Esau prosper even as his Jacob's family was reduced to slavery?
Answer: There are many ways to approach this highly interesting question, which I will outline here. First, God told Abram that his descendants would not inherit the Promised Land until "they [the Egyptians, as we learn later] shall afflict them [the Israelites, as they will come to be called] four hundred years" (Gen 15:13). It is enough simply to say that Jacob and his sons could not come into their own land, as Esau did, without rendering this prophecy false.
But look also at the reason God gave to Abram for the delay: "the iniquity of the Amorites is not yet full." This suggests that the Lord would not approve the extirpation of whole peoples by his own chosen people, and the transference of their land, except as just punishment. Moreover, perhaps the Israelites could not serve as the instruments of his holy wrath unless they themselves had been properly humbled.
Throughout the narrative of Genesis and indeed the whole Pentateuch, God's chosen representatives are made to wait, even as their relatives and enemies prosper. As Abram waited for an heir, his brother Nahor and his nephew Lot reproduced without difficulty. Hagar produced a son as soon as she tried, after Sarai waited decades. Isaac and Rebekah had to wait 20 years, as Ishmael began his family. Esau had at least three wives (quite possibly four) before Jacob had even one. In short, the Lord taught through these examples that the emergence of the seed through which he would fulfill his promise was dependent entirely upon his own good pleasure, in his own time.
Then, while Jacob was blessed with a large family and wealth like his father and grandfather, his brother had not only that, but made his sons into Dukes (or Chiefs) in a land given to them by God "for a possession" (Deut 2:5); soon after that, even as the Israelites toiled in slavery, Esau's children "had destroyed them [the Horites of Seir] from before them, and dwelt in their stead" (Deut 2:12). Later, as the newly freed Israelites venture through Sinai and wander in the wilderness, they encounter tribes descended from Abraham and Isaac that are established and prosperous. The result was humiliating for a people promised by God to inherit a land flowing with milk and honey, through whom all the nations would be blessed.
Only later, in the Psalms and wisdom literature, is it stated explicitly and repeatedly that the Lord requires patience and humility, and that the prosperity of the wicked must be endured. "Rest in the Lord, and wait patiently for him: fret not thyself because of him who prospereth in his way, because of the man who bringeth wicked devices to pass." (Ps 37:7)
Rather than "humiliated," the children of Israel were instead "humbled," and, it seems, deliberately so. It is not unlikely that Jacob and his sons were themselves chastised for their various sins by their having finally to bow down to their brother, as according to his prophetic dreams, with their punishment even extending to the fourth generation by the captivity in Egypt. After that, they were humbled and shown to be wholly dependent upon the Lord, and upon their release, were a people better prepared to be "a kingdom of priests, and an holy nation." (Ex 19:6) This was a thing far greater and more difficult than the mere capture of a pagan nation like Seir; because it required that humility and patient faith in the providence of the Lord be instilled into an entire nation, it was not a thing that God chose to do quickly, not with the rough clay of fallen humanity.


Client verbally tells me it's ok to take days off whenever but generally wants 5 days a week. Should I get this in contract?

Question: I work as a contractor. The expectation is I work Monday - Friday 8am - 5pm and to inform them if I'm not going to be in on a given day. This is to be on the same schedule as the rest of the team. They have verbally told me on multiple occasions it's ok if I take days off when I feel like it. Should I get this written into my contract? What language should be used? Or is there no point, since if they're unhappy with my work they could terminate my contract for any reason? I don't get any holidays off.
Comment: Are you a freelancer or working through a staffing company?  And are you aware of [Freelancing SE](https://freelancing.stackexchange.com)?
Comment: Country? Please state.
Comment: Are you looking for paid time off? Or unpaid time off? As a contractor, you shouldn't be worried if you're just looking for unpaid time off.
Answer: In the USA, if you're a freelance contractor, your clients have limited ability to control your schedule, place of work, and other aspects of your arrangement with them. Misclassifying you could be a potential issue for them with the IRS.
That being said, you don't need anything in your contract that stipulates your time off. That's completely at your discretion. What I try to do is give my clients ample notice if I'm going to take an extended leave, like for vacation. If I'm simply not feeling well or have other things going on and will be away for a day or two I generally try to give them as much notice as possible. In the case of being ill, that's usually the day of.
https://www.irs.gov/newsroom/understanding-employee-vs-contractor-designation
https://www.irs.gov/businesses/small-businesses-self-employed/independent-contractor-defined
https://www.irs.gov/businesses/small-businesses-self-employed/independent-contractor-self-employed-or-employee


Auto renewing subscription for video and audio streaming

Question: We have an application that offers audio and video streaming as a separate service and we'd like it to be an auto renewing subcription.  The user might buy this service and not use streaming at all, anyway, the service is available all the time the subcription is active.
Now, I have problems to interpret this sentence from the Apple Review Guidelines for auto-renewable subscriptions:
"Apps may only use auto renewing subscriptions for periodicals (newspapers, magazines), business Apps (enterprise, productivity, professional creative, cloud storage) and media Apps (video, audio, voice), or the App will be rejected."
Would our app fit in this category?
Thanks in advance.
Answer: Auto-renewable suscriptions are meant for apps that deliver "periodical" content. Our app just offer the video and audio streaming service on-demand, thus, product should be non-renewable suscription.


Adding symbols to the end of a line

Question: Is there a simple way to add symbols (circles, triangles etc) to the end of a line in QGIS?
Comment: Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our [faq].
Answer: If you need it only for display:
(1) Open Layer Properties | Style
(2) Click on green + button two times. Change each Symbol layer type to Marker line and check on first vertex only and on last vertex only.

(3) Default markers would be circles. To change them to triangles, scroll this window  a little down to icon list and select your preferred one.

Adding symbols to the end of a line


Is there a way to check my quest?

Question: I keep forgetting what I have to do, so I'm just asking if there's anyway to check the quest. Maybe a button I'm forgetting because I'm stupid, something like that.
Comment: There's a quests tab on the pip boy in New Vegas too.
Comment: I didn't play fallout:nv (shame on me), but in fallout 3 and 4, you could open the pip boy and select the quest which was then tracked on your radar.
Answer: Under the "Data" tab of your Pip-Boy, there is a "Quests" page.
Here, you can select which quest you want to be active, and review the current objective for all the quests you've started. The quests with a square icon to the left of them are active. Click on the quest name to toggle it between active and inactive.
Your active quests will have their quest markers show up on your Pip-Boy map, and also on the compass at the bottom of your screen.
Answer: You need to keep checking your PipBoy to track quests. There is no "easy track quest" mod for it.

Is there a way to check my quest?


What causes the navigationBar to turn white hazy color after setting both barItem properties?

Question: I was working on building out a navigation controller and the nav bar all of a sudden added this white hazy color to the nav bar and I don't know what property that is.  I've tried turning translucent off and also setting the background color however the new red background color appears behind the white hazy color.  What causes this white hazy color and how do I remove it?
Here is my code:
<code>UIBarButtonItem *btnCancel = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelButtonPressed)];
    self.navigationController.topViewController.navigationItem.leftBarButtonItem = btnCancel;

    UIBarButtonItem *btnSave = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:nil action:nil];
    self.navigationController.topViewController.navigationItem.rightBarButtonItem = btnSave;
</code>
Answer: The problem was that I placed code inside of view will appear that set an integer variable.  As I understand it view did load should come before view will appear so I don't understand why this problem is happening but it was the issue.


Which ancient cults would cut out the hearts of live animals and offer them as sacrifices?

Question: Which ancient cults would cut out the hearts of live animals and offer them as sacrifices? The Mishnah (Avodah Zarah 2:3) mentions a concept called עורות לבובין which Maimonides and other commentators explain refers to the pagan practice of making an incision in live animals and removing their hearts for ritual purposes. Do we have any documentation as to which ancient cults were engaged in this practice?
Comment: Please don't double-post this question on MythologySE and here. https://mythology.stackexchange.com/questions/7562/which-ancient-cults-would-cut-out-the-hearts-of-live-animals-and-offer-them-as-s
Comment: [WIkipedia](https://en.wikipedia.org/wiki/Human_sacrifice) implies that the answer is Moloch "Leviticus 20:2 and Deuteronomy 18:10 specifically outlaw the giving of children to Moloch, making it punishable by stoning; the Tanakh subsequently denounces human sacrifice as barbaric customs of Moloch worshippers (e.g. Psalms 106:37ff)."  but the implication is weak, and from my memory, we have scant documentation about Moloch worship.   Question is perhaps more interesting than it appears; thank you.
Comment: That is why I said the connection is weak. Judgement call, but I always err on the side of addressing the potential.  Forgive me, I'm struggling to articulate why this question intrigues me so; it is narrow and precise, but it seems to hint a vast areas of knowledge that I don't have.  Perhaps that is overly dramatic, and perhaps I could express it better if I had more caffeine.
Comment: Could it be the *roman divination practice* **haruspicy**?
Comment: @MarkC.Wallace Yes, but I'm asking about hearts of animals, not about human sacrifice.
Answer: Likely widespread practice
First, we must establish some basic facts. There is a lot of proof that human sacrifice was widespread in region of Middle East and North Africa. Idea that Carthaginians sacrificed their children is not a Roman slander, there is hard archeological evidence for that. Sacrifice to Moloch and Baal is well known from Bible, but also mentioned in other sources (Greco-Roman) . Even episode of Binding of Isaac is now interpreted as a proof that ancient Jews did offer human sacrifice to their tribal god Yahweh but stopped and replace it at certain time with animal sacrifice. Strong rebuke in Old Testament against human (especially child) sacrifice is repeated several times (for example in Deuteronomy 12:30-31). Such strong rebuke would not be needed if even worshipers of Yahweh didn't indulge in such practice.
What about animal sacrifice ? Episode with Isaac tells us that animal sacrifice was some kind of substitute for human sacrifice. Of course, this was not unique for Jews, about same time all other civilizations in the region started to move away from something that more and more looked barbaric. Animal sacrifice persisted well into Roman times, for example in episode of Cleansing of the Temple, Jesus expels money changers and merchants of livestock ready for sacrifice. This supposedly happens somewhere around 30 A.D. Even if do not believe in story about Jesus, it is certain that writers of Gospels were familiar with the practice.
Question now arises, in a period between abolishing of human sacrifice and destruction of the Temple in 70 A.D. (which most likely ended animal sacrifice), in what manner were animals prepared for slaughter. There is a well known Jewish practice of Kosher Slaughter, or more precisely Shechita. According to Jewish tradition, these rules are ancient, given to Moses on Mount Sinai. However, it is a well known fact that compilation of Mishna happened in first and second century, before that laws about preparation of food and animal sacrifice were oral. Therefore, it safe to assume that existed period before Kosher Slaughter and Shechita were different rules (or no rules at all) existed concerning animal sacrifice. Sacrificing still beating hearts is not that uncommon in human history, Aztec did it on human captives, closer to Middle East there are still similar rituals in India etc ...
What is most likely in our case is that somewhere at the end of human sacrifice, there was a transitional period where animals were more and more offered instead of humans, but rules were not established yet. Therefore, they were often killed in sadistic or at least cruel manner. Again, this was not linked to particular cult, worshipers of Baal, Moloch, Yahweh and any other deity likely copied parts of ritual that were widespread. This is mentioned in the Old Testament, which often forbids exactly that : worship of Yahweh in a manner of other gods. When Judaism started to change from henotheism to strict monotheism all kinds of foreign influences were gradually suppressed, and this includes un-Kosher slaughter of sacrificial animals.
Comment: This is something i researched "extensively" in 2012. It frustrates me that i did not save my research anywhere, and cannot even remember what sites and what tags i used to obtain the information. However, at the time, i was quite convinced Moloch was actually a Crematorium, and dead children did indeed get cremated there. However religious opponents considered this sacfrifice, as many religious sects, including Catholicism, believed cremation to be equal to sending dead souls to hell
Comment: @StevenIanGall Recent studies suggest that it was not crematorium, i.e. that the children in question were in most cases healthy and didn't die of natural causes. You have one link in my answer, and you could search the net for other sources.


Generic Aggregation of C++ Objects by Attribute When Attribute Name is Unknown at Runtime

Question: I'm currently implementing a system with a number of class's representing objects such as client, business, product etc. Standard business logic. As one might expect each class has a number of standard attributes.
I have a long list of essentially identical requirements such as:

the ability to retrieve all business' whose industry is manufacturing.
the ability to retrieve all clients based in London

Class business has attribute sector and client has attribute location. Clearly this a relational problem and in pseudo SQL would look something like:
SELECT ALL business in business' WHERE sector == manufacturing

Unfortunately plugging into a DB is not an option.
What I want to do is have a single generic aggregation function whose signature would take the form:
vector<generic> genericAggregation(class, attribute, value);

Where class is the class of object I want to aggregate, attribute and value being the class attribute and value of interest. In my example I've put vector as return type, but this wouldn't work. Probably better to declare a vector of relevant class type and pass it as an argument. But this isn't the main problem.
How can I accept arguments in string form for class, attribute and value and then map these in a generic object aggregation function?
Since it's rude not to post code, below is a dummy program which creates a bunch of objects of imaginatively named classes. Included is a specific aggregation function which returns a vector of B objects whose A object is equal to an id specified at the command line e.g. ..
$ ./aggregations 5

which returns all B's whose A objects 'i' attribute is equal to 5. See below:
#include <iostream>
#include <cstring>
#include <sstream>
#include <vector>

using namespace std;

//First imaginativly names dummy class
class A {
 private:
  int i;
  double d;
  string s;
 public:
  A(){}
  A(int i, double d, string s) {
   this->i = i;
   this->d = d;
   this->s = s;
  }
  ~A(){}
  int getInt() {return i;}
  double getDouble() {return d;}
  string getString() {return s;}
};

//second imaginativly named dummy class
class B {
 private:
  int i;
  double d;
  string s;
  A *a;
 public:
  B(int i, double d, string s, A *a) {
   this->i = i;
   this->d = d;
   this->s = s;
   this->a = a;
  }
  ~B(){}
  int getInt() {return i;}
  double getDouble() {return d;}
  string getString() {return s;}
  A* getA() {return a;}
};

//Containers for dummy class objects
vector a_vec (10);
vector b_vec;//100

//Util function, not important..
string int2string(int number) {
 stringstream ss;
 ss << number;
 return ss.str();
}

//Example function that returns a new vector containing on B objects
//whose A object i attribute is equal to 'id'
vector getBbyA(int id) {
 vector result;
 for(int i = 0; i < b_vec.size(); i++) {
  if(b_vec.at(i).getA()->getInt() == id) {
   result.push_back(b_vec.at(i));
  }
 }
 return result;
}

int main(int argc, char** argv) {

 //Create some A's and B's, each B has an A...
 //Each of the 10 A's are associated with 10 B's.
 for(int i = 0; i < 10; ++i) {
  A a(i, (double)i, int2string(i));
  a_vec.at(i) = a;
  for(int j = 0; j < 10; j++) {
   B b((i * 10) + j, (double)j, int2string(i), &a_vec.at(i));
   b_vec.push_back(b);
  }
 }

 //Got some objects so lets do some aggregation

 //Call example aggregation function to return all B objects
 //whose A object has i attribute equal to argv[1]
 vector result = getBbyA(atoi(argv[1]));

 //If some B's were found print them, else don't...
 if(result.size() != 0) {
  for(int i = 0; i < result.size(); i++) {
   cout << result.at(i).getInt() << " " << result.at(i).getA()->getInt() << endl;
  }
 }
 else {
  cout << "No B's had A's with attribute i equal to " << argv[1] << endl;
 }

 return 0;
}

Compile with:
g++ -o aggregations aggregations.cpp

If you wish :)
Instead of implementing a separate aggregation function (i.e. getBbyA() in the example) I'd like to have a single generic aggregation function which accounts for all possible class attribute pairs such that all aggregation requirements are met.. and in the event additional attributes are added later, or additional aggregation requirements, these will automatically be accounted for.
So there's a few issues here but the main one I'm seeking insight into is how to map a runtime argument to a class attribute.
I hope I've provided enough detail to adequately describe what I'm trying to do...
Comment: Can you modify the classes? (You're going to have trouble if you can't.)
Comment: @Beta: not necessarily, one could also think of Function objects being defined for these access. There are many possibilities.
Comment: @Matthieu M.: I don't understand. I can think of only two ways to do this without writing a separate routine for every field of every class: 1) modifying the classes or 2) using macros [shudder]. I would gladly learn another way...
Comment: The idea would be to register an object for each class (exemplars), which would take the class in argument and then have a method `getattr(name)` which returns the value of the field as a string (or a Null/Void value if no such field is present). It does require extra work for each class, but from the outside. It's better from an encapsulation point of view since you can only access public fields.
Answer: You will have to store your data in a hashmap or normal map instead of as raw C++ data. It is impossible to go from the string "hai" to A.hai without doing  a switch/case/default on every possible value in C++.
As for the previous answer, this is reflection, not RTTI. C++ does have RTTI - that's what typeid() is for. But, C++ definitely doesn't support it, whatever you want to call it.
Answer: You've definitely provided enough details :) I hope you understand it's not going to be easy.
What you are looking for is called 'Reflection', the ability of an object to describe itself.
Reflection is difficult, but it can be done nonetheless!
I'm normally a fan of metatemplates and whatnot, but this time I am going to propose a pure OO-Way. It is intrisic in the sense that you will have to actually modify your objects to support this.
The base idea is to do it the way languages that support this idiom natively do it.
1- We adapt the base types
enum Type
{
  Int,
  String
};

class Field
{
public:
  Type type() const { return mType; }

  virtual Field* clone() const = 0;

  virtual std::string toString() const = 0;
  virtual void fromString(const std::string& s) = 0;

  virtual ~Field() {}
protected:
  explicit Field(Type t): mType(t) {}
private:
  Type mType;
};

bool operator==(const Field& lhs, const Field& rhs)
{
  return lhs.type() == rhs.type() && lhs.toString() == rhs.toString();
}

class IntField: public Field
{
public:
  typedef int data_type;

  IntField(): Field(Int), mData() {}

  virtual IntField* clone() const { return new IntField(*this); }

  data_type get() const { return mData; }
  void set(data_type d) { mData = d; }

  virtual std::string toString() const
  { return boost::lexical_cast<std::string>(mData); }

  virtual void fromString(const std::string& s)
  { mData = boost::lexical_cast<data_type>(s); }

private:
  data_type mData;
};

// Type information allow for more efficient information
bool operator==(const IntField& lhs, const IntField& rhs)
{
  return lhs.get() == rhs.get();
}

2- Then we build a class which will be able to hold all these
class Object
{
public:
  virtual ~Object(); // deal with memory

  Field* accessAttribute(const std::string& name);
  const Field* getAttribute(const std::string& name) const;
  void setAttribute(const std::string& name, const Field& value);

protected:
  // Deal with memory
  Object();
  Object(const Object& rhs);
  Object& operator=(const Object& rhs);

  void addAttribute(const std::string& name, const Field& value);

private:
  std::map<std::string, Field*> mFields; // tricky, we must deal with memory here
};

3- Usage:
class Person: public Object
{
public:
  Person(const std::string& surname,
         const std::string& givenname,
         int age): Object()
  {
    this->addAttribute("surname", StringField(surname));
    this->addAttribute("givenname", StringField(givenname));
    this->addAttribute("age", IntField(age));
  }
};

int main(int argc, char* argv[])
{
  // initialize
  std::vector<Person> persons = /**/;

  std::cout << "Please enter an attribute and the expected value" << std::endl;
  std::string name, value;
  std::cin >> name >> value;

  std::vector<Person*> result;
  for (std::vector<Person>::iterator it = persons.begin(), end = persons.end();
       it != end; ++it)
  {
    const Field* field = it->getAttribute(name);
    if (field && field->toString() == value) result.push_back(&(*it));
  }

  std::cout << "Selected persons for " << name
            << " = " << value << " are:\n";
  for (std::vector<Person*>::iterator it = result.begin(), end = result.end();
       it != end; ++it)
  {
    const Person& person = **it;
    std::cout << "  " << person.surname() << " " << person.givenname() << "\n";
  }
  std::cout.flush();
}

There are probably many other ways, more or less automatized. Notably one could think of adaptation structures over existing classes. Something similar to the macro BOOST_FUSION_ADAPT_STRUCT but with the added value of having the name of the given structure.
I am afraid it could prove a bit more obscur though, for no obvious gain... also, I should add that if possible you might be willing to directly code in a language that supports this natively :)
Answer: So the answer to the main question, how to map a runtime argument to a class attribute, is You Can't
What you're looking for is usually called Runtime Type Information (RTTI for short), that is the ability to retrieve information about types at runtime.
C++ doesn't support RTTI. For better or for worse, it just doesn't, end of the story.
Therefore, you will have to invent something of your own. In broad strokes, you'll make all your B classes implement an interface that will have a method like getClass( string className ), which will return pointer to your A object, which in turn will also implement another interface that will have a method like getAttribute( string attrName ), and then you'll be able to compare it to your value. Another possibility is for A to have method compareToValue( string attrName, string value ) instead of getAttribute, so that it can deal with the value's mechanics instead of just comaring as strings.
Additionally, you could have corresponding getAllClasses and getAllAttributes methods to retrieve the lists - if you need it.
Also, if you're not bound to C++, there are other platforms which do support RTTI. Java and .NET would be two examples.


How to change pager class to view

Question: I have HTML desing of pagger ,How to I assign my own class to pager in side view ?I dont have any idea about it so will you plese tell how can I ?
Comment: You could refer to http://drupal.stackexchange.com/questions/41306/how-to-add-a-class-to-the-widget-pager-of-views-slideshow for your answer.
Answer: I believe there are two ways you can do it:-

In template.php , you can use theme_pager. Then overrite it.
You can make a views template and overrite it. For this just goto advance option in views and search for template suggestion.
Answer: I could not find a way to add a class to theme_pager() using the hook_preprocess_HOOK system, so here is a slightly different template.php solution that won't involve having to override a core function.
I noticed that views pagers are also run through theme_item_list() which does allow you to add classes.
function MYTHEME_preprocess_item_list(&$vars) {
  $vars['attributes']['class'][] = 'my-class';
}

You can/should add an if condition check to see that the list really is going to be a pager, e.g. use if ($vars['attributes']['class'][0] == 'pager') or some other identifier to confirm that you're adding the class to a pager ul.

How to change pager class to view


Database settings cached?

Question: Working on my first EE site (but have worked with several other CMSs) and I'm having issues with the database connection. I've pulled down files from a live site to set up a development version following the steps on the Moving ExpressionEngine to Another Server page. I've tried using the dbtest.php and can connect to the local database with no issues but when I use the same settings in the database.php file, I get a connection error. Did a little digging and the settings seem to be cached. If I do a var_dump on $this in the DB_driver.php file under if ( ! $this->conn_id) the live settings are appearing in a ar_cache_set array. I did clear the caches before downloading the live database. With a die(mysql_error()) right below that line it gives me a "not allowed to connect to this MySQL server" error. Any ideas on how to clear this? I'm not really sure where it's coming from. cache_on is set to FALSE in the database settings.
Comment: I have figured this out but have to wait 6 hours before I can answer it... config directory was set up as a symbolic link on the live site.
Answer: Sorry to hear you are having an issue. I cant think of an answer other than step 7 verify permissions.
However, once you solve it,  Id  recommend using master config to set up your environments. It does makes things much easier!
Answer: Ah, I figured this out - nothing to do with caching. The main config directory on the live site was set up as a symbolic link with the actual config directory in the web root. That completely threw me off because it looked like there were 2 config directories in my FTP program. I was changing the one in the root and had actually downloaded and uploaded the directories in both spots instead of recreating the symbolic link.

Database settings cached?


Formation of bonds and heat release

Question: We know when there's formation of bonds during chemical reaction there's heat release to the surrounding due to conservation of energy. But what I am confused about, is the kinetic energy of the surrounding increase or the kinetic energy of the atoms that made the bonds increase? if it is of the atoms thus the internal energy of the atoms will not change? if it is of the surrounding how the heat is transmitted then?
Answer: At the atomic/molecular level all chemical reactions are Quantum Mechanical phenomena where atomic and/or molecular electron orbitals of the reactants are being destroyed and new ones created in the reaction products. This is what you are correctly referring to as formation of bonds (although it has to noted that some bonds are also broken during chemical reactions).
These electronic transitions from Quantum Mechanically allowed energy levels to other, generally lower energy levels, are accompanied by the emission of electromagnetic radiation, usually  referred to as photons.
What happens next depends a little on the actual reaction conditions.
Highly exothermic (i.e. releasing much energy) reactions will often emit much of the radiation directly, think for instance of the intense light emitted by burning magnesium.
But less exothermic reactions are often carried out in inert solvents (like water, ether, hydrocarbon solvents and many others) in which case the radiation is mostly absorbed by the solvent and the reaction products, leading to a temperature increase during the reaction. The energy of reaction has been effectively converted to Enthalpy (heat energy) of the solvent and the reaction products.
Answer: Contrary to @Gert 's answer, creation of photons from reactions forming and breaking chemical bonds (typically reactions between molecules) is quite rare.
When photons do occur, it can be (1) the result of a molecule, atom, or structure created or altered by the reaction being in an electronically excited state, which then decays, emitting a photon. There can be a delay ranging from microseconds to minutes (depending on a lot of factors) before the photon is emitted. Regardless, in fluids, the emission usually occurs away from the immediate microscopic neighborhood of the reaction.
A photon can also be (2) the result of incandescence, the radiation of heat. In the case of Magnesium burning, the reaction is so very exothermic that some of the remaining Mg is hot enough to radiate heat in the visible and UV spectrum. This is heat creating light, not light creating heat.
What typically happens in exothermic reactions is that the products, and other bodies in contact with the reacting bodies, receive this energy distributed as kinetic energy or excited rotational or vibrational quantum states. As such, this is the microscopic definition of heat. The heat is quickly shared with it's environment unless there is very low density of matter, such as in interstellar space.
A little more counterintuitive is the case of an endothermic reaction, which actually removes energy from the environment as kinetic energy or excited rotational or vibrational quantum states. In other word, the immediate environment gets colder.
Answer: Heat of formation (enthalpy of formation for an open system with mass transfer) is used to evaluate the thermodynamics of chemical reactions; e.g. the energy released when hydrogen combines with oxygen to form water vapor.  This approach was developed long before the special theory of relativity was developed.  We now know that the heat of formation is due to changes in the rest mass energies of products and reactants; if the heat of formation is negative, this is an exothermic reaction, the products have less rest mass energy than the reactants and the difference appears as increased kinetic energy of the reactants.  A positive heat of formation is an endothermic reaction; the products have more rest mass than the reactants.  This is the same concept as for a nuclear reaction but the changes in rest mass are much greater for the nuclear reaction; see discussions on the curve of binding energy in any basic nuclear physics testbook.

Formation of bonds and heat release