How to update the anchor link text in rich text field using Sitecore Powershell?

Question: I would like to update the anchor link text, if the anchor link Href match with particular domain/url. Do we have any sitecore powershell script to update the same?
Answer: I have written this script by using this example.
This is my Sitecore item with an RTE field and some anchor tags.

Now, this is the script I used, and if you want you can modify this as per your needs.
# Get your item here by providing ID
$rootItem = Get-Item -Path "master:" -ID "{56305117-8C9C-4C08-96D5-BB97A8E27419}"

# Regex pattern to check if the value contains any anchor
$anchorTagPattern = '(?is)]*>(.*?)<\/a>';

# Get your RTE Field
$richTextContent = $rootItem.Fields["DB"].Value;

# Match parttern with your RTE field value
$anchorTagPatternMatches = [regex]::Matches($richTextContent, $anchorTagPattern);

# If Pattern matches
if(![string]::IsNullOrEmpty($anchorTagPatternMatches)) {

# Create a loop and it will give you all the anchors in your RTE
ForEach ($patterns in $anchorTagPatternMatches) {

    # Check if anchor contains the text you want (mention your text)
    if($patterns -like '*testlink*')
    {

        # Keep that anchor in new variable by replacing text with your new value
        $newValue = $patterns -replace "testlink", "newLink"

        # Replace this new anchor with old anchor in your RTE field
        $richTextContent = $richTextContent.Replace($patterns,$newValue);

        # Update your RTE with new value
        $rootItem.Editing.BeginEdit();
        $rootItem.Fields["DB"].Value = $richTextContent;
        $rootItem.Editing.EndEdit();
    }
}
}

And the output is this. It has updated two anchors that match my value.
Comment: @Astle Please accept the answer if this resolves your issue. Thanks
Comment: Hi @Sumit, This is something I have expected. I will check on my end. Thanks.
Answer: You can use below script to update href value in Sitecore rich text field. In below powershall script I replaced value in Multi-Line Text field. I replaced ifarme from object.
$root = gi master:// -id "{11111111-1111-1111-1111-111111111111}"
$items = $root | Get-ChildItem -r | ForEach-Object{$item = $_; $_.Fields  | ?{$_.TypeKey -eq "Multi-Line Text"} }
foreach($i in $items){

   if ($i.Value -Like '*iframe*' -or $i.Value -Like '*src*')
   {
         $replaced = $i.Value -replace 'iframe', 'object'
          $replaced = $replaced -replace 'src', 'data'
        $i.Item.Editing.BeginEdit()

    $i.Item.Fields[$i.Name].Value = $replaced
    $i.Item.Editing.EndEdit()
    Write-Host $i.Item.Name  "-Test"  $i.Name
    # Write-Host $i.Item.Name  "Test"  $i.Name
   }

}

Write-Host "Updated " $count " Found Values"

Comment: Hi @Rishiraj, Thanks for your reply. Some rich text field might have multiple anchor links and different Href. In that scenario, I have to replace particular anchor link text which is matched to the particular domain.
Comment: how many domains you have, if you have only two or three in that case you can add conditions according to domain name and then replace value.

if($i.Value -Like '*http://domain1.com*') {
            $replaced = $i.Value -replace 'http://domain1.com', 'object'
       }

       if($i.Value -Like '*http://domain2.com*') {
            $replaced = $i.Value -replace 'http://domain2.com', 'object1'
       }
Comment: Hi @Rishiraj, It is not countable. Replace query we need to do for particular anchor tag. Because sometimes same content/icon we have for all anchors.


What is the difference between Sprint and Iteration in Scrum and length of each Sprint?

Question:
Is there a difference between Sprint and an Iteration or one can have Iterations within a Sprint or Sprint is just the terminology used instead of Iteration in Scrum? It will be helpful if someone can throw some light on this.
Suppose there are 4 sprints and you have decided the first sprint will go up to 10 days is it required that other 3 sprints should have the same length of the 1st decided sprint's length??.
Comment: This is not the Scrum way, but it is healthier to stop using the word sprint and replace it with the word iteration. The word sprint implies you are going as fast as humanly possible, because that is what sprinters do. But when one sprint ends, the next one begins, which implies everyone should be pushing themselves to the extreme all day, every day. But that is not a helpful impression to put into peoples heads, as it is not what you intend to or should do. The term iteration is more appropriate. It implies you will keep iterating, which is closer to the primary purpose of a sprint.
Comment: @still_dreaming_1 https://twitter.com/timhc22/status/1281249714164453377?s=20
Answer: All sprints are iterations but not all iterations are sprints. Iteration is a common term in iterative and incremental development (IID). Scrum is one specialized flavor of IID so it makes sense to specialize the terminology as well. It also helps brand the methodology different from other IID methodologies :)
As to the sprint length: anything goes as long as the sprint is timeboxed i.e. it is finished on the planned date and not "when it's ready". (Or alternatively, in rare occasions, the sprint is terminated prematurely to start a new sprint in case some essential boundary conditions are changed.)
It does help to have the sprints of similar durations. There's less to remember about the sprint schedule and your planning gets more accurate. I like to keep mine at 2 calendar weeks, which will resolve into 8..10 business days outside holiday seasons.
Comment: Its correct to say that an iteration can contains one or more sprint. For exampole we can have a sprint of a week ad an iteration of a week. Also, we could have an'iteration of a month and 3 sprint inside this iteration.
Comment: @sensorario: From my experience Iaalto's "equality" of iteration and sprint is what I would say is a good short hand definition. That being said how comes you would say a sprint his "higher level" (containing iterations)? I think you could indeed have some sort of hierarchy as you say, but then a "sprint" is not related to Scrum anymore, since Scrum simply doesn't use this term in this way.
Answer: Sprint == Iteration.
The lengths can vary, but it's a bad planning precedent to let them vary too much.
Keep them consistent in duration and you will get better at planning and delivering.  Everything will be measured by how many 10-day sprints it takes to finish a series of use cases.
Keep them consistent in length and you can plan your deliveries, end-user testing, etc., with more accuracy.
The point is to release on time at a consistent pace.  A regular schedule makes management slightly simpler and more predictable.
Comment: Sprint lengths for a specific project should always be consistent, the advantages that consistency brings (which you refer to) are virtually impossible to achieve otherwise.
Answer: The important thing about a sprint is that: within a sprint the functionality that is to be delivered is fixed.
A sprint is normally an iteration. But you can for example have a 4 week sprint, but have 4 one week "internal" iterations within that sprint.
There is a lot of discussion about the length of sprints. I think that if you do it according to the book they should all be the same length.
We have found that a short first sprint to get the development environment up and running, followed by longer basic functionality sprints, then short sprints towards the end of the project, has worked for us.
Answer: "___ is largely an organizational issue caused by long hours, little down time, and continual peer, customer, and superior surveillance"
No this is not the definition of scrum, it is the wikipedia excerpt on the definition of burnout.
Dont do too many short 10 days sprints. You will burnout your team eventually. Use short sprints where you really need them, and don't do too many in a row. Think long-term. A distance runner always paces themselves for the full race and does sprints in short distances only where it matters.
If you burnout your team you can toss out all them fancy scrum charts, they won't do a thing for your team's plummeting productivity.
Comment: My second point is just because a lot of people use continual 2wk sprints doesn't make it right. In silicon valley I see many companies calling a simple mirco-managing of developers with daily stand-ups on 2 week dev cycles SCRUM, even though they have no idea what what scrum process actually is.
Comment: Based on experience, most managers don't leave any slack or special do something else breaks in a 2 wk sprints, most try to maximize thinking it makes them look like better managers. For tiny or small projects that complete and people move on, it's one thing but supporting and enhancing products that never end  year after year, it's another matter. Continual 2wk sprints on never-ending projects gives one the feeling of a rat running on a wheel in a cage. My point is, in long-term projects is continual 2wk sprint really necessary?? I don't believe that it is.
Comment: What the hell are you saying here? Many teams do use 2 weeks sprint. Yes, a sprint is intense, but this certainly doesn't mean people are working 80 hours per week, that's ridiculous. Why would people get burned out with two weeks sprints? Your answer sounds totally wrong.
Comment: I wish I could +1 your answer twice.
Answer: Iteration is synonymous with sprint, sprint is just the Scrum terminology.
On the question about sprint length, the only caution I would note is that in Scrum you are using the past sprints to gain a level of predictability on your teams ability to deliver on their commitments for the sprint.  They do this by developing a velocity over a number of sprints.  A change in the team members or the length of the sprint are factors that will affect the velocity for a sprint, over past sprints.
Just as background, velocity is the sum of estimation points assigned to the backlog items, or stories, that were completely finished during that sprint.  Most Agile proponents (Mike Cohn, Ken Schwaber and Jeff Sutherland for instance), recommend that teams use "the recent weather" to base their future estimations on how much they think they can commit to in a sprint.  This means using the average from the last few sprints as the basis for an estimate in the upcoming sprint planning session.
Once again, varying the sprint length reduces your teams ability to provide that velocity statistic which the team uses for sprint planning, and the product owner uses for release planning (i.e. predicting when the project will end or what will be in the project at the end).
I recommend Mike Cohn's book on Agile Estimating and Planning to provide an overview of the way sprints, estimation and planning all can fit together.
Answer:
Where I work we have 2 Sprints to an Iteration.  The Iteration demo is before the business stakeholders that don't want to meet after every Sprint, but that is our interpretation of the terminology.  Some places may have the terms having equally meaning, I'm just pointing out that where I work they aren't the same thing.
No, sprints can have varying lengths.  Where I work we had a half a Sprint to align our Sprints with the Iterations that others in the project from another department were using.
Answer:
Sprint is just the term for an iteration.
You can change the Sprint length to be anything you want, but likely you'll want to try to find an amount of time that "works well" (which may mean any number of things for your team) and end up sticking with it over time.
Answer: According to my experience

