VPN DNS configuration bug in OS X

Question: I am using TunnelBlick to connect to an VPN (OpenVPN) with OS X 10.9.2. I can authenticate and pass traffic but the DNS entries injected from the VPN do not work.
Here is the output of scutil --dns (resolver #1 is the correct DNS server injected by Tunnelblick)
resolver #1
  search domain[0] : XXXXX.net
  nameserver[0] : 10.10.0.15
  if_index : 5 (en1)
  flags    : Request A records
  reach    : Reachable

The problem is if_index should be tap0 and not en1. From ifconfig:
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether e4:ce:8f:1b:42:cc
    inet6 fe80::e6ce:8fff:fe1b:42cc%en1 prefixlen 64 scopeid 0x5
    inet 10.0.1.2 netmask 0xffffff00 broadcast 10.0.1.255
    nd6 options=1<PERFORMNUD>
    media: autoselect
    status: active

tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:83:8d:37:dc:b9
    inet 10.10.0.100 netmask 0xffff0000 broadcast 10.10.255.255
    open (pid 4997)

nslookup, dig, and host all can reach the DNS server correctly but the rest of OS X cannot (I understand these have a standalone resolution mechanism that do not rely on the rest of OS X). I have confirmed with Wireshark that the DNS packets sent by nslookup et. al. go out tap0 and DNS packets sent by other programs (eg ping) go out eth0 and of course never get to their destination. Could it be possible that scutil doesn't actually look at the routing table before sending packets?? If so how can I edit the scutil entry to correct the if_index?
Tunnelblick is configuration drop down is set for set nameserver and the relevant portion of my server.conf is shown below. Since I am getting the DNS information correctly I think the problem is with OS X and its scutil setup.
...etc..

server-bridge 10.10.0.15 255.255.0.0 10.10.0.100 10.10.0.200

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
push "dhcp-option DNS 10.10.0.15"
push "dhcp-option DOMAIN wattsworth.net"

...etc...

Comment: Please include your Tunnelblick configuration and the OpenVPN server configuration...  You should have a `push "dhcp-option DNS ..."` statement server-side, and in the Tunnelblick config "set nameserver" for the `'Set DNS/WINS'` drop-down.
Answer: Struggling with the same problem, I found that running scselect command with new-location-name set to the same as currently used did reset the network settings and DNS started working through VPN.
At the same time scutil results remained constant (i.e. it shows the if_index set to the Ethernet interface).
First run scselect with no arguments to learn the GUID of currently used location, then again with the intended location as an argument.

VPN DNS configuration bug in OS X


How to associate contact with last campaign upon Lead conversion via Campaign

Question: I have a question around Lead conversion, which is associated with multiple campaigns.The goal is to associate the converted contact with the latest campaign sent out to the Lead. We are not using Opportunity Object, so, is there any standard way to implement this or I shall go ahead with some customization?
Answer: Salesforce does this out of the box. You might not see it on your page layout, so head over to Setup > Customize > Contacts > Page Layout(s), and add the Campaign Related List to the layout. However, it doesn't just copy the latest campaign, but all campaigns the lead may be associated to, and it will also automatically merge any duplicate entries. See Considerations for Converting Leads.
Comment: Thanks @sfdcfox for responding. Which means in order to get this capability on Lead conversion I have to manage via apex trigger on campaign member?
Comment: @Monika The contact is automatically associated with the campaign. What additional logic are you trying to implement?
Comment: As Initially said - 1 lead could be attached to multiple Campaigns, now at the time of conversion of Lead I would want the latest associated camapign to be part of Converted Lead-Contact.  It is easier if we have opportunity object, but in my case we are not using opportunities, we will be counting the success of contact conversion rate
Comment: @Monika It already is part of the Contact. You don't need an Opportunity to get the Lead conversion data to the Campaign. Have you taken a look at the Campaign Related List on the contacts, and tried converting a Lead?


Probability distribution for opening a combination lock, with respect to time (failure analysis / one-time events)

Question: Premise (the original problem):
"You want to open a combination padlock by trying each of w permutations of the numbers, at x seconds per attempt." What is the probability of opening the lock before time y, given that time z has elapsed?"
My question:
I think the underlying probability, with respect to elapsed time z looks like a distribution "curve" that steps down a little at every ten second attempt (pulling on the lock). It is flat, then jumps down, is flat, then jumps down. My concern is that this may not be the end of the solution. For one-time events such as a machine failure, or in this case a success, we usually have an exponential probability curve that accounts for the "condition" that failure has not already occurred (is increasingly dependent on history). If I am right, this exponential curve is always falling with time, and flattens out. So, for this problem, would an exponential probability distribution need to be combined with the "falling steps", perhaps averaged together somehow? If not, why not, or how else should we handle this?
Comment: Your intuition sounds reasonable. Note that the probability of opening the padlock at the first attempt is 1/w. Given it is not correct, the probability of the next attempt is 1/(w-1), i.e. it is uniform over all possibilities (our assumption!). So if you frame "time" as "number of attempts", you should be able to write down an expression for this probability using Bayes' rule and see what that looks like.
Answer: The problem that you posted is not too complicated, but details are  important and often information is not carefully phrased or omitted. In this case it does for instance matter how one chooses a code to try to open the lock. The most important thing here is whether a code that has been tried before is possibly tried again or not. I.e., every permutation of possible codes is used only once vs. every time a random code is tried. In the former case the code will be found no later than the $w$th time, whereas in the later case it could take longer than that. Hence the answers in these two scenarios would be different.
I'll assume that it will be the former situation, where all possible codes are tried in some order but only once. This means that the correct code is one of the $w$ codes in the list, and since a priori we don't know which it is, each code in the list that we try has a fixed probability $1/w$ to be the correct one. So if we try up to time $y$ and it takes $x$ seconds per attempt, we have made $\lfloor y/x \rfloor$ attempts and hence we find that the probability for the code to be found before time $t=y$ is given by :
$$P_\text{found}(t\leq y) = \frac{1}{w} \left \lfloor \frac{y}{x} \right \rfloor$$
But now the problem gives us more information, i.e., a time $t=z$ has passed. I will presume that this implies that the lock has not been opened, and  hence that during that period $\lfloor z/x \rfloor$ unsuccessful attempts were made. For the time $t>z$ therefore only $w-\lfloor z/x \rfloor$ possible codes remain and hence we know that the probability that an untried code is correct is no longer $1/w$. During the time $z < t \leq y$ we will try $\lfloor y/x \rfloor-\lfloor z/x \rfloor$ new codes, and we find
$$P_\text{found}(z < t \leq y) = \frac{1}{w-\lfloor z/x \rfloor} \left( \left \lfloor \frac{y}{x} \right \rfloor  - \left \lfloor \frac{z}{x} \right \rfloor \right)$$
In view of your question, I used time $t$ as a continuous variable at the cost of introducing the floor function. Optically the problem looks much simpler and easier if we assume that $y,z$ are integer multiples of $x$ only, and set $x=1$ as the unit if time.
The exponential behaviour you refer to, actually does not show up in this problem, but it would if we would have choosen every time a random code to try on the padlock.
Dropping the continuous time and only focussing on the number of codes that are tried, we find that if you choose a code randomly, the probability to find the correct code on the $n$th attempt would be
$$P(\text{found on $n$th}) = \left( 1- \frac{1}{w}\right)^{n-1} \left(\frac{1}{w}\right),$$
that is $n-1$ times a wrong code, followed by the correct one. The probability $1/w$ that a particular attempt is successful does not change in this scenario at all.
The probability not to find the code in $n$ successive attempts would be
$$P(\text{not found in $n$}) =\left(1 - \frac{1}{w}\right)^n$$
and the probability to find it within $n$ attempts
$$P(\text{found in $n$}) =1 - P(\text{not found in $n$})= 1 - \left(1 - \frac{1}{w}\right)^n$$
These probabilities are valid starting at any time, i.e., they do not change when preceded by an arbitrary number of unsuccessful attempts, and are valid for any $n$ and the limit $n \rightarrow \infty$ can be taken if so desired.
The probabilities do not change between attempts, so when using a continuous time the probability functions of time would be discontinuous step functions and in this case of a padlock have no real added value to the problem, they merely make the functional descriptions look more complicated. This would be different in say radioactive decay, which is closely related to the second scenario here.
Your confusion of combining exponential behaviour and step-functions seems to stem from the fact that you mix a discrete time problem of opening a lock, with a continuous time interpretation.
Comment: Thanks for your response, but I don't agree with your last point. (However, I'm not knowledgeable enough about when the exponential distribution applies, to be sure about any of this.) It seems that choosing a permutation with replacement (your second scenario) would also not involve the exponential curve. The basic question would still be asking about the future in whole, not in part. (This distinction is mine, and could be wrong, whether or not the exponential applies, since I'm not sure where and when it does apply. The reasons for the application, are what I'm trying to learn.)
Comment: To follow up, my question now is, if "choosing with replacement" does call for using the exponential curve, is that "memorylessness" all we need to know? In other words, does the "subtle" logic in my OP (looking at the whole future, not sections of it) have any validity. Now, I'm inclined to think my logic was nonsense.
Comment: @Bafs I have added some details, I hope this solves your questions.
Answer: After much consideration, I believe that the falling steps do not need the addition of an exponential function. The reason for this is that the exponential curve applies to future events divided into sections of time (probability is evaluated over section(s) of time). However, in this problem we are looking for the total future probability without regard to any divisions of that time. At time z, we know that the lock is still unopened, and the condition that it hasn't already been opened is not in question. The prior is 100% not open. The time remaining for attempts may have a smaller exponential curve than before, but it is not relevant to the problem. We only need to know the total number of possible attempts before time runs out. The difference is subtle. Either we are asking about the progress of future events, or we are asking about the overall probability for the future. If anyone is sure that I'm wrong, or has more to add, please chime in.


Where can I find the Undertaker gun?