Sprint is a kind of Iteration and one can have many Iterations within a
single Sprint (e.g. one shall startover or iterate a task if it's
failed and still having extra estimated time) or across many Sprints
(such as performing ongoing tasks).
Normally, the duration for a Sprint can be one or two weeks, It
depends on the time required and the priority of tasks (which could
be defined by Product Owner or Scrum Master or the team) from the Product
Backlog.

ref: https://en.wikipedia.org/wiki/Scrum_(software_development)
Answer: Sprint as defined in pure Scrum has the duration 30 calendar days. However Iteration length could be anything as defined by the team.
Comment: Actually, the sprint duration is 30 days **or less**.


Ultrasonic HC-SR04 echo and trig pins

Question: I am doing a watch with GPS tracker project. I am using an Ultrasonic HC-SR04 sensor. I don't know where to connect the Echo and trig pins with my Arduino. Please let me know how to connect it.
Answer: To any 2 free IO pins.
To quote sparkfuns datasheet:

(1) Using IO trigger for at least 10us high level s ignal,
  (2) The Module automatically sends eight 40 kHz and  detect whether there is a pulse signal back.
  (3) IF the signal back, through high level , time of high output IO duration is  the time from sending ultrasonic to returning.
  Test distance = (high level time×velocity of sound (340M/S) / 2,

In other words you send a short pulse to trigger pin and then wait for the echo pulse and measure how long it was high. Divide the number of microseconds it was high by 58 and you have the distance in centimetres ( use 148 for inches)
Answer: You can connect them to two GPIO pins. It does not matter much which ones (probably between 2 and 12 since these are not used by other functions like the builtin led or RX/TX).
In the following example pins 9 and 10 are used:
Example
Fragment related to the pins:

The HC-SR04 Ultrasonic Module has 4 pins, Ground, VCC, Trig and Echo. The Ground and the VCC pins of the module needs to be connected to the Ground and the 5 volts pins on the Arduino Board respectively and the trig and echo pins to any Digital I/O pin on the Arduino Board.
Comment: Okay I will try sir . Another question that i want to ask is ,what is the red light indication in an arduino nano? and how to connect rx/dx from gps tracker with arduino nano ? please help me
Comment: I don't have a Nano. It's best to post it as a new question with a picture and a mark to the indicator you mean. Also the other question is best to ask as a separate question. I never worked with a GPS tracker.

Ultrasonic HC-SR04 echo and trig pins


Exchange 2007 - Distribution group not work correctly

Question: I have simple server Windows 2008 Standart SP2 with Exchange 2007 with apply SP1. Only one DC and one Exchange server (not exist Edge) in the same server.
I have first distribution group by name "email@example.com" with 10 users. Working with internal and external mail correctly.
I have second distribution group by name "firstname.lastname@example.com" with 3 users. Working with internal mail correctly, but external mail delivery failed 2 from 3 users. Only 1 users proclaims that external mail delivered correctly. Those 3 users they are too member of  distribution group email@example.com" .
I am not found in the eventlog any problem with Exchange server. Any user and any distribution group not check the box "Require that all senders are authenticated."
Any ideas on how to solve the problem?

New informations for this case
Hi all,
i am have enabled delivered NDR report in hub transport. If you request a return receipt in Outlook, then will deliver the answer:
"Your message has been successfully relayed to the following recipients, but the requested delivery status notifications may not be generated by the destination. email@example.com"
I recently tried create new user with name firstname.lastname@example.com and adding member of distribution group with name email@example.com. I sent external mail to firstname.lastname@example.com and i discovered through "Outlook Web Acces" that delivery external email to  the mailbox of email@example.com failed (email has not been found in any folders and antivrus not used). Thick mail client MS Outlok he has never been used for this user. I am verified by use with another user acount through MS Outlook, you see that firstname.lastname@example.com is member of distribution group with name email@example.com. Then i am adding new user email@example.com to distribution group with name firstname.lastname@example.com and i sending testing external e-mail, everything was alright (successfully relayed all members of distribution group firstname.lastname@example.com). Delete and re-create the distribution group with name firstname.lastname@example.com had no effect on the functioning of.
I recently tried create new distribution group with name firstname.lastname@example.com and  adding to member same users as have distribution group with name email@example.com, then i sending testing external e-mail to email@example.com, everything was alright (successfully relayed all members of distribution group email@example.com).
I tried now delete distribution group with name email@example.com and next step functional distribution group with name firstname.lastname@example.com rename email@example.com.  This action had no be effect on the functioning of. Only one from many users external mail  has been delivered successfully. :(
Thank you for reply
best regards Alex
Answer:
Create a new distribution group and add the 3 members of "email@example.com" to it.
Test the new dist-group for proper mail delivery both internal and external.
If the new group is working, delete the old (broken) group and change the display name and smtp address of the new group to whatever they were for the old group.


Bitcoin script verification fails after certain time period

Question: So I want to write a bitcoin script so that after a certain time period (say for example after 30 mins), the verification fails and transaction is marked invalid even if it gets broadcasted. Time locks are used so that a transaction is considered valid after a certain time period. I want the opposite to happen. So can I just enter some bogus lines of code after  OP_CHECKLOCKTIMEVERIFY so that script check intentionally fails? Or is there any opcode by which I can achieve the same functionality?
Comment: That isn't supported by Bitcoin because it isn't reorg-safe.  A valid transaction remains valid until its inputs are spent. This ensures that the blockchain can always be reorganized.
Comment: Again. Not something that can happen in bitcoin.
Comment: Yes that's true. So the premise is that given an input, it can be spent by either party A or party B. The restriction is that party B must spend it within the 1st 30 mins else after that A must spend it.
Answer: This isn't possible with a single bitcoin sript, but your example can be realized quite easily by simply adding one more transaction to the equation:

So the premise is that given an input, it can be spent by either party A or party B. The restriction is that party B must spend it within the 1st 30 mins else after that A must spend it.

Party A and party B cooperate to create a 1-of-2 multisig address, and then have coins sent to it
After 30 minutes, party A will create a second transaction which pays the coins to an address that only party A controls
Now party A can spend the coins, party B cannot

This depends on party A publishing the second transaction, but that step could also be automated and happen during the initial setup of the multisig address. The second transaction could even have a timelock added, such that it could not be published early (though party A can otherwise spend the coins at any time, so this seems unnecessary).
Otherwise, as mentioned in the comments, this sort of construction isn't possible using bitcoin script alone.
Comment: What if OP_RETURN is used to make the output unspendable if a locktime of say 30 mins has elapsed? Sort of burning the output in order to punish B for the delay. Then it that case neither A nor B can spend, right?


Is there a "MacGuffin" in Star Wars?

Question: In a lot of good movie series, there are "MacGuffins' that are central objects that serve as a trigger for the plot. In the lord of the rings, it was the one ring. In Harry Potter, is was the horcruxes, in the last two Avengers films, it was the Infinity gauntlet (or, maybe the infinity stones) etc. etc. My question is: Is there a MacGuffin in Star Wars?
I was thinking maybe the force is a sort-of MacGuffin (it kind of isn't though because it technically was the makeup of all nature and so it wasn't an actual thing)
I mean throughout the entire series. Not each individual trilogy.
Comment: According to Wikipedia, "In fiction, a MacGuffin (sometimes McGuffin) is an object, device, or event that is necessary to the plot and the motivation of the characters, but **insignificant, unimportant, or irrelevant in itself**." By that definition, I wouldn't agree that any of your examples are MacGuffins.
Comment: In which Star Wars? Are you asking for every film, TV series, episodes, The Skywalker Saga, or A New Hope specifically? The problem here is that directors do not always agree on what constitutes a McGuffin? In earler films, it was considered something that drives the first plot, but doesn't remain as important, but for other directors like Lucas, it is suppose to be significant (can even be a character), which I think is more often the case with today's Blockbusters.
Comment: Quite possibly there could be many MacGuffins pinpointed in most of the films, or series, but they aren't that "pronounced". This question is rather too broad and somewhat opinion based. Perhaps Death Stars play similar role to Tolkien's One Ring, but aren't typical MacGuffins
Comment: These days the "MacGuffin" is cash for Disney. 27 hours of feature films alone now.
Answer: The Death Star plans/R2 when he carries the plans are the MacGuffin. They set the plot in motion and are the trigger for getting Luke involved in the story, but ultimately don't mean very much to the audience.
Using Hitchcock's definition of a MacGuffin...

"what everybody on the screen is looking for, but the audience don't care"

...then the plans are it. Lucas says R2 is the MacGuffin because he believes

"that the MacGuffin should be powerful and that the audience should care about it almost as much as the dueling heroes and villains on-screen."

So as soon as the plans are put in R2 then he becomes the MacGuffin.
Note that once everyone gets in their X-Wing at the end for the final battle, no-one in the audience is thinking about the plans anymore, even though they seemed so important before. The MacGuffin served it's purpose and got us to the end. R2 has lost his function as the MacGuffin, but we still care about him.
Comment: Can you add the citation in your answer? Sometimes links die, then we won't be able to see what the actually quote is.
Comment: Why don't we care about the plans? Aren't they critical for saving the rebellion? Compare with the glowing briefcase from *Pulp Fiction*. We can't care about it because we don't even know what it is. Or perhaps the diamonds from *Reservoir Dogs*.
Comment: @ToddWilcox Yes, they aren't as vague as some other MacGuffin's. But like I said, you don't care about them at all once they jump in the X-Wing. You care about R2 because he's a character you now love, not because he has the plans. Nor even while everyone is running around on the Death Star earlier in the film - the audience is asking questions like "how will they rescue the princess?", "will Obi-Wan disable the tractor beam?". It's only once they leave do the plans get mentioned again.
Comment: @ToddWilcox Also, you could switch out the plans for something else and still get essentially the same plot. Off the top of my head, R2 himself could be a weapon that can destroy the death star. Not the greatest suggestion, but you get the idea.
Answer: According to George Lucas in the commentary of Star Wars Episode IV, he claims that R2-D2 is a MacGuffin. The bit that @Todd Wilcox mentions regarding the MacGuffin needing to be, "insignificant, unimportant, or irrelevant in itself", is interpreted differently by different directors/producers so I wouldn't consider that a hard requirement on what can and can't be considered a MacGuffin.

Is there a "MacGuffin" in Star Wars?


SharePoint Online Search Subsite Disable Searching Document Content

Question: For SharePoint Online, is it possible in a search results web part to exclude the contents within a document (i.e. pdf) in the results, and to only search metadata? Basically, I want it to search only on title. I understand as part of OOTB SharePoint, the contents of the documents are automatically included. I was just wondering if there is a way to turn that off.
Answer: I've seen this question before, and think the answer is no.
If you know the metadata columns you might customize the web part's query to do an OR search on just the metadata columns. This is probably not the correct syntax...
<code>Title:{Search Term} OR ProjectName:{Search Term} OR Description:{Search Term}
</code>
This works for just Title: Edit the Search Results web part, click Change Query, edit the query text.


What will happen when all 21M bitcoins are mined?

Question: What will happen when all 21M BTC are mined ? How will miner get new coin as reward? In absence of it, the only option available will be to increase transaction fees? If I have to pay anyway fee, I can pay that to centralized entity now also. Help me understand.
Comment: Seems that your understanding is correct :) Once all new coins are minted then the miners will need to be incentivised on transaction fees alone.
Comment: Bitcoin is decentralized and trustless.
Answer:
the only option available will be to increase transaction fees?

You are right, when no more bitcoins can be mined, the only reward for miners are transaction fees.
According to Section 6 of Satoshi Nakamoto's Bitcoin whitepaper, 2008 - the only mining incentives are these two possibilities.

If I have to pay anyway fee, I can pay that to centralized entity now also.

Of course, Nakamoto intended to create "an electronic payment system" but Bitcoin appears to be mostly used as a speculative investment platform.
It may be that this predominant use has hastened the increase in mining difficulty and made use of bitcoin for small retail transactions unattractive to many in a shorter timescale than Nakamoto may have envisaged.
According to Bloomberg July 2017:

Bitcoin Acceptance Among Retailers Is Low and Getting Lower

There have been a variety of efforts to make Bitcoin more scalable and more usable as an electronic payment system - especially for smaller transactions. One of the more prominent is the Lightning Network - but this seems to be an additional layer with some overtones of corporate financial institutional structures.
According to the Lightning Network whitepaper, January 2016:

The Bitcoin blockchain holds great promise for distributed ledgers,  but
  the  blockchain  as  a  payment  platform,  by  itself,  cannot  cover  the  world's commerce anytime in the near future.

When you create a Bitcoin transaction today, you are essentially placing trust in two or three large Chinese corporations who process the majority of transactions and who are somewhat beyond the reach of your government (unless you are a PRC citizen) and it's financial regulators.
It is yet to be seen whether LN will be as decentralised as its proponents hope or will, as some detractors say, also come under the control of large corporations.


Will Sodium Amide react with Epoxides in the same manner as Grignard Reagents?

Question: I have been unable to find the reaction anywhere on the internet so I'm assuming the answer is no, although I would like an explanation as to why.  I can't seem to find any reason why it would not work, provided the reaction is carried out in two steps.  In the first step, H2N:- will act as a nucleophile, attacking the least sterically hindered carbon of the epoxide.  The second step would of course be an acidic workup.  As stated in the question, I would expect the same exact mechanism as the reaction of Grignard Reagents with epoxides (substituting sodium amide as the nucleophile) due to the high basicity of sodium amide and Grignard Reagents.  Like I said, I'm not expecting the reaction to be viable.  However, I would like to know exactly why not.  Im assuming it's something to do with the Hydrogen atoms of the amide anion, though I could be wrong.  Enlighten me.
Answer: It actually is possible but it works well only with simple epoxides so it is not wildly used. $NaNH_2$ is extremely basic (it can deprotonate alkynes) and too many functional groups can react with it: alkyl halides (elimination), aldehydes, ketones...
To work around that basicity, sodium azide $NaN_3$ is commonly used instead, followed by the reduction of the azido group into an amine.
For example, see this article.
Comment: Thank you!  Since I was unable to find any info on this, I was beginning to think I was crazy for even considering it!  And I was aware of the 1) NaN3 followed by 2) LiAlH4  method for forming primary amines, I was only considering this possibility as a possible more green (less chemicals used) and more efficient (less steps) method.  However, with all the side reactions that could occur with the amide route, the better option is clearly the azide/hydride route.  Id upvote you if I could but my rep is too low.
Comment: @Ki11akd0g Well maybe you are crazy but for another reason :-) For the reduction of azides, I usually preferred hydrogenation when possible, or the Staudinger reaction (triphenyhosphine with a little bit of water) when I had reducible moieties, though thriphenylphosphine oxide can be a pain to get rid of sometimes.
Comment: Well from what I have heard, Lithium ions can also be a pain to get rid of as well.  Guess you just have to pick between whatever the lesser of two evils is for a particular application X-)


Is it okay to host a node that connects on the clearnet?

Question: There is some concern in regulatory bodies about governing Monero in the future. Does this have implications for people hosting nodes at home on personal computers and connecting on the clearnet, without a VPN? Thanks.
Answer: This is related to your local juridiction.
In most countries, running an application, as long as it does not break any existing laws, is totally legal.
If something change in the future, it might just be on the taxation of cryptocurrencies themselves.
Nodes owner may not be targeted by this taxation, or may be depending on your juridiction.
To summarize: look at your local laws to ensure your not breaking any (it's highly improbable you are) to run a node today, and stay tuned to your juridiction's new law to avoid breaking them.
But in the future, Kovri will be in General Availability release and integrated to Monero so that you shouldn't be seen by any juridiction.
This could help you to continue using the software in case of banishment, if regulators don't manage to apply a taxation model on secure cryptocurrencies.  That said, i would not push you to break any law.


How is a Caesar (Shift) Cipher represented at Binary level?

Question: If I want to encrypt the letter H, represented by ASCII 01001000 in Binary, with a key of 1, represented by  00110001. We should get the letter I, represented by 01001001. (H+1 = I through a shift). What actually is the binary manipulation process to get I using the key of 1? How do we get to 01001001 using 00110001? Straight addition of the Binary values doesn't come to the answer.
Answer: A Caesar cipher commonly operates on letters. This is often true for classical ciphers. Modern ciphers instead operate on binary values; most of the time implementations consider bytes instead of bits as atomic values.
The 26 letters form the alphabet of the classical cipher. The alphabet is a sequence of characters; in this case it is simply the English alphabet or ABC. The shift of the Caesar cipher is performed using the location within the sequence, using modular addition. The modulus is the number of characters in the alphabet, in this case of course 26. For this reason it is better to use 0 as starting index for the letter A. Modular addition can simply consist of first adding the shift, and then performing the modulus operation.
Fortunately the characters of the alphabet are already in order within the ASCII table. So instead of doing any binary arithmetic you can simply subtract the value of the letter A from the character you need to encrypt/decrypt. This way you get the location in the sequence of the alphabet. Then you do the shift. Finally you can simply add the value of the letter A to get the ciphertext back.
Creating a larger alphabet, for instance containing letters and digits, is certainly possible. In that case the letters and digits combined are the ciphertext. Determining the index in the alphabet for the cipher will of course get a bit harder (e.g. if x is a digit then the location could be x - '0' + 26 to place it after the letter Z in the alphabet). Alternatively you could write down the alphabet "abcdefghijklmnopqrstuvwxyz0123456789" and then use an indexOf function to find the location in the alphabet string.
So in the end, no binary operations are necessary. Addition, subtraction and modulus are all the operations you need.
Notes

Characters outside the alphabet are often removed before performing encryption for the Caesar classical cipher.
There are multiple ways of handling case, but simply converting everything to upper or lowercase - whichever you decide to use - before encryption should do the trick nicely.
Many languages include a remainder operator rather than a modulus operator. This can be tricky when decrypting as subtraction may result in a negative value.
Comment: Wow.  Excellent. You explained it perfectly!
Comment: No problem, happy programming when doing the implementation :)
Answer: Hint:
Binary are just a way to represent numbers.
If I rephrase what you are asking but using decimal numbers this gives us:

If I use "a" (meaning +$1$) as a key, How can I get from $073$ (H) to $074$ (I) by "adding" $67$ (a) ?

My suggestion would be to find a way to convert this $67$ into a $1$ before doing the addition.
If it might also help if you try to do the operation with "b" as a key (i.e. +$2$)...


Installing Ubuntu 13.10 on MacBookPro11,3

Question: I've been trying to install different flavours of Ubuntu on my MacBookPro11,3 (15-inch) and nothing seems to work. Once I pass the Grub bootloader stage, all I'm getting is a blank screen.
I've seen some issues with installing Ubuntu on Apple's new Haswell-based hardware, so I assume that's the cause. I've installed Ubuntu just fine on previous Apple hardware.
If it helps, I've booted into recovery mode and this is the state I get stuck at:
Recovery Mode Boot Screen
Has anyone else had this problem when installing Ubuntu onto the recent Macbook Pros?
Answer: Figured out the problem. Stay away from the i386 image. The amd64 image, like from this page, actually works.


Where are the modifier scripts in the Blender package contents folder?

Question: I need to find where Blender has applied their modifiers and physics scripts within their program so that I can install and place my own that I have. Either it has been a very long day already or I am simply blind because I have looked through every file and every option available for several hours now and am about to go crazy. If someone has a file path or can send a screenshot of where it is it would be much appreciated.
Answer: Blender's modifiers and physics related routines are written in C/C++, you won't find them in the scripts directory. Download Blender's source here as an archive or use GIT


Drag images with caption in WP editor

Question: Whenever I insert an image without a caption in the post, the editor makes it an object that I can select and move around / scale.
Whenever I insert an image with a caption, it inserts fine. I can scale the image, but I can't move it around. I think that's because the caption displays beneath the image, wich is just text.
Is there a way to make the image + caption an object or something, so that I can't select the caption text, instead selects the whole lot, so I can move it around?
Or maybe is there a hook to target images with captions in the WP editor, and just don't display the caption ( so it's treated like a normal image )?
Thanks in advance.
Answer: This is/was a known bug that should be fixed in WP >= 4.4
See this ticket for details: https://core.trac.wordpress.org/ticket/28003