Question: I destroyed a Crimson Heart in the Crimson, and apparently it was supposed to drop the Undertaker, but I think my inventory was full so I didn't pick it up. Am I doomed or is there another way to get the gun?
Answer: Yes it should have dropped the Undertaker if it was the first Crimson Heart that you broke.
No you are not doomed. Firstly it's not that important of a weapon. It's stats are similar to the Flintlock Pistol which you can buy from the Arms Dealer for 5 gold. You should have picked up some ammo when you destroyed the Crimson Heart so keeping that in your inventory will allow the Arms Dealer to spawn given you have met the housing requirements.
If you are keen on the Undertaker, you can keep smashing Crimson Hearts until one get's dropped (each heart after the first has a 20% chance (25% on console) to drop the Undertaker). Just be careful because after you break 3 Crimson Hearts total, the Brain of Cthulhu will spawn. You can also get an Undertaker by opening Crimson Crates (17% chance).
Answer: While you have missed the first, guaranteed drop, it's still possible to get an Undertaker. You can just keep breaking hearts to try to get another one.
Comment: I believe the first heart you destroy always gives you the undertaker, just like the first shadow orb always drops a musket. After that drops are random
Comment: Wups, you are indeed correct!
Answer: The other answers are correct and give detailed explanations about drop rates and how to get another Undertaker gun. However, I'd like to add that if your inventory is full when you destroy the Crimson Heart, the item that drops will fall to the floor. If you went back to base, emptied your inventory, and returned, you could still pick up the dropped item.
This holds true for any item spawned by destroying things in the world, including blocks, ores, decorations, dye materials (such as Yellow Marigolds or Blueberry Bushes), or almost anything else.

Where can I find the Undertaker gun?


Entity Framework Guid

Question: I'm trying to setup the Entity Framework with SQL Server 2008.  I'm using Guids for the keys on my tables.  Is there a way to set it up so the keys are automatically generated by the database?  I tried setting "RowGuid" to true and also set the column's default value to be "(newid())".  Either way the mapped class still needs me to give it a Guid on the C# side.  Any ideas?
Answer: Not yet:

17.4.Can I use a server-generated guid as my entity key?
Unfortunately, in v1 of the EF this is not supported.  While it is possible with SQL Server to have a column of type "uniqueidentifier" and to set it's default value to be "newid()", with SQL Server 2000 there's no good way to extract the value that the server generated at the time you do the insert.  This can be done on more recent versions of SQL Server, though, so the intent is that we should find a clean way to special case this support in future versions of the EF so it can be supported on those databases that allow it and not on others.  For now, the work around is to generate the guid on the client (ideally in the constructor of your object) rather than on the server.
Answer: Personally, I think that anyone who is using EF would be willing to give up compatibility with SQL Server 2000 to get the features they need.  It seems like every halfway non-trivial thing that I need to do in EF is unsupported due to the fact that they have to keep compatibility with SQL Server 2000.
When will it ever end!
Answer: Since a Guid is a structure, a null value is never passed so the defaults don't kick in. You could consider a nullable Guid: Guid?, though this may cause headaches as mentioned in this post:
Nullable GUID
I found it easier to just initialize the Guid with a new value:
private Guid _identifier = Guid.NewGuid();

If it's an existing record, it will be replaced when the object is populated. If not, the initialized value will be inserted.
Comment: using a nullable guid works as long as that column is not set as (or part of) the entity key in which case you will get an error.  I like the initialization suggestion although it seems that this should happen out of the box if it recognizes the Guid/Key combination of the properties of that field.
Answer: Easier with v4.
A better way than having to change the edmx is the bit I have below that will generate Guid's for you.  It checks for primary key and reflects to set it.
Warnings - Assumes a single Guid primary key and that you are not setting it for some reason of your own.
void OgaraEntities_SavingChanges(object sender, EventArgs e)
{
  foreach (ObjectStateEntry entry in
      ((ObjectContext)sender).ObjectStateManager.GetObjectStateEntries(
      EntityState.Added ))
  {
    if (!entry.IsRelationship){
      string keyFieldName = entry.EntitySet.ElementType.KeyMembers[0].Name;
      object entity = entry.Entity;
      PropertyInfo pi = entity.GetType().GetProperty(keyFieldName);
      pi.SetValue(entity, Guid.NewGuid(), null);
    }
  }
}

Answer: Update: Microsoft has fixed this bug for VS2010 SP1 with hotfix KB2561001.
Answer: How about static method in partial class??
public partial class SomeEntity
{
     public static SomeEntity Create()
     {
         return new SomeEntity() { Id = Guid.NewGuid(); }
     }
}

Entity Framework Guid


Words with Friends summary?

Question: In Words With Friends (or any With Friends game), is there anyway I can check the summary of my games - how much did I win/lose? Or compare my standings with another player? It is frustrating when you play quite a number of games and it does not give you a perspective of how well you did.
Answer: I don't believe there is a way to check these stats. These games are supposed to be just for fun, but some people do like to know their stats. You could alternativley sign up for a site such as THIS if you're really serious about your stats.
Comment: They also have facebook 'achievements' that you can reflect upon.  ( but if you play on Facebook, enjoy those ads)
Comment: Thanks for the link. I guess this may be an issue with cross-platform games as they would have to maintain their own leaderboards and stats coz they may not be able to integrate with Game Center.
Answer: On Android, recent games win/lost are displayed in the main program screen. However, I do not know how far back this goes. It may be useful only to see how you're doing recently.

Words with Friends summary?


Embedding chess games from PGN in markdown

Question: How do I embed chess games from PGN files in markdown format?
Comment: Please expand on what you're trying to accomplish or what problem you're encountering.
Answer: Well, on this site, you can use the 'replayer'. Basically, you just paste the PGN as a code block; for more details, see Can we implement a replayer for chess analysis on the site?.
For example, the following code will display the first three moves of the Ruy Lopez opening:

    [FEN ""]
    1. e4 e5 2. Nf3 Nc6 3. Bb5

(it doesn't work right here because of the <pre> block in the post source)
But this isn't really converting the PGN into Markdown, it's just Stack Exchange's rendering engine detecting the PGN and converting it into a JavaScript widget. There is no 'official' way of converting PGN into Markdown, just like there is no official way to convert it into HTML.
Answer: Sometimes when I found interesting articles, I copy it to my notepad2-mod, that allows me some simple syntax highlighting, and that has moved me to adopt the following practices with chess articles with games interspersed.
1) For every pair of moves, supress the dot.
2) To avoid markdown processor interpreting incorrectly the pgn header, place the game between '~~~', before and after the game. This way, the block is treated as a  block.
3) Add the text as you please, following the markdown conventions.
For the time being, it is not possible to assign a chess font to the move section, due to the document model followed by markdown. A document, does not change fonts on every paragraph; instead asign fonts to specific parts of the document, like title, tables and text.


Does "all Israel shall be saved" mean that all Jews, even those who die in their sins, will be saved?

Question: I am confused by the statement that Paul makes in Romans 11:26, where he explains that all Israel shall be saved. My church believes that if you die in your sins, there is no further hope for you. Jewish or not.
Comment: According to whom?  This is [a widely contested passage](http://christianity.stackexchange.com/q/42730/21576).
Comment: Welcome to the site. We are glad you decided to participate. I hope you get the answers you need and hope to see you post again soon.
Comment: Can this question be moved to Hermeneutics? It is difficult to work out what Paul meant. Was he using the Septuagint? With different translations and interpretations, the passages in Psalms and Isaiah can be understood to mean the establishment of the state of Israel and the 'going up' of Jews from the Diaspora. What was the sin of Jacob? To allow an Asherim on Mount Zion?
Answer: All of Romans 9-11 should be read together. Paul was responding to the accusation that God's promises to Israel had failed, and his response is basically: "you misunderstand what God means by 'Israel'; it is only the remnant of Israel's natural descendants that count as 'Israel', so actually, all Israel will be saved and God's promises have not failed".
Answer: I hope these numbers 673 and 674 in the Catechism of the Catholic Church shed some light

The glorious advent of Christ, the hope of Israel
673 Since the Ascension Christ's coming in glory has been imminent,[cf. Rev 22:20]. even though "it is not for you to know
  times or seasons which the Father has fixed by his own
  authority."[cf. (Acts 1:7; Cf. Mk 13:32.)]. This eschatological
  coming could be accomplished at any moment, even if both it and the
  final trial that will precede it are "delayed".[cf. Mt 24:44; 1
  Thess 5:2; 2 Thess 2:3-12].
674 The glorious Messiah's coming is suspended at every moment of history until his recognition by "all Israel", for "a hardening has
  come upon part of Israel" in their "unbelief" toward Jesus.[cf.
  (Rom 11:20-26; cf. Mt 23:39.)]. St. Peter says to the Jews of
  Jerusalem after Pentecost: "Repent therefore, and turn again, that
  your sins may be blotted out, that times of refreshing may come from
  the presence of the Lord, and that he may send the Christ appointed
  for you, Jesus, whom heaven must receive until the time for
  establishing all that God spoke by the mouth of his holy prophets from
  of old."[cf.Acts 3:19-21.]. St. Paul echoes him: "For if their
  rejection means the reconciliation of the world, what will their
  acceptance mean but life from the dead?"[cf.Rom 11:15.]. The "full
  inclusion" of the Jews in the Messiah's salvation, in the wake of
  "the full number of the Gentiles",[cf. (Rom 11:12, 25; cf. Lk 21:24.)]. will enable the People of God to achieve "the measure of
  the stature of the fullness of Christ", in which "God may be all in
  all"[cf. (Eph 4:13; 1 Cor 15:28.)].

The understanding here is "full inclusion of/full number of" vs. "all [of]".

Suppose the LORD has invited g number of gentiles and j number of Jews before he comes. Some reject his call. g reaches fullness first then j - recalling he went to call g after most of the first j called rejected him. The LORD comes when the number g + j is reached.

"My church believes that if you die in your [mortal] sins, there is no further hope for you. Jewish or not." - This is the Catholic Teaching as well.
Comment: @Lew-Wilson I welcome you to the site with an answer. *E Komo Mai!*
Comment: Nice! But I'm not totally clear on what you mean by "full inclusion of" versus "all of"?
Comment: @MattGutting This is my understanding understood from *"**the full number** of the Gentiles"*. Say God has determined g number of gentiles to come into the Church and j number of Jews before the LORD comes. The invitation goes out some reject it. The LORD suspends his coming until the fullness of those numbers g + j is reached.
Comment: wonderful answer, very well organized and indesputable, easily grasped yet very deep and mysterious.
Comment: @eliyah Thank you! The ways of the LORD ... I remember you asking a wonderful question sometime back and both of us answering. May God bless His Work at your hands.
Answer: This is a nondenominational view as it is taken from the Bible mainly, but enhanced by the commentary of David Guzik.
In this passage Paul is referring to the book of Isaiah:

Isaiah 4:2 through 4  In that day shall the branch of the LORD be beautiful and glorious, and the fruit of the earth shall be excellent and comely for them that are escaped of Israel.  And it shall come to pass, that he that is left in Zion, and he that remaineth in Jerusalem, shall be called holy, even every one that is written among the living in Jerusalem: When the Lord shall have washed away the filth of the daughters of Zion, and shall have purged the blood of Jerusalem from the midst thereof by the spirit of judgment, and by the spirit of burning.

And he was connecting this to Jesus, The following is an excerpt from The commentary of the whole Bible by David Guzik:
God's plan for Israel includes their eventual restoration.
(verses 25-27) The promise that all Israel will be saved.
For I do not desire, brethren, that you should be ignorant of this mystery, lest you should be wise in your own opinion, that blindness in part has happened to Israel until the fullness of the Gentiles has come in. And so all Israel will be saved, as it is written: "The Deliverer will come out of Zion, and He will turn away ungodliness from Jacob; for this is My covenant with them, when I take away their sins."

a. Paul's warning to us that we should not be wise in your own opinion should remind us to take what he says here soberly. Christians must not be ignorant of this mystery.
b. Blindness in part has happened to Israel: Paul summarizes his point from Rom. 11:11-24 is summarized. God's purpose in allowing hardening in part to come upon Israel is so that the fullness of the Gentiles can come in.

i. In part has the idea of "temporary"; Israel's hardness is temporary. "One day the Jews will realize their blindness and folly. They'll accept Jesus Christ, and the glorious national restoration of these people will bring in the Kingdom Age." (Smith)

c. However, when that fullness of the Gentiles has come in, God will once again turn the attention of His plan of the ages specifically on Israel again, so that all Israel will be saved. God's plan of the ages does not set its attention on everyone equally through all ages.
d. All Israel will be saved: This all Israel is not spiritual Israel. It isn't "spiritual Israel" in Rom. 11:25, because that Israel is spiritually blind. Therefore, we shouldn't regard it as spiritual Israel in Rom. 11:26.

i. There is a distinction between national or ethnic Israel and spiritual Israel. Paul makes this clear in Gal. 3:7 and other passages. Nevertheless, God still has a purpose and a plan for ethnic Israel, and will bring salvation to them.
ii. Another proof that this is not spiritual Israel is because Paul says this is a mystery - and it is no mystery that spiritual Israel will be saved.
iii. Harrison on all Israel: "It was the view of Calvin, for example, that the entire company of the redeemed, both Jew and Gentile, is intended. But Israel has not been used of Gentiles in these chapters, and it is doubtful that such is the case in any of Paul's writings."
iv. "It is impossible to entertain an exegesis which understands Israel here in a different sense from Israel in verse 25." (Bruce)

e. Will be saved: This states clearly for us that God is not finished with Israel as a nation or a distinct ethnic group. Though God has turned the focus of His saving mercies away from Israel on to the Gentiles, He will turn it back again.

i. This simple passage refutes those who insist that God is forever done with Israel as Israel, and that the Church is the New Israel and inherits every promise ever made to national and ethnic Israel of the Old Testament.
ii. We are reminded of the enduring character of the promises made to national and ethnic Israel (Gen. 13:15 and 17:7-8). God is not "finished" with Israel, and Israel is not "spiritualized" as the church.
iii. While we do see and rejoice in a continuity of God's work throughout all His people through all generations, we still see a distinction between Israel and the Church - a distinction that Paul is sensitive to here.

f. All Israel will be saved: This does not mean there will be a time when every last person of Jewish descent will be saved. Instead, this is a time when Israel as a whole will be a saved people, and when the nation as a whole (especially its leadership) embraces Jesus Christ as Messiah.

i. Even as the apostasy of Israel did not extend to every last Jew, so the salvation of Israel will not extend to every last Jew; Paul is speak of the "mass" of Jews when he says all Israel. "All Israel is a recurring expression in Jewish literature, where it need not mean 'every Jew without a single exception', but 'Israel as a whole.' " (Bruce)
ii. And, when all Israel will be saved, they will be saved through embracing Jesus Christ as Messiah - as unlikely as this seems. They are not saved with some peculiar "Jewish" salvation.
iii. The Bible indicates this is a necessary condition for the return of Jesus Christ (Mat. 23:39, Zec. 12:10-11). Jesus will not return again until God turns the focus of His saving mercies on Israel again, and Israel responds to God through Jesus Christ.

g. The Deliverer will come out of Zion: The quotations from Isaiah show that God still has a redeeming work to accomplish with Israel, and that it will not be left undone.

Paul is asserting that one day Israel as a nation will accept that Jesus was the promised messiah, and will become a Christian Nation. We do not know when this will happen, but some other writings by Paul seem to indicate that this will be very close to the  second coming, and may even be during the first part of the tribulation, when the Temple is rebuilt.
Whatever the circumstance it is clear that when this happens the millennial reign of Christ is close at hand.
Hope this helps.


Barcode printing software with ODBC or database capability?

Question: Looking for free (doesn't have to be open source) software that can print barcodes pulling in data from a database (ODBC, JDBC, etc). Keyed input would be preferable where you enter in an item number and the details of that record is pulled from the database and a label is printed with the various bits printed on the label.
Answer: I would suggest installing python, then adding pyBarcode with pip install pyBarcode

Python comes with a wide range of database interface libraries, either in the standard library or as free plug in components, including ODBC
You can currently pick barcode formats from:

code39
code128
ean
ean13
ean8
gs1
gtin
isbn
isbn10
isbn13
issn
jan
pzn
upc
upca

Output of the pyBarcode is a .pgn image
I would suggest generating a page with the bar code and any surrounding text into a file format that your OS/Installed Software understands how to print, rather than worrying about specific printers), Candidates that can be easily created from python include:

HTML (if you have a Web Browser)
PDF (if you have Adobe PDF Viewer)
DOCX (if you have Word)
ODF (if you have LibreOffice)

It is all free, Open Source & cross platform
You could extend it to allow multiple IDs to be specified and the results to be laid out in the output document so as to save paper.
Comment: Was looking for a GUI since the product will be used for non-technical people. I appreciate your effort though.
Comment: You have a choice of ways of adding a gui - ipython notebook, wxpython, tk or qt.


Microsoft Word 2010 page numbering/header and footer

Question: In Microsoft Word 2010, I am trying to number a multi-page document which has different annexes and page numbers. Is there a way I can treat each page individually, and number each page differently without it affecting the numbering of the other pages? I've been trying to figure this out, but nothing so far.
Answer: According to Microsoft, you can acheive this by following these instructions:

You can use different numbering formats in different parts of your
  document.
For example, maybe you want i, ii, iii numbering for the table of
  contents and introduction, and you want 1, 2, 3 numbering for the rest
  of the document, and then no page numbers for the index.
IMPORTANT:  To use different numbering in different sections of your
  document, you need to make sure that the sections are not linked.
Click at the beginning of the page where you want to start, stop, or
  change the header, footer, or page numbering.
On the Page Layout tab, in the Page Setup group, click Breaks.
page setup group
Under Section Breaks, click Next Page.
On the page that follows the section break, double-click in the header
  area or the footer area (near the top of the page or near the bottom
  of the page).
This opens the Design tab under Header & Footer Tools.
On the Design tab, in the Navigation group, click Link to Previous to
  turn it off.
IMPORTANT:  If your page number is in the header, be sure that you
  turn off linking for headers. If your page number is in the footer, be
  sure that you turn off linking for footers. Headers and footers are
  linked or unlinked separately.
Follow the instructions for adding page numbers or for adding a header
  and footer with a page number.
NOTE:  Choose an alert and enter text here. You may also set it's
  AlertPosition property.
To choose a numbering format or the starting number, click Page Number
  in the Header & Footer group, click Format Page Numbers, click the
  format that you want and the Start at number that you want to use, and
  then click OK.
To return to the body of your document, click Close Header and Footer
  on the Design tab (under Header & Footer Tools).
Answer: Word really does not know what a Page is.
It really paginates as a part of the process of printing and in relation to the print driver being used by the user. You could put a page break between each page and type the number on it. This is a huge mess for editing. You might as well be using a typewriter!
You can change the numbering format and starting number in different Word sections. Here is my writing on Page Numbers in Word.
I think the following would help you meet your goals:

Word Doesn't Know What a Page Is by Daiya Mitchell, Word MVP
Using the StyleRef Field (my page)
Numbering Front Matter by Suzanne Barnhill, Word MVP


Transparent GIF is forming grainy, transparent static and I don't know how to fix it.(GIMP)

Question:
So, I'm trying to make this gif for a meme but no matter what I do I guess this swiss cheese looking error and I can't even figure out what the term is to google!
Answer: I suspect that you didn't unoptimize the GIF before working on it. In an "optimized" GIF, the frames are transparent were they don't differ from the previous frame, and the successive frames are overlaid above each other ((combine) mode).
Of course this doesn't work when you want a transparent background, because the transparency won't cover parts of the previous frame, so you have to go back to (replace). But the right technique to do this is to use Filters>Animation>Unoptimize which will produce the correct fully opaque frames by merging in the successive frames.


UFW not blocking traffic to microk8s cluster

Question:
I successfully deployed k8s pod with service of type NodePort in microk8s cluster. Now when I enable ufw and try to deny incoming traffic to the exposed port 31001 using command ```ufw deny 31001``` , ufw still allows traffic to port 31001.   What should I do in ufw to allow and deny traffic to port 31001 ?  Please help.
Answer: I believe you're "fighting" against the internal Docker network used for the microk8s instancees.  I've come across different options, from setting up after rules for ufw to disabling the docker ip tables configuration.  The nicest setup in my opinion seems to be this: https://github.com/chaifeng/ufw-docker#how-to-do
Edit: it can also be inherent to NodePort, see per comment on SO: https://stackoverflow.com/questions/62772319/ufw-not-blocking-traffic-to-microk8s-cluster#comment112367622_62772319


error when building openCV for android in windows

Question: I have a problem when building openCV for android. I follow this steps:
http://opencv.willowgarage.com/wiki/Android2.3.0
for build openCV in windows from command line.
when enter this commands:
cd opencv\android\
scripts\cmake_android.cmd
in 94% show this errors:

[ 94%] Generating bin/opencv_test_java.apk
 [echo] Gathering info for opencv_test_java...

Target '-setup' failed with message '../../../ resolve to a path with
  no project .properties file for project
  C:\opencv\android\build\modules\java\android_test'.
Cannot execute '-build-setup' - '-setup' failed or was not executed.
       [echo] hasCode = false. Skipping aidl/renderscript/R.java Cannot execute '-compile' - '-build-setup' failed or was not executed. Cannot
  execute '-dex' - '-compile' failed or was not executed. Target
  '-package-resources' failed with message 'The following error occurred
  wh ile executing this line:
  D:\necessitas\android-sdk\tools\ant\build.xml:808: null returned: 1'.
  Cannot execute '-package' - '-dex' failed or was not executed. Cannot
  execute '-do-debug' - '-package' failed or was not executed. Cannot
  execute 'debug' - '-do-debug' failed or was not executed.
BUILD FAILED D:\necessitas\android-sdk\tools\ant\build.xml:440:
  ../../../ resolve to a path w ith no project.properties file for
  project C:\opencv\android\build\modules\java\ android_test
Total time: 1 second make[2]: *
  [modules/java/android_test/bin/opencv_test_java-debug.apk] Error 1
  make[1]: *
  [modules/java/CMakeFiles/opencv_test_java_android_project.dir/all]
  Error 2 make: * [all] Error 2
make failed
c:\opencv\android\scripts>

I'm update my android-sdk but also show this error. please help me!
thanks
sorry for my English.
Answer: for this problem I download new android-sdk and don't update that. only set my path in windows:
ANDROID_SDK= "my sdk path"

and then run command "cmake_android.cmd"


How do I test PHP files in WordPress?

Question: I've downloaded a Wordpress theme, but I want to edit it before uploading it to my live server. I read I need to run a server in order to test the PHP files, but I don't know what to use in order to do so. Or would it just be better to upload then edit it?
Answer: The WordPress Codex documentation on Installing WordPress and Editing Files give you pretty much all information you need.
You will need a web server to test the code and changes. So you can either do this on your web server (assuming you have some sort of hosting package, because you mention 'upload'), or on your local machine. For easy setup, there is XAMPP or WampServer on Windows, or MAMP for Macs and LAMP for Linux based machines (and many, many more).
Basically, there is no right or wrong way to do this, as long as it works for you. Some people will never edit a single file on a live website, simply because they fear things will break on the live website version. That's why they always test changes on a local web server (using one of the previously mentioned packages). But if you're only making small changes in CSS for example and just starting out, there is no harm in experimenting a bit in the live install. :)
Good rule of thumb: Make backups before you do anything, so if you run into any trouble, you always have a backup of the original files to restore.
Comment: Things to add, On Linux there is LAMP. Also for clarification, you may want to set up a second WordPress install next to your live site for testing (on your current web sever). If you need help installing a server the people at http://serverfault.com/ are pretty awesome.
Comment: I would add that I have long considered the built in file editor to be very dangerous. Editing files on a live site using the built in editor is like working on an airplane while it is in flight. Don't do it.
Comment: In my opinion the easiest way to setup and manage local servers on Mac or Windows is [ServerPress](http://ServerPress.com).

How do I test PHP files in WordPress?


Simple texture blurred in Cycles render but not in Eevee

Question: When I render my scene in Eevee, all works well. But in Cycles, my textures are blurred and some details disappear, even with 1500 samples and no denoising. Can you help me please ?
Thanks :) !
Comment: Hello and welcome :). @Martynas is right, please add more details, perhaps your material setup and consider sharing your .blend file. Without that, it's just guessing :).
Comment: @MartynasŽiemys We don't want to scare new users away. If they haven't given enough information, suggest what they could add to improve it :)
Answer: After several tests, I found the problem.
My file is a Sketchup import and the floor geometry is a bit special. As you can see the mesh has a thickness and a diagonal edge, and this one was like inside the mesh. By moving it up outside (I did it much more to illustrate on the picture), the mesh becomes more valid and the texture is correctly applied.


Create fields dynamically in custom form