Drag images with caption in WP editor


Hosting provider recommendation for site to accomodate a php http proxy

Question: Recently discovered my current hosting provider doesn't allow php proxys.
Unfortunately for a site I'm building, there is no other option (Flash based web application to consume Twitter API)
Can anyone recommend an affordable hosting provider with this feature?
Answer: I personally recommend that you use a dedicated hosting platform for this type of application, which can be quite data-intensive depending on traffic. However, in the past, I have had clients who use HostGator and other budget hosts for proxy-based applications with no problems (until their data consumption skyrocketed due to traffic, in one case).
For a dedicated host, I highly recommend ThePlanet and SoftLayer. If you're looking for something in between, a VPS can be nice. However, it does all depend on your usage and traffic.
Answer: if you're setting up a public (anonym?) proxy then it will consume huge resources and dedicated might be the only option.
but if you only need to connect to twitter API for private use, then you can use any good shared hosting. most of them allow php to connect to external API.
usually, people use http://php.net/manual/en/function.fsockopen.php
just find any good hosting that allow fsockopen


ACS Evaluation for a Company who has stopped working

Question: So I was working on a Consulting capacity 8 years ago with a company who have closed their operations recently. Since this experience is vital for me to claim that 1 years of experience for my 5 extra points, can someone let me know what I could do show that experience in the ACS evaluation? I don't know anyone who was working with me since I was the only one representing them. Can anyone let me know what could be my further options?
Comment: Would e.g. your employment contract count? Did you not have a boss you could contact? Search people on Linkedin?
Answer: ACS Skill Assessment recognizes that there may be circumstances in which applicants are unable to obtain the necessary information directly. In that case, the applicant can make a Statutory Declaration; see page 12, Section 11. STATUTORY DECLARATIONS AND AFFIDAVITS.
A better understanding may be had from an earlier ACS document, Pre-Application Skills Assessment (PASA) Guidelines for Applicants:

1.2. Where past education providers and/or employers no longer exist and you need this information for your application, you may submit a personal statement on a properly signed and witnessed Statutory Declaration. The Statutory Declaration is to detail as a minimum:
§ the reason/s why you are submitting a Statutory Declaration; and
§ all the necessary detail about your education and/or employment.
Important: If you provide a Statutory Declaration with your application, you must also provide some form of corroborative information from a third party for the claims made in the Statutory Declaration.


What is the difference between hierarchical tree navigation and nested doll navigation?

Question: Wondering about the difference between these two types of organizational models when it comes to parents, siblings, etc.
Answer: @Ana, for Hierachical tree and Nested doll navigation is explained in detail here at (interaction-design.org) https://goo.gl/QKkVJK (along with Hub and Spoke Navigation, Bento Box Navigation, Filtered View Navigation)
Navigation is a vital part of the user experience for mobile apps and getting it right will ensure that users can open your app, get to where they want to be and then get moving on something else. This in turn, is likely to incentivize long-term adoption of your mobile app rather than short-term use and then abandonment. Navigation need careful attention to get it just right for your users.
Hierarchical Tree Navigation
This is the most common form of navigation in traditional websites and applications. It provides a top-level category for navigation followed by further layers of content in sub-categories below that level.
The drawback is that this model can quickly become difficult to accommodate on the mobile screen; the more content you have, the more difficult it is to squash all that data into the screen.
The image below shows how an app might handle the navigation through the different sects of Islam using a hierarchical structure.
Nested Doll Navigation
This is a more typical navigation system for mobile apps. Each time the user moves to a level in the hierarchy of navigation – new items below it are revealed. It uses a move from broad overviews to more specific details. It works well on the small screen but it can be challenging to support horizontal movement between sections when implemented. It gets its name from the concept of nested dolls which are a series of dolls which fit within each other.


What Permutation Entropy really is?

Question: I was wondering about what is permutation entropy(PE). Then, I came to know this paper which describes PE. Now, let's assume that we have a pseudorandom permutation that is generated using an entropy source and we used a uniform shuffle algorithm(like Fisher-Yates shuffling algorithm). Also, assume that we use a 256-bit entropy to shuffle $\{0,1\}^8\rightarrow\{0,1\}^8$. Then is the fact true that the output permutation can have at max 256-bits of entropy? For every value of entropy, we shall get a unique corresponding permutation.
Answer:
Assume that we use a 256-bit entropy to shuffle $\{0,1\}^8\rightarrow\{0,1\}^8$. Then is the fact true that the permutation can have at max 256-bits of entropy?