Question: I am building a custom module for Drupal 7. It contains a huge form. I created a jQuery code which modifies the form and adds some new selects, text fields and checkboxes.
When I submit the form I am not able to read data from fields which were added by jQuery.
I downloaded Examples for Developers (http://drupal.org/project/examples). There is one example called Add-more button (ajax_example). It seems that is submits all data, increases a counter, rebuilds whole form with new fields and then rendered form is sent back. Is there any possibility to avoid sending whole form server to client? It is not the fastest solution.
I would like to modify my form using jQuery, submit it, rebuild it and validate it. Each change would not require sending data to server.
Thank you, Martin.
Answer: I submit the form I am not able to read data from fields which were added by jQuery
Make sure that you add a name field to your inputs and select elements.
The $_POST['here_is_the_name_which_you_give_to_your_elements'] reads the value of inputed form fields server side.
I decipher that the form will have multiple inputs and selects which are created dynamically.
To manage that:
Add [] after the value of the name field.
For Eg:
 <input type='text' value='' name='my_custom_input[]' id='this_is_not_reqiured_1'>
 <input type='text' value='' name='my_custom_input[]' id='this_is_not_reqiured_2'>

You can get the value of all the <input> with name = my_custom_input on the server side in an Array via POST or GET.
Note: ID is not needed but you can use and maintain a counter if you need those DOM elements Manipulated.
Comment: Thank you for answer. It is not so simple in Drupal.


When I put my shot into Premier, the top half of the shot is cut off. How can I scroll up so I can see the top of the shot?

Question: My phone is I believe an Android A8. I filmed with the phone upright, in I guess portrait mode.
Answer: You want to use the Effect Controls panel:
https://helpx.adobe.com/au/premiere-pro/using/viewing-adjusting-effects-keyframes.html
As the help says, there are several standard effects added to a clip in the timeline, the effect you want to look for is Motion. Select the clip in the timeline, go to the Effect Controls panel, and expand the Motion effect. Inside you'll see Position and Scale, Position has two numbers, horizontal then vertical - if you adjust the vertical, you can scroll it up to see the top of the image. You could also scale the image to fill the frame (zoom in), or scale it so that you can see the whole phone image instead (zoom out).
Just play around with the various options in the Motion panel to get a better idea of what you can do to manipulate your image, it's fairly intuitive.


Column Person/group is empty SharePoint Designer 2013

Question: In a Workflow (created with SPD) i want to test if the column Person/group is empty but SPD only proposes: "is equal" or is different" So how can i translate "Is empty" in a condition. Is there a value like in an approval workflow (16=approved) and (2=pending)
Answer: You can check the people field empty by getting the UserId or LoginName or Email. If these values are empty then people field is empty.
Get UserId Value

Check people field is empty
Comment: If it answers your question mark as an answer it helps others to refer.
Comment: This results in a suspended workflow for me ...


Choose variables for correlation matrix

Question: I've started to use R lately, and I want to get a correlation matrix for a certain set of variables. My dataset consists of over 150 variables, but I'm only using a few of them. How can I choose which ones to produce? Thanks in advance!
Answer: This computes the correlation of the 2nd, 3rd and 4th variables of the builtin data frame anscombe:
cor(anscombe[2:4])
##      x2   x3   x4
## x2  1.0  1.0 -0.5
## x3  1.0  1.0 -0.5
## x4 -0.5 -0.5  1.0

So does this (assuming they have the indicated names):
cor(anscombe[c("x2", "x3", "x4")])

Answer: I like using the dplyr package. For instance, if your dataset is called dataset, do:
library(dplyr)

Then lets pretend your dataset is:
dataset <- data.frame(x = c(1, 2, 3),
                      y = c(4, 5, 6),
                      z = c(100, 50, 20))

Then:
dataset %>%
  as.data.frame() %>%
  select(x, z) %>%                   # select the variables
  as.matrix() %>%
  cor()                              # the correlation matrix

#            x          z
# x  1.0000000 -0.9897433
# z -0.9897433  1.0000000

This method is full proof. We don't know if your dataset is currently a dataframe or a matrix, which will effect which code you use. This code takes that into account.

Choose variables for correlation matrix


What is Summa cum Laude and how do you get it? (USA)

Question: What is Summa cum Laude and how do you get it (USA)? Is this equivalent to First Class Honors in Australia? What is the equivalent of an Australian University medal in the USA?
Comment: Disagree with the close votes, Latin honors also apply to graduate degrees.
Comment: Disagree with the close vote.  Honors are part of university administration/curriculum design and are therefore firmly on topic.
Comment: https://en.wikipedia.org/wiki/Latin_honors
Comment: @CapeCode I agree.  In addition an Australian honours is a graduate degree, and may be obtained by research.
Comment: The institute I'll be attending requires a 3.85 GPA  (less than a handful in this school have gotten a 4.0, so you can imagine how little people get this distinction) for this distinction. YMMV.
Answer: Each university can define summa cum laude and magna cum laude as it choses.  Honours/honors/medals cannot be considered directly comparable between American and Australian universities.  Keep in mind that American universities do not have to adhere to national regulations or standards.  They are much more variable than Australian universities and also far more numerous.
Answer: The typical Latin honors are "cum laude" ("with honor"), "magna cum laude" ("with great honor"), and "summa cum laude" ("with highest honor"). These are essentially a coarse form of ranking within the graduate class, telling you something about GPA or relative rank.
They are widely but not universally used in the USA, depending on the philosophy of the individual institution: for example, MIT does not use Latin honors or provide any sort of ranking information on its students because it wishes them to be judged individually. As with many other aspects of formal academic organization the US, however, there is no central authority or shared definition, and organizations vary rather wildly in how they actually determine Latin honors, if they even use them.  Thus, the only way to know precisely what it really means is to look it up for the individual institution---and even then, they might shift their policies over time.
Bottom line: a Latin honor on a degree means that a student went to an institution that uses Latin honors and they ranked roughly "good", "better", or "best" in their performance there.
Answer: There might not be an exact comparison between the Latin honours system in US universities and the letter-grade honours system in Australian universities, but there are effectively three classes of each, so this indicates that there might be a rough correspondence.  In most Australian universities, the classes of honours are:

1st Class Honours (a High-Distinction average);
Upper 2nd Class Honours (a Distinction average);
Lower 2nd Class Honours (a Credit average);
3rd Class Honours (a Pass average). *

Unless some more reliable information arises (e.g., some data on GPA conversions, etc.), I would suggest the following rough correspondence:

1st Class Honours       = summa cum laude
Upper 2nd Class Honours = magna cum laude
Lower 2nd Class Honours = cum laude

* The case of 3rd Class Honours generally only occurs if a student is selected into an honours year, but then receives only a Pass average in that year.  This is usually considered to be similar to not getting honours.


Do we allow questions like Russian-to-Whatever and Whatever-to-Russian?

Question: English is clearly a favorable language that most people on this QnA are willing to do back and forth. What else should we allow? What languages are disallowed? It is a good question to be copied over to FAQ once it is resolved.
Comment: Whoever down-voted this should explain themselves. I think it is a legitimate question for those who are not familiar with conventions of SE language sites.
Comment: Don't take it so way. Downvotes on meta doesn't mean that the proposal question is unlegitimate. They means that someone disagree with the proposal.
Comment: @lechlukasz: Votes on meta questions should avoid ambiguity by only applying to whether the question is a good one. Agreement and disagreement should be expressed in comments, answers, and voting answers up and down... But yes Askers should also be aware that some people won't consider this distinction and just accept the fact that votes on meta questions are intrinsically ambiguous.
Answer: No, because this would make this site the any-language site. Russian-to-English and opposite are allowed because this is site about Russian in English (for English-speaking people). For multi-language there is Languages proposal.
If you'd like to ask questions abount German-to-Russian etc., propose site Russian language and usage in German etc.
Comment: Where exactly does the "in English" bit come from? I see nothing to that effect in either the proposal or the meta.
Comment: It comes from the fact that StackOverflow, Stack Exchange and Area51 are English-speaking sites. There were a lot of discissions on meta.stackoverflow.com about language policy
Comment: @lechlukasz, "there were" is not a reference. Particular links would be nice.


MySQL Workbench connect to MS Access

Question: I have a .mdb file on my computer that I would like to convert into a MySQL Schema and I have found that there is a migration tool within Workbench. However it doesn't seem to allow you to connect to a .mdb instead it looks for a server. How should I either link to my file or host my file easily as I have not done this before.
Answer: You can use MySQL Workbench to connect and migrate your schema/data from MS Access to mySQL.
First you need to configure an ODBC Data Source:

Click Start, and then click Control Panel.
In the Control Panel, double-click Administrative Tools.
In the Administrative Tools dialog box, double-click Data Sources (ODBC). The ODBC Data Source Administrator dialog box appears.
Click User DSN, System DSN, or File DSN, depending on the type of data source you want to add. Click Add.
Select the driver that you want to use, and then click Finish or Next.
Follow the instructions and enter the required connection information in any dialog boxes that follow.

Back on MySQL Workbench: Use the menu Database > Migrate and select the ODBC data source you've created to use as source for your job.
Answer: As a supplement the response @marcelo-rodrigo, you can use Workbench or another tool but you will need to export table relations too (Workbench and other tools doesn't exports relations)
I write a code to extract all table relations from MS-Access database as SQL and run it on MySQL after export. Link to Code at Github Gist.
See: Converting MS Access to MySQL with relationships

MySQL Workbench connect to MS Access


Look ahead bias predicting a time series using features

Question: I am making some ML methods (RF, RNN, MLP) to predict a time series value 'y' based on features 'X' and not the time series 'y' itself. My question is regarding the bias I might be including since I am doing a simple random train-test-split for the fit and evaluation process, so I am using data from different days (past and future) and not spliting by time. Is it valid for this prediction process, or even that I am not using the time series to predict future values, I am still introducing bias since I am using features which also are time series themselves since I go them daily. I tried both ways and got far better results using the simple random train-test-split, so I got suspicious.
Answer: The answer depends on whether there is autocorrelation in the y target variable which is not accounted for in your X regressors. In other words: if you know all the X values and you are trying to predict the current time step y value, would it help you at all to know the previous time steps' y values? If so, there is autocorrelation in y that is not reducible to your X features, and your simple random train-test-split is not advisable.
A simple example: suppose X is just temperature, and y is depth of snow on the ground each morning in, say, some particular spot in northern Canada. Even though X is a pretty good predictor of y, the relevant autocorrelation still holds, in the sense that even if I know X, my prediction of today's y value will be much, much better if I also know yesterday's y value.
Of course, in real world situations, we usually never really know for sure whether there is the kind of autocorrelation described above. If you suspect it might be there, then play it safe and use a train/test or cross validation method that respects the time domain by training only on data prior to the test split(s).
Comment: I believe my data clearly has autocorrelation, in that case using random train-test-split would add a bias that might help me get better results on the test set but would lack of real power for future values right ? I made models using both methods of splits and  random ones made the metrics extremely good while time base split dropped significantly. I guess thats an insight also for guessing time base split is the correct way to go
Comment: Yes, that would explain why you get better results on the simple-random test set than on future values.


Synchronizing changes in gradle project and IntelliJ IDEA project runs very slowly

Question: I have a gradle project and I use Intellij idea's IDE(version 14). I use my local gradle distribution(version 2.2). When I press the button to refresh all gradle projects, building takes too long but it finishes successfully every time I run it. My repository is on the company's local server. Is it normal?
Comment: it's slow as hell. ever find a solution?
Comment: @NicholasDiPiazza I don't really remember but some kind of reseting helped me! Restarting Intellij idea or removing gradle cache or something like that! I'm sorry!
Answer: In multi-build gradle where you have many sub modules, I just had this problem and I fixed it by doing this:
First click "Gradle refresh" and watch very closely at each project as it says "Resolving dependencies for (project name) (configuration)". If any of those are taking more than 200ms to complete, then check those projects for a unnecessarily large classpath dependency tree... because it is probably massive when you didn't mean it to be.
This in my case was because every project shared a :shared project and that project had people dumping every dependency you could ever think of as a compile time dependency. So some sub-project that did some minor thing had dependencies from all the other projects basically. It was taking over 1 second to refresh the dependencies for each sub project which really totaled up.
The solution was to switch to transitive = false on that shared project and manually add the dependencies that each project actually needs.
If you have fixed it, you'll no longer see 1-2 second delay when "Resolving dependencies" comes up. They should shoot through very quickly.


Transistors - relation between impedance and gain

Question: In an n-p-n transistor connected in common emitter configuration, I have drawn a graph of the input and output characteristics. Using these two graphs, it is easy to find the input and output impedance - using the slope.
However, I do not know how to relate this to the voltage and current gain. Is there a formula to do so?
Answer: In most cases, the ouput resistance of the BJT (rather large) is neglected in parallel to the external collector resistor, which mainly determines the voltage gain. More than that, this gain is also determined by the transconductance gm, which is the slope of the transfer characteristic Ic=f(Vbe). Hence, the characteristics mentioned by you do not help finding the voltage gain of the stage.


After playing Assassin's Creed 4, how do I know I've gotten all the chests?

Question: Looks like I got all the chests in the game. How can I make sure? I got all the Animus Fragments already. I also got the Templar Armor and Mayan Armor.
Answer: It will show up in your progress tracker (available in the Options menu) under either side activities or as a check within the specific locations.
There are 'social chests' which appear randomly, and there seems to be an indefinite number of these, however these don't count towards your completion percentage. (Other than sharing some in the Abstergo challenges).


How can I password protect local group policy?

Question: How can I protect local group policy? I want to put a password on gpedit.msc in Windows, how can I do this?
Answer: You don't.
What you do is using a policy, you simply disable certain groups from editing the policy and then put the users in that group.
Putting a password on this file is just a false sense of security as you are just disabling them from running this - but, whilst this is the main way of editing the policy, there are many other ways (and, they can always copy it from another computer or similar).
Comment: +1 for the concept, but i'd like to see screenshows of how to set ACLs on the security policy (i certainly can't find it)
Comment: @IanBoyd - Its there keep looking
Comment: @Ramhound Right-clicking on **Local Computer Policy**, and clicking **Properties**, has no **Security Tab**. i know it can't be inside the **Local Computer Policy**, **Computer Configuration**, or **User Configuration**, because then you wouldn't be able to set ACLs on the Local Computer Policy. There may be other tools in Windows to edit the security of the Local Computer Policy, but i don't know where they are. And since i'm not the person who asked the question i don't care enough to ask a new SU question. Maybe William could provide the answer.
Comment: @IanBoyd the fact that you can apply it locally isn't really there for this purpose... Home computers are designed for Guests, Users and Administrators - guests can barely do anything, users slightly more and administrators - anything. Policies are designed for large companies where an administrator would select to disable it, then, apply that to their users. As for where it is, I honestly can't remember... it is a local policy that you assign by groups... I will try to find it now.
Answer: Well the thing is you don't keep the password for Group policy. But you can work around it. If you are the admin of the computer and don't want other user to change the setting than just log in on that user account and Run the following code on Command prompt.
REG add "HKCU\Software\Policies\Microsoft\MMC\{8FC0B734-A0E1-11D1-A7D3-0000F87571E3}" /v Restrict_Run /t REG_DWORD /d 1 /f

The catch is you should be able to log in to another account once to run this code. once you have run this code login to your admin account and open group policy:
User Configuration>Administrator templates>System.
Search for something like:
Access to programs for working to prevent the registry.(I had to translate, my computer is in german language)
Double click on it and click on activate and ok. This is make sure that user will not be able to run registry to change the settings.


Should I avoid recursion on the iPhone?

Question: Should I avoid recursion with code that runs on the iPhone?
Or put another way, does anyone know the max stack size on the iphone?
Comment: (insert silly joke here about a phone calling itself)
Answer: Yes, avoiding recursion is a good thing on all embedded platforms.
Not only does it lowers or even removes the chance of a stack-overflow, it often gives you faster code as well.
You can always rewrite a recursive algorithm to be iterative. That's not always practical though (think quicksort). A way to get around this is to rewrite the algorithms in a way that the recursion depth is limited.
The introsort is a perfect example how it's done in practice. It limits the recursion depth of a quicksort to log2 (number-of-elements). So on a 32 bit machine you will never recurse deeper than 32.
http://en.wikipedia.org/wiki/Introsort
I've written quite a bit of software for embedded platforms in the past (car entertainment systems, phones, game-consoles and the like) and I always made sure that I put a upper limit on the recursion depth or avoided recursion at the first place.
As a result none of my programs ever died with a stack-overflow and most programs are happy with 32kb of stack. This pays off big time once you need multiple threads as each thread gets it's own stack.. You can save megabytes of memory that way.
Answer: I see a couple of answers that boil down to "don't use recursion". I disagree - it's not like the iPhone is some severely-constrained embedded system. If a problem is inherently recursive, feel free to express it that way.
Unless you're recursing to a stack depth of hundreds or thousands of frames, you'll never have an issue.
Answer: The max stack size on the iphone?
The iPhone runs a modified OSX in which every process is given a valid memory space, just like in most operating systems.
It's a full processor, so stack grows up, and heap grows down (or vice versa depending on your perspective).  This means that you won't overflow the stack until you run out of memory allocated to your program.
It's best to avoid recursion when you can for stack and performance reasons (function calls are expensive, relative to simple loops), but in any case you should decide what limits you can place on recursive functions, and truncate them if they go too long.

Should I avoid recursion on the iPhone?


Error handling for View State of vf page in Apex Salesforce

Question: I have one vf page in which I have a requirement to display huge data but as we know Vf page has View state Limit as 135 KB , hence after reaching this Limit salesforce throws Exception as "Maximum view state size limit (135KB) exceeded".
So I have to show a custom  Message on VF page when this limit is exceeded.
Is there any way to check this limit in code? or way to throw a custom message after limit is exceeded.
Thnaks In Advance.
Comment: You typically know the list size when your page explodes.So check size of the list and populate message and clear the list to avoid view state error .
Answer: You should take a look at following article:
Introduction to Visualforce View State
The use of transient keyword will allow you to minimize the Viewstate. Though, technically there is no known way to calculate Viewstate in visualforce via Salesforce Apex API, we just need to code within the best practices boundaries and that usually make sure that Viewstate issues never arise, also as @Mohith mentioned, clearing of Variables/List variables or variables specifically of blob datatype (file upload controls), also minimizes Viewstate by a good margin.
Answer: Please see the answer I posted to best-practices-for-custom-controller-actions which includes a summary of view state and what impacts it most when optimizing custom controllers. In particular there's a reference to an excellent webinar on Advanced Visualforce by @PBattison that should be available for viewing any day now.


in search of different zemiros tunes

Question: I'm looking for new non standard tunes for zemiros. For example i really like the dror yikra sang to simon and garfunkels scarborough fair (if you're interested i found someone has it up on youtube here https://www.youtube.com/watch?v=Ea1m-HDZ6xM). I would really like to find more zemiros that have good tunes put to them. Any help would be greatly appreciated! Thanks!
Comment: Did you know this site? http://www.zemirotdatabase.org
Comment: https://www.youtube.com/watch?v=lirCAN0OXNs
Answer: As long as you've already delved into sticking with two Jewish boys from the 60's for creating a tune for a Moroccan who wrote poetry about a millennium earlier, you can try singing the same words to the tune of either "Sloop John B." by the Beach Boys or the tune of "The Adams Family" (I don't know who wrote that.)
My advice - stick with the "classical" Shabbat "Jewish" tunes. If you try a bit, just about any tune in 4/4 meter can fit anything you like. It doesn't mean I would sing "Eishat Chayil" to the tune of "Witchy Woman".
Answer: There is lots of resources in the net where you can find different versions of the popular songs.
I use soundcloud.com a lot. If you like niggunim then check out http://audio.chassidus.com/audio/enign/

in search of different zemiros tunes


Does #defines decrease performance?

Question: I would like to know that if we #define a particular function like this
<code>#define POST_NOTIFICATION(NAME, OBJECT) [[NSNotificationCenter defaultCenter] postNotificationName:NAME object:OBJECT]
</code>
will using above decrease performance?
Answer: No. #define is a preprocessor directive meaning that anywhere the preprocessor sees the POST_NOTIFICATION symbol, it will replace it with the <code>[[NSNotificationCenter ...]]</code> code.
Answer: No, it won't decrease performance. The #define directives are preprocessor directives, which are "replaced" in code before compiling, so the final binary code is the same.
However you should refrain from using defines ... It might seem to make the code more readable, however it does not really do it ... Also for one-lines like in the example you gave the benefit probably is not that high to use it.
However to answer your question, the final binary is not different if you use this construct, so there is no performance decrease.

Does #defines decrease performance?


Why is hydrofluoric acid so dangerous if it is a weak acid?

Question: I've read that hydrofluoric acid (HF) is extremely dangerous to touch, but what exactly makes it so toxic? It's a weak acid ($K_a = 7.2 \times 10^{–4}$) and dissociates approximately 1/1000 as much as hydrochloric acid does in water, so why is it so much more dangerous? Wouldn't a stronger acid cause more damage? What exactly happens when human skin comes into contact with hydrofluoric acid that causes it to get so badly damaged?
Comment: Acidity is not the only dangerous effect a compound can have, fluorine will oxidize almost anything, including oxides. it is highly poisonous to nearly all biological systems.
Comment: @John But HF will dissociate into _fluoride_, not fluorine, surely?
Answer: The confusion arises from the term weak, which has only to be interpreted in chemical terms.
Weak acid, as you say, just means that the acid does not readily dissociate, not that its effects are weak! Just to say one, HF corrodes glass, something that not even smoking HCl does.
Wikipedia has a nice summary of HF toxicity (see also the references in the article itself):

Hydrofluoric acid is a highly corrosive liquid and is a contact poison. It should be handled with extreme care, beyond that accorded to other mineral acids. Owing to its low dissociation constant, HF as a neutral lipid-soluble molecule penetrates tissue more rapidly than typical mineral acids. Because of the ability of hydrofluoric acid to penetrate tissue, poisoning can occur readily through exposure of skin or eyes, or when inhaled or swallowed. Symptoms of exposure to hydrofluoric acid may not be immediately evident. HF interferes with nerve function, meaning that burns may not initially be painful. Accidental exposures can go unnoticed, delaying treatment and increasing the extent and seriousness of the injury.
  Once absorbed into blood through the skin, it reacts with blood calcium and may cause cardiac arrest. Burns with areas larger than 25 square inches (160 cm2) have the potential to cause serious systemic toxicity from interference with blood and tissue calcium levels. In the body, hydrofluoric acid reacts with the ubiquitous biologically important ions Ca2+ and Mg2+. Formation of insoluble calcium fluoride is proposed as the etiology for both precipitous fall in serum calcium and the severe pain associated with tissue toxicity.
Comment: But how it can penetrates the skin if it is a polar compound? How is it soluble in the tissues?
Comment: This suggests transport occurs by non ionic diffusion https://pubmed.ncbi.nlm.nih.gov/6266462/ and as Wikipedia says it is lipid soluble
Comment: helpful source, it is about treatment but has a good breakdown of effects. https://www.sciencedirect.com/science/article/abs/pii/S0305417914001508
Answer: This question appears to have a revived interest? I would like to clarify this Q&A you don't mind.

HF(aq), like other hydrogen halides, does completely give up its proton to $\ce{H2O}$ but since F is the most eletronegative element on earth, it will pair up with hydronium ion in the aqueous environment, making the proton "less available", at least to a pH electrode. This is one of strongest hydrogen bond known.

$\ce{HF(aq) -> F^-.... H3O+}$

Thus HF(aq) has a depressed pKa in water whilst its "real acidity" can be much higher.

Homo-association of HF only occurs in very high concentration (close to unity). You can estimate the extent of homo-association of anhydrous HF by measuring its conductivity. Anhydrous HF has lower conductivity (<1.6 $\mu$S/cm) than deionized water (~5 $\mu$S/cm) [1] so it's probably not terribly important in driving disassociation of HF, esp in water.
HF causes deep burn, often with a delayed onset because while the skin prevents charged raw hydronium ion from penetrating too deeply, HF or the hydronium-flouride ion pair can be absorbed and releases the hydronium ion (by exchanging with water abundant in tissue) at deeper level. (Thus it's often reported as more painful than other acid burn)
Although fluoride in ppm level is anti-microbial and prevents cavity (by reacting with calcium mineral in tooth), high concentration of fluoride is toxic because, as cited in previous answer, fluoride interferes with calcium metabolism in forming insoluble calcium fluoride. It causes skeletal fluorosis and suppresses some essential metabolic enzymes.
HF is corrosive because of its proton; it's corrosive to bones because of its fluoride. HF corrodes glass and HCl doesn't because silicon tetrafluoride is a more stable complex than the highly reactive silicon tetrachloride. It has little to do with whether the acid is weak or strong.
Answer: I am not a chemist and unfortunately I will have to refer to wikipedia, but the ionization constant for HF (10−3.15, according to wikipedia) does not take homo-association into account.
Homo-association is an association between a base and its conjugate acid through a hydrogen bond. This process stabilizes the conjugate base, thereby increasing ionization. Often this behavior increases acidity, especially at high concentrations. In case of HF (double arrows indicate equilibria):
2HF <- -> H2F+ + F− (autoionization of HF)
HF + F− <- -> HF2− (homoassociation)
The formation of the bifluoride anion (HF2−) encourages the ionization of HF by stabilizing and removing F− from solution hence pulling the dissociation equilibrium of HF (HF + H2O <- -> H3O+ + F-) to the right. Thus, the usual ionization constant for hydrofluoric acid (10−3.15) understates the acidity of concentrated solutions of HF.
Comment: Although the importance of that would depend on the reaction constants of those three reactions... do you by chance know what they are?
Comment: @nico - great comment - but no. I'm just a humble biologist and stumbled upon this info after digging into it. HF is absolutely a strong acid from my perspective and this proves it, albeit just qualitatively. A quantitative answer has not even appeared on chemistry.SE, where a few related questions were posted.


What type of oscilloscope can be used to troubleshoot 100BASE-T1 automotive ethernet?

Question: I would like to implement the 100Mbps single pair automotive ethernet specified in 802.3bw, otherwise known as 100BASE-T1.  I was told that in order to troubleshoot and test on this standard, the scope must be capable of 1 Ghz.  Is this accurate?  Why would this be necessary as opposed to an oscilloscope that is well above 100MHz such as one that is 200MHz, but still 1 GSa/s ?
Comment: *I was told that in order to troubleshoot and test on this standard, the scope must be capable of 1 Ghz* So you didn't immediately ask **why**? Also write 100Mbps and 200 MHz, as m = milli meaning 1/1000th while M = Mega = 1,000,000
Comment: What type of analysis do you want to do? Eye diagrams or just something like network traffic analysis?
Comment: Only looking for network traffic analysis at this point.  Is there a limitation for either type of analysis given much slower specifications?  As for why I wouldn't immediately ask why - it's because I read it on an online article written on behalf of a supplier of expensive oscopes.  I didn't want to specifically call them out, but it seemed like their reasoning may have been a bit biased.  Will make that correction - thank you.
Comment: The 100Base-T1 seems to use PAM3 to send 3 bits as group of two PAM3 symbols. Bandwidth requirement from cable is about 66 MHz (as per wikipedia). So you could use any scope fast enough to see the waveforms. The 1 GHz scope is needed for making precise enough measurements to see if the device passes compliance tests required for electrical parameters or fails them so you can't sell it.
Comment: Thank you @Justme - that definitely clarifies the requirement discrepancy between compliance testing and basic troubleshooting.
Answer: Sounds like you want a protocol tester more than you want an oscilloscope.  But oh well, that's not the question here.

I was told that in order to troubleshoot and test on this standard, the scope must be capable of 1 GHz

No. Even wikipedia will tell you that it only requires CAT3 cabling, and that doesn't guarantee a bandwidth even close to that.

Ah, with your comment:

Only looking for network traffic analysis at this point

yeah, well, then an oscilloscope in itself is no use at all. You'll need a device that speaks that protocol. For some higher-end, there might be add-ons that implement such a protocol decoder. But that again has nothing to do with the scope's 1 GHz bandwidth or not – it's something that extends the signal processing capabilities of the scope, and "converts" it into a protocol analyzer.
Since this is an ethernet standard, in principle, a network card connecting your device A to a PC, which sniffs and forwards the packets in both directions, and another network card for PC <-> device B would sound like a saner investment than an oscilloscope.
Comment: That makes sense.  I hadn't thought of that as an option.
Comment: @asdfex 100Base-T1 is not good old ethernet, and there's no "good old Ethernet hubs" for that (as it's incompatible with the very basic operational principles of that type of Ethernet)
Comment: _"Even wikipedia will tell you that it only requires CAT3 cabling, and that doesn't guarantee a bandwidth even close to that."_ - Where are you reading that? [Wikipedia](https://en.wikipedia.org/wiki/Fast_Ethernet#100BASE-T1) doesn't mention required cable category, but does state the cabling should support at least 66 MHz. [CAT-3 only supports up to 16 MHz](http://www.techlogiks.com/wordpress/technology-coppercables/), so it doesn't look like you can run 100BASE-T1 on CAT-3. And to do conformance analysis etc, a 1 GHz scope doesn't seem too wild a requirement.
Comment: @MarcusMüller Right, I mixed up TX and T1. But Cat3 doesn't fit for T1 (should be around 33 MHz actual BW), only for T2/T4.
Answer: There are two aspects to Ethernet connectivity: signal integrity and content. You'd use an oscilloscope with suitable differential probes to capture the raw signals and analyze them with (usually) an Ethernet signal analysis package on the oscilloscope. That's probably over $10k worth of equipment - if you aren't in that line of work, you'd do a rental. Without that, you won't probably be able to verify that the signal is fully within specs since you won't have bit error rate measurements and such, but at least you can get an eye diagram and make sure it fits the masks prescribed for the physical layer you chose. For 100BASE-T-anything I'd probably look for a 5Gs/s at least - otherwise there are way too few samples per clock period to make it convincing (or even usable if you are diagnosing signal integrity issues vs. merely confirming that things work).
The content aspect is taken care of by wireshark and a PC :)
Comment: why on earth would you need 5 GS/s oscilloscope to analyze a 33 Mbd signal? That's oversampling by a factor of 75; nobody needs that to do signal integrity analysis. This isn't Gigabit Ethernet or something, it's 100Base-T1, which has electrically very little to do with the standard computer Ethernet you're thinking of.
Comment: I guess I didn't look into 100Base-T1 :) Something new.
Comment: It's a 33Mbd signal, yes, so there's 15ns between transitions. 15 samples (at 1Gs/s) is maybe OK to see whether the eye is good enough, although it can be a bit painful at much higher bandwidths. Maybe 2Gs/s would be adequate (30 samples between transitions).


A strange star-like object

Question: So it was around 6 AM and i was looking at the sky and there were not many visible stars because the sun was about to rise. There were two stars that were brighter than the others and i was looking at them for about 5 mins. They weren't moving and the space between them seemed very little. Suddenly, one of those stars started moving down in direction towards the horizon and the other remained still. The star continued to go down. In 1 or 2 minutes it went behind the horizon and stopped being visible, while the other was still at the same place like earlier. At first I thought that the moving object was a satellite, but then i realised that a satellite would orbit the earth with constant speed, and the object i saw remained still for atleast 5 mins. So what else can it be???
Comment: It could have been a plane that was heading directly toward your line of sight that then proceeded to turn toward the ground.
Answer: If it disappeared towards east or so, as I  think because the other "star" should be Venus, that it can be a satellite - or even more an airplane - as seen from "its rear". Basically at first it went far along the line of your line of sight looking still, until finally you could see the curvature of its path. From crude geometric feeling it was most likely an airplane, a lower altitude make it easy the seeing "from the rear" (think about what you see observing the rear light of a car moving on an horizontal road towards a down hill. It looks more or less two lights in the dark then it disappears. Or a ship approaching horizon). About absence of blinking: if it indeed was an airplane mirroring the sunlight, not way to see the less intense "navigation" lights.

A strange star-like object


How did this Mercy get 104% Kill Participation?

Question: They didn't really do anything but play the standard support role, healing and buffing players as needed. The only thing I can think of that might have caused this is Genji's reflect.
Comment: Speaking as a long time TF2 medic, she deserved it.
Comment: "heal and buff players as needed" well... thats exactly what she is supposed to do, right? How does that qualify as "didn't really do anything"?
Comment: I meant to say 'didn't really do anything special', as in played a support role. I've seen many people play Mercy and do nothing but try to get kills.
Answer: You can get both an elimination and a defensive assist if you damage an enemy that gets finished off by a teammate you're healing. With that it's possible to exceed 100% kill participation.
I'm not deleting that for posterity, but it's completely wrong, and the real reason is that if someone destroys Torbjorn's turret (possibly Widow's mines, Junrkat's deployables, Mei's wall, and others, but I can't test) while being healed or buffed by Mercy, they won't get an elimination, but Mercy will gain an assist.
Comment: @acbabis Yes, but that means your whole team is huddling around you and only shooting targets you've already injured, and only after you've healed/buffed them. So it's not practical at all.
Comment: Does this mean it's theoretically possible to get 200%?
Comment: Would healing and damage boosting someone while they kill an enemy also count as double?
Comment: @Bonnici You cant do both of those at once.
Comment: @Matt I mean if you heal while they are damaging someone *then* damage boost them when they kill the same enemy.
Comment: @Bonnici Oh. Thats a good question.


Linux Mint 17.1 installation

Question: I have been trying to install mint 17.1, but all I can see is a blank screen with just mouse pointer. I had even tried to  press Ctrl+Alt+F1, so I don't know which commands to enter from that spot. Can anyone please help!
Answer: I have read rave reviews of Mint but have never got on with it - suffice to say my user name was "is-mint-pants?" and my password was "mintispants" (and you must remember that in the UK what the Americans call "pants" we call "trousers"; "pants", over here, are an undergarment worn to protect the "fundamental" areas of the trousers' groin & buttock from soilage).  However, Mint doesn't recognize either of these any longer!
It seems to me that there are two points to be made:
1) Quote "I have been trying to install mint 17.1, but all I can see is a blank screen with just mouse pointer."
From what are you installing?  Is it a DVD from a magazine cover or is it a download from the internet?  Is it a CD, DVD, Thumbdrive?  Have you tried running md5sum?  On what are you installing it?  All this stuff (and a lot more) is very important.
2)  Why ask here?
Why not go to http://community.linuxmint.com/#?
OK! My favourite solution would be to bin Mint & try some other distro; but, failing that, there are other things you might try:
a)  Go to the Mint website (see above), download another copy & try again.
b)  If that doesn't work, try to log on to the Mint community and see what they come up with - but this time, give them the info listed @ 1 (above)
c)  Failing all of that, I suppose you could try here again
Good luck
dmk
Answer: I've installed Linux Mint most successfully by downloading the .iso image from linuxmint.com and burning it to a DVD with Brasero. If you're using a Windows PC to download the .iso image, then Power ISO and Imgburn also work well. If burning .iso images is new to you - here are some tips - use a quality DVD (I use Verbatim disks)- check with md5sum or with the image burner's checksum. My experience with Mint and Ubuntu is that if you burn the .iso image correctly, the install goes flawlessly. Another option is to use OSDiscs.com - you get the disk for about $6 and I have had good luck with this method as well. But it's educational to learn how to burn an .iso image yourself - then you can download and try multiple distros whenever you like. Good Luck.

Linux Mint 17.1 installation


WiFi internet sharing to ethernet switch

Question: How do I convert an existing WiFi network to a wired ethernet connection? I'm not just looking for a single connection (i.e. WiFi bridge). The WiFi is coming from a mobile device (internet sharing) with a limited number of clients. It would have to be something like a "bridge-router" combination, with a DHCP server that is independent from the mobile device. Does such a device exist?
Comment: If there is such a restriction - whether imposed by the mobile device or the wifi bridge - you will need a router. You can either connect the router to the bridge or use the router itself as a bridge if it offers that functionality. Alternatively you can also use a Windows PC as a router, i.e. connect the PC to wifi and then enable internet connection sharing. Afterwards you can connect the remaining clients to the PC's ethernet port.
Comment: Why can't you use a wifi bridge? Just connect an ethernet switch to the bridge and then all your clients to the switch. Your mobile device has a dhcp server built in. I don't see why you would need another one.
Comment: @SpiderPig Good question. I've had some issues getting an IP address for all ethernet devices, and thought it might be due to the restriction of number of simultaneous wireless connections the mobile device imposes.
Comment: @SpiderPig Thanks. Does this "router-bridge" mode have a specific name? Do you know which devices support it?
Answer: Yes, such devices exist: basically every home router that has both ethernet ports and wifi can do that. You can get used ones for very cheap, and even new ones are not expensive. It doesn't need to have DSL, but having it doesn't hurt.
Put OpenWRT on it, then you can configure it with a DHCP server and NAT, if the original firmware doesn't allow you to do so.