There's a semantic problem: in cryptography, unless otherwise stated, we consider Shannon entropy, and that's defined for a symbol-generating process, not for a symbol. A permutation can be a symbol, not a process. Hence "permutation … have … bits of entropy" is not something defined. That's true including if we consider Permutation Entropy (a different breed of entropy, discussed in the second section of the present answer).
What we can define is the entropy at the output of a deterministic process/algorithm generating permutations. And then yes, if there is 256-bit entropy (per symbol) at the input of this process (for example, if the input consists of 256-bit bitstrings chosen uniformly at random, uniquely defining one output permutation in a deterministic manner), then there can be at most 256 bits of entropy (per symbol produced, that is permutation) at the output. Argument: applying any deterministic function $f$ to a source of symbols $s$ can not increase it's Shannon entropy, defined as
$$\sum_{s\text{ with }\Pr[s]>0}\Pr[s]\,\log_2\left(\frac1{\Pr[s]}\right)$$
because $f$ can only change that sum when $f(s)=f(s')$ with $s\ne s'$, $\Pr[s]>0$ and $\Pr[s']>0$, and then that change is the negative
$$\Pr[s]\,\log_2\left(\frac{\Pr[s]}{\Pr[s]+\Pr[s']}\right)\,+\,\Pr[s']\,\log_2\left(\frac{\Pr[s']}{\Pr[s]+\Pr[s']}\right)$$
What's more, that threshold of 256-bit output entropy is exactly achievable: there are $(2^8)!=2^{1683.996\ldots}$ shuffles of $\{0,1\}^8$, and that's (way) more than $2^{256}$. Depending on how we use Fisher-Yates shuffling and the form of the entropy at the input, that threshold will be reached, or not.
One way to reach this 256-bit output entropy threshold, if the 256-bit input entropy is in the form of a 256-bit uniformly random bitstring, goes: the first 64 times the Fisher-Yates algorithm requires a random integer $j$ in range $[0,i]$ with $i\ge15$, we pick an integer $j$ in $[0,15]$ based on 4 bits of the input (that we assemble into an integer per big-endian convention, then discard). And any other time the algorithm requires a random integer, we pick the integer $j=0$. That method will generate one of $2^{256}$ distinct permutations with probability $2^{-256}$ for each, and probability $0$ for the $(2^8)!-2^{256}$ other possible permutations. That's exactly 256-bit Shannon entropy per permutation output by this process.
As noted by Maeher, the above must not be used to generate a pseudo-random permutation from a 256-bit uniformly random bitstring in a cryptographic context! If that's needed, one option is to seed a Cryptographically Secure Pseudo Random Number Generator (CSPRNG) and use it to generate the $j$ in $[0,i]$ during Fisher-Yates. The output entropy will still be near 256-bit per permutation, but it will be computationally impossible to distinguish the output permutations from permutations generated at random (that is, with $1683.996\ldots$ bits of entropy per permutation).

Answering the title of the question

What Permutation Entropy really is?

Permutation Entropy, and the "paper" linked in the question (which I won't discuss or seriously consider), have no relation with the entropy of a permutation generator. Permutation Entropy is an alternate entropy defined by Christoph Band and Bernd Pompe's Permutation entropy: a natural complexity measure for time series in  Physical Review Letters, 2002 (paywalled).
Given a source of values, it's Permutation Entropy of order $2$ is the Shannon entropy of a modification of the source, where we replace a symbol by $0$ if it's lower than the next, by $1$ otherwise.
This generalizes to Permutation Entropy of order $n>2$: we replace each symbol by an integer $k$ in $[0,n!)$ characteristic of the order of $n$ symbols starting from there.
A property of Permutation Entropy is that it's invariant when the source goes thru any strictly monotonous transformation. Perhaps that's interesting in physics, but I do not see that this property, or Permutation Entropy in general, is much useful in cryptography.
Comment: It may be noteworthy that, while your suggestion for preserving the entropy through FY works as far as I can see (it generates distinct permutations for each possible input value) it would be a **terrible** way of shuffling, that's trivially distinguishable from a random permutation. (It's also not *really* FY, or it's modern equivalent, anymore, since that mandates uniformly choosing the indices.)
Comment: @Radium: I have added a way to generate a permutation from a random 256-bit bitstring that is computationally indistinguishable from having maximal entropy (1683.996… bit per permutation). I think it is important to not confuse Permutation Entropy (a variant of entropy), entropy of a permutation (undefined), entropy of a permutation-generating process as in the question (256-bit or less, including with a CSPRNG+FY), entropy of a true-random permutation-generating process (near 1684 bit) that's indistinguishable from CSPRNG+FY.
Comment: Can you elaborate on why FY can be a terrible idea to shuffle?
Comment: FY is fine if you use uniform randomness or a pseudorandom generator. However a PRG would not guarantee preservation of entropy, so @fgrieu defined a way of mapping 256bits to the randomness required by FY in a way that *does* preserve entropy but results in garbage shuffling. (Basically everything beyond the first 64 entries will simply be shifted by one position.)
Comment: If a PRG obeys it's definition then it shall produce a bit string which should be indistinguishable from a random bit string stream(|Y|>256bit). A 256bit seed(X, uniformly random) should be enough for present standards. Though a PRG will always leave some $\delta$ advantage to the attacker. Is it the case that if someone use the said PRG in FY then the advantage to the attacker is more than $\delta$?

What Permutation Entropy really is?


Android tab layout issue

Question: I'm having a bit of a problem with the Android tab layout. I've been trying to make a screen that holds 4 tabs, and a fragment beneath them, when a user presses each tab the fragment dynamically switches to another activity and the tabs stay static, my problem is that I tried to implement it with tab layout and it's deprecated in since Android 4.0, so I tried it with the action bar tabs but then I have the action bar that I don't want nor need.
I have two questions:

Is it possible to use action bar but to hide the action bar and show only the tabs?
Is there a way to use tab layout on Android 4.0 and higher versions?
Answer:
I am not really sure about whether you can achieve it or not but if you want to play around with the ActionBar, this would be one of the best places to start.
Just because it is deprecated, doesn't mean that you can't use tabs in Android 4+. ;)
You surely can use Tabs and TabLayout in Android 4+ and everything works perfectly(though you apparently should not as ActionBar is a must better option).
I have tried it myself because even I prefer the TabLayout more than the ActionBar, and thankfully haven't run into any issues until now!
The only thing you will notice is that Eclipse will draw a yellow line over the deprecated code (which you can obviously ignore or just choose to hide all deprecated warnings).
Answer: 1.Yes there is possibility.....you should try http://actionbarsherlock.com/
2.ActionBarSherlock works from sdk 7 to sdk 16

Android tab layout issue


Open a text file in cygwin's VIM

Question: Is there any way to configure Windows to open text files in Cygwin's VIM instance? I am currently using GVIM but I find it limiting for many reasons. Unfortunately, I can't just install Debian on this machine and be done with it!
Answer: Create cvim.bat file:
@echo off
chdir C:\cygwin\bin
start "" mintty.exe /usr/bin/vim.exe %1

Place it on your PATH and then cvim yourfile.txt or as Heptite has said: right-click on a .txt file and select "open with" you should be able to click "Browse" and go to that cvim.bat. Then you can click "Always use the selected program to open this kind of file".
Answer: If you want to open VIM with the mintty terminal, you could use the following set-up:
First create a bash-script with the following:
#!/bin/sh
FILEPATH=$(cygpath -u "$1");
vim "$FILEPATH"

This will convert the windows filepath into a unix-style filepath for cygwin. Place this script (for example) in /bin/native-vim
In regedit (regedit.exe) you should go to HKEY_CLASSES_ROOT/*/shell. Create a new key (rightclick on shell) with as name Edit with VIM. Change the standard value to Edit with &VIM. Create a new key in Edit with VIM with the name command. Change the standard value to C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico /bin/native-vim "%1" (or the path to your mintty.exe and bash-script).
The changes in your register could also be accomplished with these register-keys:
[HKEY_CLASSES_ROOT\*\shell\Edit with Vim]
@="Edit with &Vim"

[HKEY_CLASSES_ROOT\*\shell\Edit with Vim\command]
@="C:\\cygwin64\\bin\\mintty.exe -i /Cygwin-Terminal.ico /bin/native-vim \"%1\""

Comment: Thank you very much! I don't have a cygwin environment to test in right now (happily at home in Linux) but as soon as I have to fight with another Windows machine I will try this. +1 in the meantime. Thanks!
Answer: If you right-click on a .txt file and select "open with" you should be able to click "Browse" and go to C:\cygwin\bin\vim-nox.exe.  Then you can click "Always use the selected program to open this kind of file".
However, I prefer to just have a "native" Windows Vim install and use that.
Comment: For posterity, and my future self: [Use cygwin shell](http://vim.wikia.com/wiki/Use_cygwin_shell).
Comment: Thank you, that does work. However it opens in a CMD-like window with no access to the Cygwin shell. Is there any way to have it start in a new or existing Cygwin instance?
Comment: That gets trickier, and I don't know if it's possible at all.  I suspect that if it is, it would require directly modifying the registry to change the command for the .txt filetype, and I'm not that talented with Windows (it has never been my primary OS).
Answer: As long as path to the vim binary is the PATH environment variable, you should be able to run it from any command line like so:
vim filename

If you already have a running instance of vim, try:
vim --remote filename

Since you're using Cygwin, the man page was probably installed along with it. You can view all the options for invoking vim on the command line with:
man vim

Comment: Thank you Dorian. I did find the path to Cygwin's VIM from Heptite's answer. However it opens in a Windows-environment terminal, not in the Sygwin-environment terminal. Do you know how to open the program in the Cygwin terminal? Thanks!
Comment: Off the top of my head, running the command in Cygwin terminal should work. Otherwise you can do a somewhat complicated invocation of the shell that you use in Cygwin (probaly bash).
Comment: Thanks. I suppose that I could start browsing the Windows directories in Cygwin. I was hoping for a bridge from Windows Explorer (the Windows file manager).
Answer: Here is the windows_gvim.bat file that I use to open text files with cygwin gvim under Windows. It works for cygwin vim too, just replace gvim with vim.
set "var=%1"
set "var=%var:\=\\%"
C:\cygwin64\bin\mintty.exe /bin/bash --login -c "gvim $(cygpath -u '%var%')"

Open a text file in cygwin's VIM


How to export website field for a contact where website is specific website type?

Question: I select some contacts for export. In my field mappings, I add Website but it does not give me the option to choose a specific website type. Is there any way to do this?
Answer: I have a website type called Twitter Website, for storing Twitter "handles". Each website/handle contains 'twitter.com' (i.e., like www.twitter.com/joemcl )
So using Search -> Search Builder, I search for Contacts Website Like %twitter% , then select all search results, select Actions, then Add Contacts to a Group (or better perhaps, choose New Smart Group) to create a new Group of every contact who is a Twitter user.
The same can work for Facebook as a website type.
Obviously this won't work for type 'Work' or 'Home', which won't be in the website name, which is what I think you actually want.


Investing in Halacha

Question: Does anyone know some halachik sources that discuss investing in stocks? There are many potential issues. For example, do you need to worry (about ribbis) if your money is used to lend with interest? Could dividends be a problem of ribbis? What if the company earns profit from basar b'chalev or from chametz over pesach?
Also, would it make a difference if you invest in ETF's or mutual funds instead of directly in the stocks?
Comment: How much are stocks in Halachah going for these days?  I can't find them on exchanges.
Comment: @SethJ maybe check Judaism.StockExchange~
Comment: See also: http://mi.yodeya.com/questions/6367/owning-stock-in-companies-that-operate-on-shabbat , which may have a bearing on some of these questions. This might get better answers if rewritten as a series of separate questions.
Answer: An early source would be the Kitzur Shulchan Aruch 65:28 who says that even if some of the shareholder are Jewish, it would be forbidden to join, if they are borrowing from or lending money to Jews, and charging interest.
סימן סה – הלכות ריבית
סעיף כח
מעותיו של ישראל מופקדים ביד עובד כוכבים, והלוה אותם לישראל בריבית, אם היו באחריות העובד כוכבים שאם יאבד החוב יתחייב הוא לשלם במעותיו מותר, ואם אינו באחריות העובד כוכבים אסור. ולכן במקום שיש קבוצות מעות (קופות חסכון) וכדומה שיש לישראל חלקים (מניות) שמה וישראלים לוים משם בריבית, אף על פי שהממונים המה עובדי כוכבים, מכל מקום נראה לי דאיסור גמור הוא. ולכן אסור ליתן לשם מעות (כי שמא ילוה ישראל שאינו הגון) וכן אסור ללוות משם, כי שמא נתן לשם ישראל שאינו הגון.
Answer: I figured I'd look into this a bit more and write a post and answer for the topic.
Most companies borrow and lend with interest, sometimes to other Jews. Since you own a share in the company, it could be considered that you're involved in the transactions. The Tosefta (BM 5:8) states that you cannot give your money to a non-Jew to lend with interest:

ישראל שאמר לעובד כוכבים הילך שכרך וצא והלוה מעותי ברבית אסור ועובד
  כוכבים שאמר לישראל הילך שכרך והלוה מעותי ברבית מותר אבל אסור מפני
  מראית העין מעות של ישראל מופקדות אצל העובד כוכבים מותר להלוותן ברבית
  ושל עובד כוכבים המופקדות אצל ישראל אסור להלוותן ברבית זה הכלל כל
  שבאחריות ישראל אסור כל שבאחריות עובד כוכבים מותר

Does this same issue apply when you own a share in a company? As @Danny mentioned, The Kitzur Shulchan Aruch (65:28) takes a machmir stance on a similar issue, but most poskim find some kula.
limited liability leniency
As discussed in Halacha and Contemporary Society and in @Shalom's answer, some poskim say that since an investment in a corporation is of "limited liability" (i.e one cannot be personally responsible for any damages or debts), the prohibition of ribbis does not apply. They bring a proof from the Gemara in  גיטין דף ל עמוד א:

ת"ר: המלוה מעות את הכהן ואת הלוי ואת העני להיותמפריש עליהן מחלקן -
  מפריש עליהן בחזקת שהן קיימין, ופוסק עמהן כשער הזול ואין בו משום רבית,
  ואין שביעית משמטתו, ואם בא לחזור - אינו חוזר; נתייאשו הבעלים - אין
  מפריש עליהם, לפי שאין מפרישין על האבוד. אמר מר: פוסק עמהם כשער הזול.
  פשיטא!הא קא משמע לן, אף על פי שלא פסק, כמי שפסק דמי. ואין בו משום
  רבית. מאי טעמא? כיון דכי לית ליה לא יהיב ליה, כי אית ליה נמי אין בו
  משום רבית.

The involves granting a loan to a Levi or Kohein and agreeing to collect from ma'aser instead of him repaying the loan. Even though the prices can change, it is assumed (or you agree) to "collect" at a set price. This would normally be ribbis derabanan, (since by paying in advance you might benefit), but the gemara says its OK here "כיון דכי לית ליה לא יהיב ליה" which (according to Rashi, I think) means that if the farmer's whole crop is ruined he won't need to take ma'aser and the levi or kohein won't need to repay the debt at all. Since there's no guaranteed principle, it seems Ribbis doesn't apply. This could perhaps be extended to a corporation, since if the whole corp. goes bankrupt, one cannot collect debt from the shareholders. Though there could be some differences, and it's a bit of a leap from a derbanan to full-fledged ribbis.
you don't own nothin'
R' Moshe Feinstein (End of  אגרות משה אבן העזר חלק א סימן ז) addresses the problem of owning stock in a company that does work on Shabbos. He says that a regular shareholder doesn't really have much knowledge or control over the company so it's not like a partnership where there would be all these issues. You just want the profits (or losses) of the stock and maybe you don't really own anything since really it's  דבר שלא בא לעולם, so you just own it [somewhat?] because of Dina d'Medina.
Q:  But shareholders can vote.
R'Moshe: Technically, yes, but does that really matter? The people on top make sure they keep control anyways, and do you really care about your vote? But if you're going to claim a big stake (i.e. become an activist shareholder), then you have a problem...
One would have to examine why stock ownership isn't considered "real" and why Dina mDina would only grant quasi-ownership.
Other Kulas
Maybe the "legal person" of a corporation is real in halacha too (Romney would be happy). Or maybe breira could somehow help. See JLaw.com for some more sources.
Mutual Funds, etc.
Often one doesn't buy stocks directly, but invests in a mutual fund which buys stocks. This seems like it would be even easier to be meikel, since you don't directly own stock and definitely have no say over anything. I'm not sure who discusses this kula, but it seems that some Kosher funds rely on this (see JPost article).
Answer: The base case: the prohibition on interest is only if the principal is guaranteed. A business investment is just that -- I put in $1000 to help you open your pizza store and thus own a 5% stake in it; if your pizza store does well, I could make $500; if your pizza store fails, I could even lose my initial principal of $1000. The same is true for stocks, as I understand it.
The next case (your first question): I buy stocks in Acme Financial, so now they're using my money (among others') to lend to Jews with interest. The Kitzur Shulchan Aruch Danny had cited says the "ownership" of that money depends on who's responsible for it: if the borrower defaults to Acme Financial, does Acme Financial turn around to me and say "sorry buddy, your money disappeared"? Or does Acme Financial owe me my money back from some other loan. My understanding is that if Acme Financial's overall value drops, I won't get back all of my investment (and they could tank so badly I could get back none of it); but as soon as I buy stock in them, they take responsibility for that money and seek to maximize overall return to investors as much as possible. I'd therefore read as the Kitzur Shulchan Aruch's case where it's the non-Jew's responsibility and therefore any proceeds are allowable to me. The prohibited case discussed would be where Jews pool their funds, go to a non-Jew and say "this is our money and if anything happens to it, we lose out; please go invest this", and the non-Jew turns around and loans to Jews with interest. That's different, if I understand it, from buying stock in a company.
Chametz on Passover is a debate among contemporary authorities. For instance, Rabbi Hershel Shachter feels it is a problem and includes chametz stocks in what he sells to a non-Jew before Passover; Rabbi Mordechai Willig feels it's too far removed from ownership to pose a problem; you can't walk into a General Mills factory with your stock certificate and demand a box of Cheerios!
Comment: "this is our money and if anything happens to it, we lose out; please go invest this" is exactly what a stock is. I'm not sure how you are distinguishing the cases.
Comment: @YDK, the publicly-traded company has other money besides what *you're* putting in, most of it from non-Jews.
Answer: RE: "limited liability leniency As discussed in Halacha and Contemporary Society and in @Shalom's answer, some poskim say that since an investment in a corporation is of "limited liability" (i.e one cannot be personally responsible for any damages or debts), the prohibition of ribbis does not apply"
It must be noted that this leniency applies only to RECEIVING interest from a Limited liability corporation, But PAYING interest to a LTD/ Corp is forbidden even according to this opinion Thus if the investment or Stock transaction included any type of interest payment TO the company it would be forbidden even according to this opinion
This is clearly stated in the IGROS MOSHE, Where R' Moshe Feinstein discusses this opinion
Comment: [Welcome to MiYodeya](https://judaism.meta.stackexchange.com/questions/3886/a-beginner-s-guide-to-my-how-is-this-site-different-from-other-judaism-sites). It is best when you can source precisely your comments (e.g., where in Halacha and Contemporary Society, where in Igrot Moshe?) Hope to see you around !

Investing in Halacha


Sound Processing using USB sound card and microphone

Question: I want to use a microphone and get input from it to sample it in real time and I don't have a set idea about how to interface it to get the input. Any help will be appreciated.
Comment: Possible duplicate of [Configuring jack into a microphone input](https://raspberrypi.stackexchange.com/questions/56109/configuring-jack-into-a-microphone-input)
Answer: I plugged a usb sound card, one of those £2 eBay ones yesterday.
http://www.instructables.com/id/Use-USB-Sound-Card-in-Raspberry-Pi/
This guide sorted me out.  I had it all working in under 30mins.
Answer: If you have to use the USB as the input, then you should set up an asym plugin (in your .asoundrc file) to allow you to read from the USB card and write to the onboard audio jack on the Pi.
Alternatively, you could purchase a high quality sound card which does both input and output and simply use the one card. The advantages of using the one card is that there will be no clock drift between audio devices. There are other advantages, such as the ability to NOT use plugins and use ALSA more directly.
A short list of available cards (with inputs) is available on eLinux here.
If you would like to use the asym plugin route then setting up the asym plugin has been summarised on stack exchange here. A snippet from that discussion is to setup your .asoundrc file using your devices names, like so (which will playback on device 1, sub device 1 and capture from deivce 0) :
<code>pcm.!default {
    type asym
    playback.pcm "plughw:1,1"
    capture.pcm  "plughw:0"
}
ctl.!default {
        type hw
        card 1
}
</code>
Comment: Thank you for the response, I will be using two USB jack with pyaudio as I want to use two microphone at the same time. Do you know a better alternetive to pyaudio for the use of two microphones simultaneously.
Answer: You can attach a very cheap USB "stick-shaped" sound card, e.g. I have something like this (although it was Goobay branded, but I think they have all the same chips). They are class compliant so work out of the box. If you run a professional computer music software to capture the microphone signal, e.g. SuperCollider or Pure Data, you may also want to install QJackCtl as a simple interface in wiring up the sound app and the card.
Answer: I used this Mini USB 2.0 3D Virtual on my Linux embedded devices running on debian ARM OS and it works just great with any regular microphones.


Website for satellite down/uplink frequencies and live footprint?

Question: I am looking for a website that has the satellite footprint as well as the downlink freq. I just got a 2m/70cm handheld and want to see what I can pick up.
Comment: The satellite tracking websites are often a bit optimistic. I remember many disappointing evenings listening and not hearing anything. Often websites will list satellites that aren't actually on 2 m, because they're deceased, or have 2 m but don't use it, or have a schedule of modes on different days, etc. Read around in some forums too. There are probably only two or three with active 2 m downlinks, plus the ISS on packet.
Comment: As of 2-24-2020, additionally, check here `https://www.amsat.org/two-way-satellites/` for more current FM operations, or here `https://www.n2yo.com/passes/amateur-radio.php` at N2YO for more of a satellite by satellite detailing of frequencies.  When any of these sites has a link to a detail page, take a look.  The Diwata-2 (PO-101) page is very informative, here `http://phl-microsat.upd.edu.ph/diwata2`.  Nearly half the power budget is for the ADCS, and
Comment: I imagine this ADCS will take priority if they are imaging a disaster area with the imaging sensors onboard.  The ADCS is used to orient the satellite (and its sensors) at the desired location on earth.  The ARU is then no longer a priority on the power budget.  It is helpful to be aware of such things.
Comment: Does it have to be a website?  A local running tracking program (app) on your favorite device will give the most configuring options for tracking and signal footprints, possibly provide notifications for you, and be a door to other important understandings, like Two Line Element orbital data, and where and when they are published and updated, which leads to this, and to that, and very interesting fun to share with onlookers when and where appropriate.
Answer: n2yo.com is a wonderful resource for keeping track of all of the orbiting satellites. It has many resources for tracking info to enter into tracking software and other places. It also shows a live google map of the location of each satellite.:

amsat.org also has a wealth of information about contacting and tracking the satellites including uplink and downlink information and tips.:
Answer: If you're just using the antenna that comes with the HT, don't get your hopes up.
The only FM sat is Saudi-Sat 50, and its transmitter outputs 200mw. It will be very difficult, if not impossible, to hear that bird without a directional antenna. In some conditions, you may be able to hear a "moment of something" from SO50, and perhaps pick up the digital signals from NOAA satellites as they go overhead.
There are plans online for building a hand held directional antenna out of anything meta from a wooden stick with arrow shafts, and even using an old tape measure. It is not all that difficult and it's rewarding. In fact, it is very fun to build something and have it work as intended, especially if you don't have the funds to afford the gear.
Arrow antenna makes an inexpensive handheld dual band yagi that's perfect for working sats. I've used it to work stations on SO50 and will use it for the FOX sat booked to launch in October 2015
Consider that only 1 (and soon to be 2) birds are FM, which is the mode common for HTs. The rest are sideband, CW (morse code) or digital modes like PSK, FSK,GFSK, and APRS. The latter modes require a computer and soundcard interface with the radio.
An ideal and a more expensive enterprise would be to setup an array of large 2 meter and 70cm yagis on your roof with a computer controlled azimuth/elevator rotor (Yaesu G5500,) signal pre-amplifier(SSB Electronics,) and  low-loss coax like Heliax or a short run of LMR400. You'd need a great radio with dual receive on 2m and 70cm so you can monitor the downlink while transmitting to ensure you're making it into the bird.
All told, I priced such a satellite station described above between $5,000 and $6,500 USD including the ICOM IC9100 which is one of the best satellite radios money can buy since its all band all mod with a built in tnc.
A bonus would be that you could use a modest satellite station to work the big boys who do Earth-Moon-Earth communications; however, you'll likely need 200 to 400 watts of output power to be heard so prepare to shell out some cash for a VHF amplifier.
Comment: 5 years later, there are at least 5 FM birds in the sky, making this answer less relevant.
Answer: https://www.amsat.org/status/ will show you a list of birds and if there has been any activity reported during the last week.  Reports are crowd-sourced, the page allows you to drill down into each report and see who reported and when.  Even reports of "not heard" are shown.
Comment: Hello and welcome to ham.stackexchange.com!


What is this plant? Is it a lavender, russian sage, or something else?

Question: I had 4 plants near my front door. One of them died and I was trying to replace it. I bought a lavender from Home Depot and it was totally different as you can see (the small one in the middle of my larger ones (around 2 feet high 3 feet wide)). Can you help me identify what my plant is? What type? Where to buy it from? Any other suggestions (alternatives that will be about similar size and looks nice with mine)? Thank you in advance. I live in Phoenix (can get real hot) and this will receive the afternoon sun.
Answer: Looks to be some cultivar of Lavandula multifida, the fernleaf lavender. I could take a punt at a cultivar name and suggest 'Spanish Eyes'  as it is probably the most common cultivar, but to be honest without it sitting in front of me, next to a known specimen of 'Spanish Eyes' I couldn't confirm that.
They are not the hardiest of species, but that shouldn't be too much of an issue in Phoenix, just makes sure that it never gets soggy feet. Like all lavenders, they like good drainage. Good pairings would be similar mediterranean species.
In general, if a plant is growing well, then look to plants that would grow alongside it in the wild for other plants that are likely to be successful. I would suggest Rosmarinus officinalis if you need a bit of height (possibly in the corner). Other culinary herbs - Salvia, Origanum and Thymus might be nice. Phlomis sp. would look good. You could put some grasses in for contrast Stipa gigantea as alternative for the back and perhaps Nassella tenuissima for mid- to foreground planting. You don't want too many similar shrubs sitting next to each other or it's going to get a bit dull.
UPDATE:
@stormy rightly mentioned in a comment that too many different types of plant will look chaotic. The list of plants above was to give a range of options that you may wish to choose one or two from - not all of them!
Given you want a quick fix, you could opt for another more readily available Lavandula. I would pick one that is sufficiently different not to look mismatched. If you pick another blue/pale lilac coloured one it look like you've tried to match it and failed. One with white flowers is probably your safest bet - Lavandula x intermedia 'Alba'. It will get a bit bigger than yours but should fill the gaps nice and quick. This is one of the more common white lavenders (or lavandins in this case) and also one of the tougher varieties - I'd be surprised if you couldn't find plants locally.
Comment: I really appreciate your help. I think the easiest for me is to find the same and plant it. I'm illiterate in gardening and deciding/ finding an alternative is likely to be difficult for me. Do you know where to find that Lavandula multifida 'Spanish Eyes'? When I searched I found seeds but did not find the plant itself. I prefer to buy it and plant it instead of growing seeds. Thank you.
Comment: I'm based in the UK so I can't help with nursery suggestions. In the UK the RHS have a plant finder app that finds UK) suppliers for plants. Perhaps something similar exists in the US. *Lavandula* are relatively easy from seed but if you need an instant fix, perhaps using another species/cultivar would work. See update to answer.
Answer: Artemesia 'Powis Castle'...these grey plants go with anything. I am not sure about the ID at all. Let's ID this guy for sure and I would buy more to make a soft informal edge in this spot. You could add a few Crocosmia, Lucifer or the yellow Crocosmia?  Crocosmia pictures
Comment: Not with flowers like that it isn't. 'Powis Castle' is also noticeably more silver.
Comment: I like your suggestions especially the additions.  The word for too many types of plants is CHAOTIC the opposite of DULL.  Grins.  I'll go check your choices for ID as well.  Oh, and the coloring can change drastically with the environment.  I love these gray plants, senecio all except gag me Dusty Miller.
Comment: You seem to be totally correct with Lavandula multifida!  Whoa!  I agree.  Not ottoclast or spanish lavender...good ID George!


Will changing the theme of a new WordPress website affect SEO?

Question: I created a new WordPress website and while I was updating a theme there will always be some issues in all the themes I used I am not good at coding and all, I just wanted to know that will change the theme of my website will affect the SEO of the site or not?
Comment: If you aren't good at coding, I would recommend rebuilding your site with a page builder theme such as Divi or Elementor. It will make your life way easier. They _do_ cost some money but if you ever run into issues you'll have customer support to help you.
Answer: First of all, the main question: does your website already have organic traffic from search engines? If not, you shouldn't worry about SEO with changing the WordPress theme. If yes, read below.
If you don't know at least a little about SEO, it will be difficult for you to make this move safely. You need to analyze the changes that will occur after moving to a new WordPress theme. Of course, the most important thing is that you do not change the URL and content of the pages. In addition, the important questions are:

Will the structure of the pages change? I mean, the html5 structure of pages (h1-h6, section, article, aside, etc).
Will the pages metadata change? Use metatags.io for checking.
Will the structure data of pages change? Use validator.schema.org for checking.
Is the new design no worse than the old one for users? Analyze convenience of theme.
The new WordPress theme doesn't have big scripts that make the pages load longer? Find out how new the topic is SEO-friendly. You can use web.dev or pagespeed insights for the base checking.

It is better for your site to be checked by a SEO specialist. I might have missed some possible problems. To find out everything, need to look at WordPress themes.
I recommend you think, probably easier to fix the current Wordpress theme and hire a developer.
And don't forget about backups.
Comment: They say it is a new website.   I'm not sure that changes are all that relevant in this case compared to making sure that whatever theme you choose does a good job.
Comment: @StephenOstermiller if his website is absolutely new and doesn't have any organic traffic, he can doesn't think about this changes with Wordpress theme. I will add this to my answer now.
Answer: I think the question is similar to changing website's platform
So if the structural, mark-up, meta, micro data and content remain the same, it doesn't affect SEO.
For WordPress, the theme is one of the most important factors in SEO. You should use a theme that is SEO friendly which has good structural, meta,  and micro data. And don't change the themes if you don't have a good reason, because mostly WordPress theme has different structural especially if the creator is different.
Comment: I wouldn't expect that switching from a theme that implements good SEO practices to another theme that does the same would affect SEO.
Comment: @StephenOstermiller yes I agree, only if you know that theme has good SEO practices, but I found many themes that say they have good SEO but are actually bad or outdated.


How should I prepare a sub-floor for porcelain tile?

Question: I am removing a laminate tile floor. There looks to be 2 layers of 3/4" Plywood as the sub-floor. Do I remove 1 layer of Plywood and install 1/2" concrete board or leave the plywood and install 1/4" concrete board on top of the plywood before installing the porcelain tile floor? My concern is that if I leave the existing sub-floor material I am going to have a ½" rise in the floor from one room to another.
Comment: This isn't easy to answer.  You can probably get rid of one layer and go with cement board but the extra plywood might be needed to provide a solid foundation given joist spacing, load bearing poles in your house and so on.
Answer: wirelath nailed over the plywood(overlapping the lath 2",use paper backed lath to avoid moisture of setting/grout materials)nail or staple(pneumatic,not a hand staple)in a 8"x8" grid.wire acts as a trampoline,the thinset gets into the mesh but won't twist when the plywood deflects.normal thin-set is fine in the application(unless a modified is needed for the tile).
Answer: Although cement backer board is an ideal substrate for tile, you could bond directly to the existing plywood if it is clean, flat and strong (little or no flex); this is acceptable for areas that see only incidental moisture. There are polymer fortified thin-set mortars specifically designed for direct application to sound plywood flooring that does not exceed maximum deflection specs. I have had very good results, proper application is key. Check it out: fortified thin-set mortar –
1/4" cement backer will conform to irregularities in the floor (high/low spots), so if the existing plywood is not smooth and flat I would probably remove the top plywood layer and use 1/2" backer board to give the smoothest flattest surface.
Comment: I would never do this.  Ever.
Comment: @DMoore, what would you never do, install tile yourself? Install it per manufacturers directions directly to plywood? Install it on 1/2" cementitious backer board? Successful tile installation depends on numerous factors and requires proper application techniques. I have personally installed tile directly to clean sound plywood with great success, 15 years later it still looks brand new. As stated, maximum substrate deflection must not be exceeded.
Comment: Install tile on plywood.  You don't know how many homes I have bought with tile on plywood.  I can count the number of said tile that wasn't cracked (grout or tile) on zero fingers.


EE's Native Image Manipulations Stored on S3 with Assets 2?

Question: When storing images to S3 with Assets 2, is it possible to store the images created by ExpressionEngine's native image manipulation functionality to S3 as well, or must they be saved to a local directory?
Answer: The Image Manipulations with EE are directly tied to a File Upload preference - which is a local source item, not an S3 bucket.  I don't think that what you want is currently possible.
But, what I hear you saying is that you wish to use image manipulations and have those modified images uploaded/stored/referenced via S3.  Is that right?
Comment: Correct. We're currently using CE Image, and it's working really well, but, it creates redundant copies of the source and output images on the local server, per this thread: http://expressionengine.stackexchange.com/questions/5648/prevent-purge-local-caching-of-s3-files-with-ce-image
Comment: I'll send your idea for this to our team, Nick.  Thank you!
Comment: We really could use this, too. The problem I'm seeing is that if Assets is set to upload directly to S3, the native image manipulations don't create anything, so there aren't any modified images to upload.
Comment: Agreed, this feature would be a huge value to us since we run 3 app servers with images stored on S3.
Comment: Plus one on this... just discovered that using CE Image's AWS caching thing on an image slideshow of 30 files adds like 2 seconds to the page processing time over just serving the natively-resized-on-upload files from an EE upload directory. Would prefer to serve from S3, so combining on-upload resizing with S3 storage would be fantabulous!


Should the question regarding PHP on Tor be closed because it is off-topic?

Question: The main site has a question with the title "can php be used on Tor". In my opinion this question is not about Tor itself, but more about a misconfiguration of PHP or the webserver. So I would tend to close it as off-topic. What do you think? Is it on-topic here or should it be closed?
Answer: In this case I think it's a fair question, and both the comments and the user's own answer clarify that:

Tor can be used with PHP
Future users should check their config when having trouble using PHP to connect over Tor

If this were actually a question about how to configure VHOST settings on NGINX, then it would be clearly off topic. But it's a pretty straight-forward question about whether Tor can be used with PHP, which it can be.


Painting area of a shape - Illustrator CS5

Question: I'm very new to Illustrator, so please forgive me if this is a daft question.  Trying to colour the chicken's feet black where they overlap the white cow's back.  I've tried making the chicken a compound shape but a message pops up saying it can't do that.  Same happens when I try to make a clipping mask.  I'm certainly missing a vital step here.  Any help, much appreciated.
Answer: In AI there is more than one way to cook an egg... or paint a chicken. I tend not to use live paint groups, so my answer is based on what I use.
I think your layer structure is getting in your way. I would get rid of the extra groupings (live paint, group, etc) if you don't need them. I would keep one of the chicken shapes (you have two as far as I can see in your layers window, the wing and the cow shape. You can delete the layers you don't need directly in the layers window.
After it has been simplified I would select the cow's back and the chicken together and using the pathfinder, select Divide. This will turn the image in 3 pieces: chicken top, chicken feet and "cow back minus chicken feet".  I have separated the 3 pieces in this sketch to show you how it would work. I did not include the wing, for simplicity.
With the shapes cut this way you will be able to select each one of the shapes independently and fill them with whatever colour you want.

One final note, you might find that when you continue working on your art it might be handy to have kept the original shapes intact (chicken with feet and back of the cow without the chicken feet cut out). If you want to do so, then just duplicate the chicken and cow back shapes before using the pathfinder. You can hide them if you don't need them but keep them in case you need to do some masking, overprinting, etc.
Comment: Thank you so much for your time on this.  I'm happy to report, my chicken has black feet!
Comment: Glad to hear your chicken got boots! If you used this technique, then consider accepting the answer. If you use a different one, then you could add an answer explaining how you did it, even if you are answering your own question.


how to determine the volatility of an organic compound using the physical properties of organic molecules

Question: How do you tell if a compound has a high volatility?
Also can the boiling point of a compound be taken into consideration when determining if a compound has a high volatility?
Answer: Vapor pressure is the physical property that expresses a compound's volatility at a given temperature, and the enthalpy of vaporization describes the temperature dependence of the vapor pressure.
For some compounds, like water, there are tables and formulae readily available for determining the vapor pressure at different temperatures. If you know the compound's vapor pressure at a given temperature and you also know the enthalpy of vaporization for the compound, you can then estimate the vapor pressure of the compound at another temperature.  This method assumes that the enthalpy of vaporization of the compound is constant with temperature, which is only a good approximation over a relatively small temperature range. You would need to know the heat capacity of the compound to correct for the temperature dependence of the enthalpy of vaporization.
Comparison of boiling points is often used to say "compound x is more volatile than compound y" because compound x has the lower boiling point. This statement is only true for the pressure at which the boiling point was given, often 1 atmosphere.  The vapor pressure of a polar compound like a low-molecular weight alcohol has a greater temperature dependence (enthalpy of vaporization) than a non-polar compound like an alkane.  So an alkane and an alcohol with the same boiling point at one atmosphere will not have the same boiling point at another pressure. Correspondingly, an alkane and an alcohol with similar vapor pressures at one temperature can have very different vapor pressures (volatilities) at another temperature.
Answer: This answer is in the same spirit that the question is given, which is to just get an idea about volatility of a compound given its chemical formula. I need to make it clear that there are times when you need to quickly compare two chemical structures in your head and decide which one is more volatile. For that, you can use the below criteria, however, for more rigorous and serious calculations, you need to directly evaluate vapor pressure using known experimental data or precise thermodynamic models.
When comparing two molecules:
1- lower molecular weight leads to higher volatility
2- presence of polar groups usually decreases volatility
3- presence of hydrogen bonding sites significantly decreases volatility


Do wizards really have to prepare spells multiple times to cast them multiple times?

Question: According to the Pathfinder Magic overview, a wizard has to prepare a spell multiple times to cast it multiple times, which make 0 sense to me. I've also read other comments saying otherwise. Can someone give me some verification please?
Comment: Related and maybe the heart of what you're really asking: [How does D&D Vancian Magic Make Sense In-Game?](http://rpg.stackexchange.com/questions/12310/how-does-dd-vancian-magic-make-sense-in-game)
Answer: Yes, wizards need to prepare spells multiple times to cast them multiple times.
From the page you have linked:

(If you've prepared multiple copies of a single spell, you can cast each copy once.)

Think of it this way: When a wizard prepares a spell, it's like he's loading a bullet into the chamber of a gun.  The bullet is the spell, and the gun is his mind.  He can load silver bullets, or fire bullets, or steel bullets, or whatever other kinds of bullets he has.  He can fire the bullets in his gun in any order, but he needs to load two silver bullets if he wants to fire two silver bullets later.
It's the same with spells.  You have to prepare a specific spell in a specific slot, and once you cast the spell in a particular slot, that spell can't be cast again unless you have it prepared in a different slot.
In one of the D&D 3.5 books (I think it was the Player's Handbook, but I may be wrong), there was some flavour text explaining how this worked in-world.  Basically, each spell was cast in two parts; a long part and a short part.  The long part was cast while preparing spells.  This part requires more time and concentration, and once completed, you had a partially-finished spell hanging around until you finished casting it.  The short part is what you do to cast the spell mechanically.  For example, the standard action used to cast fireball would be the short part of that spell.  The idea was that a wizard had to cast the longer part of each spell beforehand, and could only have a limited number of partially-cast spells hanging around at a time.  Since casting a spell uses up the prepared part, casting multiple copies of a spell in a day requires preparing the spell multiple times.
If you really don't like this rule, it can be houseruled out pretty easily.  A version that I've had some success with is to have wizards prepare a smaller number of spells than usual, but to allow them to cast those spells spontaneously.  The way I would run it is as follows:

For each spell level other than 0, wizards can prepare a number of
  spells equal to their normal number of spells per day, minus 1,
  minimum 1.  The number of spells that can be prepared does not take
  into account a high intelligence bonus.  For example, a 9th level
  wizard can prepare 1 5th level spell, 1 4th level spell, 2 3rd level
  spells, 3 2nd level spells, and 3 1st level spells.  Wizards can, once
  per day, spend 15 minutes meditating and studying their spellbook to
  change out 1 prepared spell per level.  The number of spells that they
  can cast is unaffected.  Wizards can cast any spell that they have
  prepared any number of times, subject to their spells per day limits.
  This does not count as spontaneous spellcasting for the purposes of
  metamagic feats, or other features that provide benefits to
  spontaneous spellcasters.  If a wizard wants to cast a metamagic
  version of a spell, the spell must be prepared that way.

My experience with this ruleset makes me believe that it's pretty fair.  The wizard loses a bit of it's minute-to-minute versatility, since they can only get up to 3 spells of a particular level at a time, but they keep most of their power, and get the benefit of being able to cast like a spontaneous caster, for the most part.  I'm sure this is terribly abusable in a high-op game, but it's never been a problem for me.
Comment: The bullets-in-gun is the best way I've heard of explaining this.
Comment: @Eric A distinction made on the [accepted answer](http://rpg.stackexchange.com/a/12311/7616) of Adriano Varoli Piazza's linked question (in your question's comments) is memorization vs. preparation. The spells are prepared, not memorized, which implies a number of other actions/preparations beyond memorizing certain things.
Comment: yea i guess so its just tht the way the book explained it was that wizards had to memorize their spells b4 hand which to me translated into "ok i know these spells today" it just felt weird to me how when he memorized a spell then cast it he somehow forgot it. it made more sense to say "ok i have these spells memorized but i can only cast this kind o so many times due to my current power lvl"
Comment: It might be worth mentioning the Arcanist, a sorcerer/wizard hybrid introduced in the Advanced Class Guide. Like the wizard, it prepares spells each day. Unlike the wizard, it can cast any of the spells it has prepared so long as it has spell slots. It's a lot of fun to play, and using it doesn't require house rules, which a few tables frown on. You can find it at http://www.d20pfsrd.com/classes/hybrid-classes/arcanist.
Comment: The Arcanist (which is basically the same as the 5e preparing) basically inverts the role of the gun and bullets in the metaphor: now the spells prepared are the guns, and the bullets are the slots you cast them with.
Answer: Yes. In Pathfinder (and D&D 3.x) spells are prepared in a specific spell slot, and that slot is expended when the spell is cast. Cantrips are the exception to this; you can cast a cantrip as often as you want.
Makes no sense? Yes, that's a big complaint about the D&D magic system that goes back all the way to the 1980s at least. But it's how D&D has historically done things (though 4e, Pathfinder, 5e, spontaneous casters in 3.x, and psionics before that are handling it differently). Some people want this fixed because it makes no sense, others want to keep it because it's D&D and it works.
There are ways to explain this to have it make sense. For example, a prepared spell could be partially cast during preparation so you only need a quick command to finish it and cast it during combat.
Comment: It goes further back than the 1980's. It's based on fantasy books by Jack Vance, who published his first book in 1950.
Comment: @Ernir: well the *complaint* can't go back much further than D&D's publishing date in 1974. I imagine someone complained during playtesting ;-)
Comment: I remember the complaints from the 1980s. I wasn't alive in 1950 to notice any complaints about a future game. That's all I've got. I don't pretend to have the exact date of the first complaint about this issue.
Answer: In the old D&D editions, it's mentioned somewhere you need an enchanted charcoal to cast a FireBall. If you use that component previously made, you cannot cast another fireball because you are out of enchanted charcoals.
Consider that wizards, just like any other being, have a limited amount of magical energy inside them and they can divide that between many different spells but all of them have to be previously prepared so the wizards can cast them. Use your imagination to describe how each spells is prepared but consider that the "resource" is expended after the magic is used. Also consider that once the magic is used, the magical energy is freed and can return to the caster but he will need time to prepare new spells.