How to calculate absorbed dosage

Question: Lets say you have some unstable isotope which decays via beta decay. For example, lets say you want to calculate the amount of beta radiation that is emitted from the decay of $^{87}\textrm{Kr}\to  ^{87}\textrm{Rb}\to^{87}\textrm{Sr}$ where both decays are via beta- decay. I know how to calculate the radioactivity in mCi for each isotope in this decay at any arbitrary time. I know the half-lives and $Q$-value for each decay, but I'm not sure how to calculate the absorbed dosage in rad or gray. Is this a straightforward calculation? If not, where could I start reading to understand how to do it?
Comment: The place to start is thinking about the definition of 'absorbed dose' and asking questions like "How much of the energy gets from the source to the victim?" and "How much of that is going to pass right through?". You'll need some basic familiarity with the [Passage of Radiation Through Matter](http://pdg.lbl.gov/2015/reviews/rpp2015-rev-passage-particles-matter.pdf) (PDF link, see [the contents page](http://pdg.lbl.gov/2015/reviews/contents_sports.html)).
Answer: RAD, Radiation Absorbed Dose 1 RAD = 100 ergs absorbed per gram.
In my opinion there is no simple formula to calculate the dose in a very straight forward manner. To calculate the dose you have to calculate the energy deposition in a mass. For this you need range vs energy deposition curves. In the case of heavy particles they show a so called Bragg peak i.e. the energy is deposited at the end of range, electrons deposit their energy throughout their range. Hence to calculate the dose you need 1. range 2. energy deposition through the range 3. area of irradiation 4. density of the medium. With these quantities you can estimate the dose.
Now you need to convert RAD to REM, (Roentgen equivalent Man). Different particles have different weighing factors which indicates the damaging capability of those particles to human tissues on the absorption of same dose.
Now we talk about shielding, In the case of $\gamma$ rays the shielding mainly reduce the intensity of $\gamma$ rays and not their energy. However the shielding for particles mainly reduces their energy, and their number is reduced if shielding is longer than the range of particles.
Hence if you have shielding of $\beta$ particles their energy will reduce as well as their range and which reduces the affected volume.
You need to make or download numerical codes in order to calculate the doses. I think there is no simple way to do it. Scattering and absorption cross sections are available with NIST database.
I believe that my answer is not the full solution of your problem but it will show initial direction to achieve your goal.
Regards,
Answer: Absorbed dose for a given tissue or body organ  can not be easily calculated using simple equations, even though it is simply defined as "amount of mean energy imparted per unit mass" , because it depends on so many other factors.
Absorbed dose for a given material can be measured using devices called as Dosimeters such as (Calorimeters, ion-chambers, or Film dosimeters, ets), but still with lot of correction factors.
Absorbed dose to a given material or medium depends on many factors such as type of charge particle, properties of medium,type of radiation interaction etc.
But as a standard procedure, you can calculate amount of energy absorbed to a some quantity of water by using a simulated software, but those requires good knowledge about Medical or Radiation physics.

How to calculate absorbed dosage


List font sizes used in a psd document

Question: I need a way to find out what font sizes were used in a psd document, similar to this, but for font sizes. It would be great if this way or script is compatible with older versions of PS, like CS4 and above.
Tools like Avocode and Adobe Extract support this, but I need it to work inside Photoshop.
Answer: Have a look here: https://github.com/RobotsAndPencils/Scribble
It lists all fonts including font sizes.
Comment: Hey, thanks for your response. This doesn't really do it for me, its kind of slow ( don't know how fast a script should be that does this though, so slow is a relative term, but compared to the one that list the fonts, its a lot slower ), lists in pt's and not really intuitive. Best case scenario it just lists the different font sizes in pixels, and maybe the font that it was used in, but the second one is just nice to have. If anybody else wants to do this, Adobe has this thing called Extract on their website, its free, you upload the psd and you can check out a lot of stuff + export assets.

List font sizes used in a psd document


Exchange air and maintain thermal insulation

Question: My application is composting with worms outdoors inside an a styrofoam cooler.  I use a heat lamp and a thermo-electric cooler to maintain the temperature in the bin when the temperature outside is out of bounds for healthy worms.  When the temperature outside is in bounds, I'd like to exchange the air in the bin with fresh air from outside, but I don't want to permanently compromise the insulating properties of my bin with lots of air holes.  So I'm looking for actuator solutions that would allow me to open/close a window of sorts.  I'm considering a solenoid air valve but I don't necessarily need/want an air compressor - a simple fan is sufficient to circulate the air. Any suggestions?
Comment: Do you need your container to be airtight or watertight or none of the above?
Comment: It doesn't need to be strictly airtight or watertight.  I just want to minimize thermal losses while closed.
Answer: This is no question of robotics... Keep it simple (:
Google for "Louver Bath Vent": https://www.google.de/search?q=Louver+Bath+Vent
These kinds of ducts open by the air pressure generated from a ventilator.
Comment: +1 for this, a self-closing gravity grille (I don't know the proper name) to let the air out and a fan + small inlet to draw the air in.  When the fan is not running the grille will close and there will be very little air exchange with the outside.  No need for an extra actuator.
Comment: I like this idea, and will probably mark as accepted shortly. I'm just having trouble finding something off the shelf in  the smaller size I was envisioning.  The smallest dampers / louvers I've seen are 4 inches and I'm not certain they are self-closing.  I was hoping for something closer in size to CPU fans, so more like 1 to 2 inches.  I might try to fashion something similar myself using a weighted flap of insulating material.


Installing dmg through terminal results in unverified signature macOS

Question: I was trying to automate .dmg installation on MacOS 14.2.1 through a bash script
The script does this:

mount the .dmg
copy the .app inside the .dmg into /Applications
unmount the .dmg

After the .app is copied to /Applications, when I try to open it it displays "cannot be opened because the developer cannot be verified".
However when I install it manually without a script it doesn't show this message.
Important note: The application I was testing this on was Discord, so it's definitely signed and verified
This is the script
#/bin/sh

hdiutil attach ~/Downloads/Discord.dmg -quiet -nobrowse
cp -rf /Volumes/Discord/Discord.app /Applications
hdiutil detach /Volumes/Discord

One thing I noticed is that if I move the .app through the script (not manually) and try to verify its signature with codesign --verify /Applications/Discord.app It displays:
/Applications/Discord.app: bundle format is ambiguous (could be app or framework)
In subcomponent: /Applications/Discord.app/Contents/Frameworks/Electron Framework.framework

Answer: Try
rm -rf /Applications/Discord.app
cp -R /Volumes/Discord/Discord.app /Applications

From man cp:

Historic versions of the cp utility had a -r option.  This
implementation supports that option, however, its behavior
is different from historical FreeBSD behavior.  Use of this option is strongly discouraged as the behavior is
implementation-dependent.


How do I diagnose a computer that shows no signs of life besides a lit peripheral

Question: The PC powered off suddenly last night and since then, has shown no signs of life besides the illuminated LED in the headphones, which leads me to believe that the machine is getting some sort of power and that perhaps it is not a PSU issue. I have no other machines to test the PSU and lack the knowledge to test it alone. What is the best recourse at this point? I've opened up the case and didn't find anything off, I tightened connections just in case.
Comment: Disconnect EVERYTHING from the power supply except Motherboard & RAM,.  This includes disk drives, USB devices, etc and see if it turns on.  Leave the front panel connector attached too so you can use the power button.  This will tell you if the computer can power on.  Another option is to disconnect the Power Supply completely from the MB and peripherals (you can leave it in the case) and manually turn it on via temporarily shorting the pin from the green wire to any black wire.  This will tell you if the power supply can at least turn on independently.
Comment: It could be that the PSU is not delivering enough power. The cheapest way to test the PSU without having a second setup to test the PSU, is to use a multimeter.
Comment: You can also purchase a PSU tester unit. Basic ones cost about $20. When you turn on the computer, does it beep at all? do any fans spin, even if just for a second? If you completely disconnect the power for 30 seconds and plug it back in, is there any change in behavior?
Answer: Even when the machine is "off" parts of the board are energized with +5V.  (That's why you turn off the power supply itself before messing with the board.)  I have seen that +5V leak onto motherboard USB ports.  And I've seen the reverse--a powered hub leaked +5V back onto the motherboard--I had a power light on the motherboard with it's power supply unplugged.  While I have never seen power leak in and back out I wouldn't be willing to say it's impossible.
One thing I would test:  With the case open pick a small fan and carefully watch it, then push the power button.  If the fan moves a bit but the machine doesn't come on the power supply isn't putting out enough power and you're getting an out-of-spec shutdown.  I've seen this more than once with aging power supplies.  Also, sometimes the machine will come on if you unplug as much as you possibly can from the power supply.  Note that such a power supply will pass on every power supply tester I have ever seen--they only test at quite low power.
Comment: i will try in the AM and let you know how it works, I appreciate it.
Comment: it's not leaking to the USB, it's there by design so that keyboard that have power buttons can turn the computer on etc....