windows 2008 R2 IP binding issue

Question: we have a strange problem with one of our servers today. Windows Server 2008 R2 with two IP adresses, onee NIC, restarted today morning for some app maintenance. After this restart, this is what happens:
1) IIS service running, app pools running, all sites NOT running. In the error log there is
The World Wide Web Publishing Service (WWW Service) did not register the URL prefix for site 5. The site has been disabled. The data field contains the error number.
For all sites.
2) Filezilla FTP running OK.
3) hMailServer service running, but in fact not doing anything. In the log there is
"ERROR" 2568    "Severity: 2 (High), Code: HM4316, Source: TCPServer::Run(), Description: Failed to bind to local port. Error: bind: The requested address is not valid in its context. Address: , Error code: 10049, Port: 25. This is often caused by another server listening on the same port.To determine which server is listening on the port, telnet your server on port 25. Make sure that no other email server is running and listening on this port, and then restart the hMailServer service."
This error is there four times ( ports 25, 110, 143, 587).
4) SSH server running and OK.
5) Apache server service binded to another IP adress failed too, with errror code
(OS 10049)The requested address is not valid in its context.  : AH00072: make_sock: could not bind to address
So, it looks like all SERVICES are failing, but PROGRAMS (sshd, filezilla) are OK.
To fix everything, it is needed to start apache service manually, restart hMailServer service manually and start each web site in IIS manager manually. From that point, everything is behaving like it should, UNTIL NEXT RESTART HAPPENS. Then its all failing again.
So I was thinking that maybe for some strange reason the NIC does not get IP address "fast enough" and the services fail because of that. Filezilla and SSHD is starting few seconds later and they work OK. I tried to change apache, hMailServer and W3SVC service to "automatic - delayed start" but its not working somehow - after restart, i waited about 5 minutes but none of the services started yet.
Another idea is that there is "something" in the boot proccess binded to all needed ports (25, 80 and so on) but only for few seconds before system boots up. So apache, iis and mail server cannot bind there and fail. But how to check that ?
The NIC is set up for both static IP adresses.
I am not so much networking guy so I am lost. Any help would be much appreciated. Thank you.
So after some googling and comparing event viewer from previous restart with these problematic restarts I managed to push the problem forward little bit.
The first error which shows in the event log after the restart is this
Log Name:      System
Source:        Microsoft-Windows-WinRM
Date:          1/3/2017 08:14:18
Event ID:      10128
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      JSComputers
Description:
The WinRM service is not listening for HTTP requests because there was a failure binding to the URL (http://+:47001/wsman/) in HTTP.SYS.
No remote requests will be serviced on that URL.
User Action
 Please use "netsh http" to check if ACL for URL is set to Network Service.
Additional Data
 The error code received from HTTP.sys is 1214: %%1214
Event Xml:

    10128
    0
    2
    0
    0
    0x80000000000000

    564035

    System
    JSComputers

    1214

So I followed this link https://wintelinterviewquestions.blogspot.cz/2016/03/the-winrm-service-is-not-listening-for.html and WinRM service is now running. This solved the problem with hMailServer and to some extend also with IIS - the service is running, app pools are alive, web sites are in IIS manager alive too, BUT it is not possible to connect to them from outside, connection timeout. I still need to restart W3SVC to make it alive.
In the event viewer is now only error, this:
Log Name:      System
Source:        Microsoft-Windows-HttpEvent
Date:          1/3/2017 08:54:16
Event ID:      15005
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      JSComputers
Description:
Unable to bind to the underlying transport for aaa.bbb.ccc.ddd:80. The IP Listen-Only list may contain a reference to an interface which may not exist on this machine.  The data field contains the error number.
Event Xml:

    15005
    0
    2
    0
    0
    0x80000000000000

    564250

    System
    JSComputers

    \Device\Http\ReqQueue
    aaa.bbb.ccc.ddd:80
    0000040002003000000000009D3A00C0000000000000000000000000000000000000000000000000070200C0

Any help with that ?
Answer: After some tweaking with the networks guys we found out that the network card in the server went mad and after every reboot it disconnects link for about three seconds - this was slong enough for services to unable to bind correct IP address. So we have changed in Intel 8274L adapter settings "wait for link" to "On" as is described here https://communities.intel.com/community/wired/blog/2011/05/27/driver-parameter-talk-wait-for-link and problem solved. Interesting is that the server was working about 5 years without any problems before, without this setting.

windows 2008 R2 IP binding issue


Target2 Balances at the ECB-will it lead to the collapse of the Euro?

Question: Target 2 imbalances within the Eurosystem have continued to grow during 2020.  Currently Germany is owed Eur 1TN by the other countries, principally Italy and Spain.  If Germany at some point insists on redressing these balances, is the collapse of the Euro inevitable?
Comment: I am sorry but this should be closed as opinion based/off topic. 1. There is no economics that will tell you at what level Germany becomes uncomfortable with that. Even if they would be greatly economically loosing that might be worth while for them politically - a topic on which economists are not qualified to opine and probably better question for political scientists. 2. I can't see any way how this could be answered with anything but opinion. This would require quantifying perceived political benefits Germany believes it is getting by subsidizing Southern Europe.
Comment: Thanks, those are exactly the issues I am interested in.  Let me edit the question to focus on the economics.
Answer: Although possible it is not necessary for several reasons.

Optimal currency area (OCA) can in principle exist even without fiscal transfers/excessive borrowing if there is perfect factor mobility within the OCA that can absorb the asymmetric shocks that countries in the monetary union face (see De Grauwe Economics of Monetary Union).

In the European Monetary Union (EMU), at a present, the factor mobility is not perfect because while there are no direct legal restrictions on movement of capital and labor it is not easy for people to move due to language barrier and poor integration of social security at EU level. However, as time progresses we see English becoming world-wide lingua franca. For example, in the Netherlands (where I live) a reasonable EU citizen can live and work never learning to speak Dutch in virtually any industry that does not require direct contact with consumers. All government forms and interactions are in both Dutch and English, and the same holds for doctors, and  virtually all retail/service businesses. This significantly lowers barriers to labor mobility. In addition all the social security systems are getting more and more integrated within EU. For example, when it comes to healthcare the system in EU is already integrated in a way that switching is not a hassle but same does not hold for pensions.
Since we are talking about some unspecified future it is possible that at that time the labor mobility will be sufficiently perfect that any shocks can be absorbed via  labor mobility and mobility of other factors as well. Indeed, if in past there would be no implicit restrictions on people moving from one EMU country to another, instead of fiscal transfers you would see large flow of people that would eventually correct the imbalances.

Germany presently sends fiscal transfers to the Southern Europe because it was fortunate enough to experience positive productivity shocks while southern Europe experienced negative ones. I am not trying to minimize the role of good governance and policy in German robust productivity and also economic growth in recent decades, but no matter what policy  this is to a significant extent also driven by random technological (where I am using the word in broad economics sense) or other macroeconomic shocks. Even the best govern country can't do much about that. In addition, random demand shocks or even monetary policy (e.g. low interest rates for too long) is also one of the issues that can contribute to macroeconomic imbalances that necessitate fiscal transfers (Pierluigi,  Sondermann 2018; Blanchard and Giavazzi 2002; Lane and Pels 2012;  Chen et al 2012).

Since  we are discussing the future it is entirely possible that in 10 or 20 years Germany will be the country experiencing negative productivity/demand etc shocks while southern countries will be experiencing positive ones, as often macroeconomic shocks can be asymmetric.  If the Germany starts insisting that South redressing its debt/fiscal transfers imbalances to Northern countries at that point in time - when it is from macroeconomic perspective optimal for South to actually do so, it won't cause any problem for the Euro, if anything it would be the optimal response.

Euro, is not just economic but also political project. In principle, even if Germany does not want to send fiscal transfers or lend to southern countries, if ECB conducts monetary policy in a way that addresses only macroeconomic shocks in countries experiencing negative shocks (which in case of asymmetric shocks would be at an expense of countries not experiencing negative shocks), or if EU leaders decide they are fine with living with financially instable EMU it is still possible to keep the euro.
Comment: Thanks, I'll be interested if anyone can reasonably rebut that argument.
Comment: @dm63 which argument you have in mind? 1 and 2 are just general well known results from economics of monetary union/macro very well supported by empirics - there is not much rebutting to be done there at least not within mainstream economics - and I would not even considered it an argument but rather statements of scientific facts. 3. Is an argument but also is less about economics than acknowledging that for better or worse euro is not about economics. If it would be  about economics it would never be adopted in the first place (at least not ahead of fiscal Union).
Comment: Well, (a) will sufficient labor mobility ever occur in the Euro area (b) given enough time will the transfers naturally reverse and (c) will Germany have the political will to continue with the current system. The last one is not economics.
Comment: @dm63 regarding a) that is one of the main stated goals of EU, and empirically there is a trend toward greater and greater labor mobility. I don't think there question is if, but when. That would be a good question, but since we are talking about unspecified future it does not matter for an argument. b) The target 2 transfers exists because of macro shocks - that is a fact that can be empirically verified - unless you believe Germany will never experience severe negative economic shocks its just matter of time. Given what we know about macroeconomics shocks are unavoidable regardless of policy
Comment: @dm63 Regarding c) I fully agree with you but question was whether euro collapse is inevitable not likely or possible - in the first line of my answer I stated collapse of euro is possible. In fact it is possible even in the best times since its in the hands of EU politicians and politicians might have motives that go well beyond economics (e.g. getting votes from nationalists or see exhibit 1 Brexit which from economic perspective is disaster for UK economy but from political perspective it was likely optimal gamble for Cameron).
Comment: Thanks.  The economics is fairly clear but the politics is unpredictable.


Maximum work done in isothermal or isobaric process?

Question: In an isothermal process all heat is converted into work while in an isobaric process heat is converted into work as well as internal energy. However, the PV-graph shows that the maximum work is done in an isobaric process. How do we resolve this discrepancy?
Comment: Do you think that the amount of heat received by the system is the same in both cases?
Comment: You need to specify further constraints. Isothermal processes can do more than, less than, or the same amount of work as an isobaric process depending on the states you are moving between for your system
Answer: I am assuming you are looking at the ideal gas and wondering about comparing two processes, one isothermal and one isobaric, where the initial state is the same for each process, but the final state is different, but at the same larger volume (of course both the initial and final states cannot be the same). Which, if you then look at the PV-diagrams of these process you will see that you are correct: there is more area under the curve of the isobaric process compared to the isothermal process

Of course, if we started at different states but ended at the same state the opposite would be true: the isothermal process would have done the larger work.

And we can actually take two systems that start and end at the same volume with these processes and have the same amount of work done for both:

So really, this question is not answerable. There is no "maximum work process" if we just specify that one is isothermal and one is isobaric.

We can still look at the energies associated with the first image (since it seems like this is what you had in mind when asking this question).
The work done on the gas during the isothermal expansion is given by
$$W_T=-NkT\ln\left(\frac{V_f}{V_i}\right)$$
And, as you said, since there is no change in internal energy, the heat that enters the system is given by
$$Q_T=-W_T=NkT\ln\left(\frac{V_f}{V_i}\right)$$
The work done on the gas during the isobaric process is simply
$$W_P=-P(V_f-V_i)$$
and the change in internal energy is given by (assuming a monatomic gas)
$$\Delta U=\frac32Nk\Delta T=\frac32P(V_f-V_i)$$
so the heat that enters the system is given by
$$Q_P=\Delta U-W_P=\frac52P(V_f-V_i)=-\frac52W_P$$
So we see that for the isobaric process, the heat that enters the system is $5/2$ larger than the work required for the process, whereas for the isothermal process the heat and work are equal. Since we know that the isobaric process in this example already requires much more work than the isothermal process, we see that the isobaric process also needs more heat than the isothermal process.
Therefore, even though the heat of the isobaric process is divided between work and changing internal energy, there is still more heat involved, so there is no contradiction even though all of the heat goes into work for the isothermal process.
Answer: There's no "discrepancy ". I don't mean to be presumptuous, but I think you may be confusing maximum work with maximum efficiency.
Efficiency is gross heat added divided by net work done. A reversible isothermal process converts all the heat added to work. As a process it is 100 % efficient. The isobaric process does not.
So although an isobaric process may do more work, it does it less efficiently.
This is one reason why the Carnot cycle, the most efficient cycle possible, has two reversible isothermal processes,
Hope this helps


jQuery Validate plugin does not set valid class on input element on successful remote validation

Question: So here's the problem. I have a form that's being validated using the jQuery Validation plugin by Jörn Zaefferer. I have validation working fine except for one component i.e. remote validation. Actually, remote validation does work but not as intended. When I enter some data in the username input and "focus out", the data is validated on the server and depending on the username availability the server responds with the string true or false. Now, on the client side, I expect the validation plugin to add the "error" or "valid" class to the input element based on the response from the server. The plugin does add the "error" class when it receives a false response string from the server, but fails to add the "valid" class upon receiving true response string.
To add to the mystery if click inside the username input and focus out the second time, voila! the valid class gets added. A point to be noted: The remote Ajax validation does not run on the second focus out since the input field data has not changed. The plugin is merely adding the class based on the last response (that's what I think) it received from the server. Weird.
Initially, I thought the problem could be due to asynchronous Ajax. But I changed it to synchronous. Problem persisted. I have throughly checked the response from the server in Firebug console. And I can see "true" or "false" strings (without quotes) as response.
I also added the errorLabelContainer (though I do not require it) to check if it was receiving anything. Here as well, on error the errorLabelContainer selector receives the error message but on success it remains blank.
I need the valid class to be set since I use it for changing input background in CSS for visual indication to the user.
Here's the validation code that I have:
<code>$('.registration-form').validate({
    debug           : true,
    onkeyup         : false,
    errorLabelContainer: '.message-box',
    onfocusout      : function(element) { var isvalid = $(element).valid(); console.log(isvalid); },
    rules           : { username                    : { required: true, alphanumeric: true, minlength: 3, remote: { url     : ajaxVars.ajaxurl,
                                                                                type    :'POST',
                                                                                async   : false,
                                                                                cache   : false,
                                                                                timeout : 5000,
                                                                                data    : { action: 'check_username',
                                                                                username: function() { return $('input[name="username"]').val(); },
                                                                                _ajax_nonce: ajaxVars._ajax_nonce
                                                                                }
                                                                                }
                                                    },
                        email                       : { required: true, email: true, remote: {  url     : ajaxVars.ajaxurl,
                                                                                type    :'POST',
                                                                                async   : false,
                                                                                cache   : false,
                                                                                timeout : 5000,
                                                                                data    : { action: 'check_email',
                                                                                email: function() { return $('input[name="email"]').val(); },
                                                                                _ajax_nonce: ajaxVars._ajax_nonce
                                                                                }
                                                                                }
                                                    },
                        password                    : { required: true, minlength: 5 },
    }, // end rules
    messages        : { username                    : { required        : 'Please enter a username.',
                                                        alphanumeric    : 'Your username must be atleast 3 characters long and must only include alphabets, numbers or an underscore.',
                                                        minlength       : 'Your username must be atleast 3 characters long and must only include alphabets, numbers or an underscore.',
                                                        remote          : 'This username is already taken!'
                        },
                        email                       : { required        : 'Please enter an email address.',
                                                        email           : 'Please enter a valid email address.',
                                                        remote          : 'This email is already registered!'
                        },
                        password                    : 'Please provide a password for your new account. The password must be atleast 5 characters long.',
    }, // end messages
    submitHandler   : function(form) {
                        $(form).ajaxSubmit({
                            success                 : show_reg_response,
                            url                     : ajaxVars.ajaxurl,
                            type                    : 'POST',
                            timeout                 : 10000,
                            clearForm               : true,
                            resetForm               : true
                        });
    } // end submitHandler
});
</code>
Answer: I encountered the same problem as yours, my current solution is replacing the remote validation with separate ajax.call to execute my validation logic (a little bit inconvenient since I should implement the show/hide method when appropriate).
Comment: Nope, haven't found a solution yet. Still searching.
Answer: just for giggles, add a complete call back on your remote
<code>    complete: function(data){
      $("#field_id").valid();
    }
</code>
This fixed the issue for me, not sure if it will for you or not depending on the rest of your code.
I am using a similar set of code as you.
Hope that helps
T


What does "linear-by-linear association" in SPSS mean?

Question: Is "linear-by-linear association" in SPSS another name for the chi-squared test for trend? If not, what is it?
Comment: This question seems well-defined and on-topic to me - the issue here is basically one of terminology.
Answer: It is. You might have a look at IBM's support page for SPSS,
where it is stated in a technote on the Chi² test:
'The Crosstabs procedure includes the Mantel-Haenszel test of trend among its chi-square test statistics. ... The MH test for trend will be printed in the "Chi-Square Tests" table and labelled "Linear-by-Linear Association".'
see: https://www-304.ibm.com/support/docview.wss?uid=swg21477269
Answer: As a previous reply mentioned, yes it is and the technical description is at SPSS's support page: https://www-304.ibm.com/support/docview.wss?uid=swg21477269
This is a useful statistic for those who understand it.  Suppose we investigate whether 78 employees' promotion (yes/no) is related to their performance ranking in the previous year (1-4, 1=low), as follows:
Ranking 1: Not promoted 17, Promoted 2, Total 19.
Ranking 2: Not promoted 16, Promoted 4, Total 20.
Ranking 3: Not promoted 14, Promoted 6, Total 20.
Ranking 4: Not promoted 10, Promoted 9, Total 19.
SPSS shows a significant linear-by-linear association (p=.008) showing that there is a significant association between the ranking and being promoted.
Some useful details of how this works are:
1.  The test relates to the odds.  Odds are used for their statistical properties, and are not quite the same as probabilities.  For ranking 1, the odds of being promoted are 2:17, as opposed to the probability which is 2:19.
2.  Then, the test is on the odds ratios; e.g. if you move from rank 1 to rank 2, the odds ratio is 4:16/2:17 = 0.250/0.118 = 2.12.  (The null hypothesis is that the odds ratio is 1, i.e. a change in ranks makes no difference to the odds.)
3.  The procedure presumes that the odds ratios (in the population) are the same for all steps (i.e. if moving from rank 1 to rank 2 doubles the odds of promotion, moving from rank 2 to rank 3 would also double the odds of promotion).  That is why there is only 1 degree of freedom.  (This assumption is known as "linearity in the logit".)
4.  The test is therefore conceptually the same (and gives a similar answer) to doing logistic regression with just one covariate. (In logistic regression, "covariate" means a variable like this one).  In this case the covariate would be ranking, and the DV would be promotion decision.
Comment: Thank you for the expanded answer and helpful explanations, MikeG.  Welcome to our site!
Comment: Nice answer, although the term "one covariate" sounds like a misnomer haha.


Can i invite someone to my single player world? If so, How?

Question:
Possible Duplicate:
Is it possible to turn a Minecraft single player map into multi-player server?

I have wanted to invite my brother to my Single Player world because he hasn't been able to find much diamond. I can find 30 in an hour so I wanted to give him some diamond, build a house for him and have him help me in my mine, but I don't know if I can. I don't want to play on a multiplayer server because it's very time consuming to make one and I don't want to get griefed on a public one.
How can we play together?
Comment: The OP is looking for a way to get another person to play in the world with em. Moving it to a server Is the answer, and is possible.. So I am not sure how this is unclear.
Comment: -1 this question is not clear, and there isn't any way to do this aside from a server.
Answer: You can set up a local multiplayer server that uses your single player world as the world.
Basically, what you do is copy the files in your single player folder over for the server to use. There's a little bit of set up needed. Here's a walkthrough:
Answer: A multiplayer server is the only way for two players to exist in the same world.
Even if you set up a server for your world, however, neither you nor your brother will be able to bring items into or out of that world, as your character's inventory is not shared between worlds/servers.
It sounds as if you may be familiar with Terraria's world/character system, which allows characters to switch between worlds at will and worlds to be opened in single- or multiplayer mode.  Minecraft doesn't follow the same model; the closest you can get would be to spawn some diamonds in your brother's world (via mod or inventory editor) and destroy the same number in yours (say, by tossing them into lava).
Comment: Actually, with some clever file renaming, you *can* carry over inventories.  (But they come packaged with all other data about the player like location.)
Comment: @John — It's possible to get single-player inventories into multiplayer this way, but it requires copying the single-player files from each computer, possibly editing player position so as not to spawn embedded in a mountain, and those files can't be easily converted back to single-player afterward because the world data is discarded.  Again, it's possible to get around this using NBT editors, but it's hardly worth the effort simply to trade items.
Comment: True, it *is* a pain in the neck, but not impossible, like you make it sound.
Answer: It's not time consuming to make a server, all you have to do is download the server file from Minecraft's website (link), run it in a folder where you the server files, and your done. To have people connect to it give them your IP, and enable port forwarding for port 25565.
Another explanation can be found here.
Comment: I think you missed the part where he doesn't want to start his world over again :)
Comment: He doesn't. Just delete the `world` folder in the server and drag in your world.


Measurement of cell constant

Question: Why is cell constant value measured through indirect methods (like using a solution whose conductivity is already known)? Isn't it easier to  measure the length and area of cross section of a conductivity cell directly?
Answer: The mathematical description of the cell constant ($l/A$) does not include factors like fringing fields (the ionic current does not travel precisely in a well-defined path between the electrodes) and the actual surface area for rough surfaces.
The cross section of a round electrode may have different fringing fields depending on its separation from its companion. And if the two electrodes are of different geometry, you have to decide how to average the areas out. I think there was more standardization in the choice of electrode materials, size and spacing than has been carried over into the beautifully simple formula $l/A$, so when the formula is used outside of certain narrow bounds (and I don't know what they are), it's only an approximation, and resistance or conductance can be measured more precisely than the cell constant from geometry. So you might as well calibrate against a known cell or solution.
Answer: The conductivity value of any cell changes with the area of cross-section of the electrode. When we use an electrolyte of concentration within the desired area, the conductivity value varies. When a standard value of specific conductance is given, then from the observed conductance value we can calculate the cell constant.

Measurement of cell constant


What are some clustering algorithms in which I can define no of clusters I require?

Question: Is there some other clustering algorithms apart from K-means in which I can define no of clusters I require ?I have a data set of large and skewed data points and K-Means is not providing quite satisfying clusters as in K-means two nearer point may end up with completely different clusters depending upon the cluster center points I start with.I want to try some other algorithms in which I can specify no of clusters I require(Not some hierarchical algorithms like mean shift).
Comment: Yes, there are plenty. Have a look at ELKI which probably the largest collection of clustering algorithms.
Answer: A common approach with k-means is to run multiple times with different initializations, then pick the best. Some other options that let you pick the number of clusters: Gaussian mixture models, agglomerative clustering, various methods based on graph partitioning problems, other k-means-like algorithms (e.g. k-medoids), spectral clustering (which is really just k-means after a nonlinear embedding).


How to prevent adding of duplicate item to Drupal Queue?

Question: I am using Drupal Queue (Class DrupalQueue) to store items (a simple objects).
How can I check if there is already the same object in the queue before adding a new one ?
Answer: I initially used the answer provided by George, to do a text search for the given queue item. However, I decided that this would often end up with more overhead than just skipping the queue altogether.
So in the end, I changed it so that each queue item does it's job, then uses a similar query to clear out any queue items that are duplicate to itself. This puts the heavy query into the queue processing.
Answer: You cannot find the previously entered values in the queue, since the DrupalQueueInterface interface doesn't expose a method to retrieve a previously added value. You cannot even rely on the fact the value is added in a database table, since that is an implementation detail that can change with the class actually implementing the queue, which can be easily changed from a module.
That is the reason why modules like the Aggregator module take their data from their own database table, where they record the last time they added those values in the queue. (See the comment that says Add timestamp to avoid queueing item more than once.)
  $result = db_query('SELECT * FROM {aggregator_feed} WHERE queued = 0 AND checked + refresh < :time AND refresh <> :never', array(
    ':time' => REQUEST_TIME,
    ':never' => AGGREGATOR_CLEAR_NEVER
  ));
  $queue = DrupalQueue::get('aggregator_feeds');
  foreach ($result as $feed) {
    if ($queue->createItem($feed)) {
      // Add timestamp to avoid queueing item more than once.
      db_update('aggregator_feed')
        ->fields(array('queued' => REQUEST_TIME))
        ->condition('fid', $feed->fid)
        ->execute();
    }
  }

  // Remove queued timestamp after 6 hours assuming the update has failed.
  db_update('aggregator_feed')
    ->fields(array('queued' => 0))
    ->condition('queued', REQUEST_TIME - (3600 * 6), '<')
    ->execute();

You could implement a queue class that checks the value has been already inserted, and use that as default queue class, but a module cannot rely on such implementation details.
Answer: Michal, Here is how I solved this for myself: prior to calling createItem I was making a DB request to queue table searching for a value in data field.
Here is a piece of code that is working for my site:
function
__my_custom_queue_add_id_for_worker_achievements_guides_flags_updates ($uid) {
    // But 1st confirm that this user is not already scheduled for recalc
    if (!db_query( // Returns Queue ID if found
        'SELECT item_id  FROM {queue} WHERE name = :name AND data LIKE :nid LIMIT 1',
        array(
            ':name' => 'achievements_guides_flags_updates',
            ':nid' => '%"' . $uid . '%',
        )
    )->fetchField()) {
        $queue = DrupalQueue::get('achievements_guides_flags_updates');
        $queue->createItem($uid);
    }
}

Comment: Just a heads up that text comparison is quite slow in SQL, so to compare the data in larger queues can result in performance issues.
Answer: Hi I stumbled upon this question looking for an answer myself, and my team and I came up with a viable, performant solution using static caching.
$queue_cache = &drupal_static($cache_name, []);
if (!empty($queue_cache[$entity->id()])) {
  return;
}

... Build your queue data here ...

$queue->createItem($data);
$queue_cache[$entity->id()] = TRUE;

What this does is it creates a static cache during runtime when queueing items. It will first check if the entity id exists, and if so, skips it. Otherwise, it queues it normally. No need for querying blobs in the queue table or anything like that.
Answer: Create a class (or you can put it in the .module file if you want):
/**
 * Custom queue implementation to merge on creation, preventing duplicates.
 *
 * See https://www.webomelette.com/overriding-queues-drupal-7-or-how-not-create-duplicate-queue-items
 */
class MergeQueue extends SystemQueue {

  /**
   * Overriding the method to make sure no duplicate queue items get created.
   */
  public function createItem($data) {

    $serialized = serialize($data);

    // Merge instead of insert to prevent duplicates. An item is updated if it
    // already exists.
    $query = db_merge('queue')
      ->key(array('name' => $this->name, 'data' => $serialized))
      ->fields(array(
        'name' => $this->name,
        'data' => $serialized,
        'created' => time(),
      ));
    return (bool) $query->execute();
  }

}

if (module_exists('queue_ui')) {
  /**
   * Support Queue UI inspection.
   */
  class QueueUIMergeQueue extends QueueUISystemQueue {}
}

And in the .install file:
/**
 * Implements hook_install().
 */
function my_module_install() {
  variable_set('queue_class_merge_queue', 'MergeQueue');
}

/**
 * Implements hook_uninstall().
 */
function my_module_uninstall() {
  variable_del('queue_class_merge_queue');
}

See https://www.webomelette.com/overriding-queues-drupal-7-or-how-not-create-duplicate-queue-items


What is philosopher's definition of Universe? And what is Multiverse?

Question: As by definition Universe is collection of every thing in space. So if everything in space is inside universe then why we talk about parallel universes? Wouldn't they be inside the universe by definition? How does term Multiverse really have meaning does it implies we have many other collection of everything?
Comment: How is this question different to? https://philosophy.stackexchange.com/questions/12689/defining-the-universe
Comment: [Unrestricted quantification](https://plato.stanford.edu/entries/quantification/#UnrQua), or attempts to refer to "all things"/"everything" at once, are at least somewhat problematic. There used to be a saying, "God and the world are not parts of some other whole." Multiverses are sets of discontiguous spacetimes, or causally/action-theoretically/factively closed spacetimes, where a spacetime is not a zone of unrestricted quantification. OTOH there are definitions of "multiverse" that seem to imply separare total quantifications, which are somewhat unseemly.
Comment: The universe is not always defined as everything in spacetime. According the Platonism there exists abstract objects often called being in different realms of the universe. https://en.wikipedia.org/wiki/Platonism
Comment: We talk about "parallel universes" because people are sloppy, prone to hype and use words ambiguously. The original meaning of "the universe" was everything that physically exists. In spacetime, as far as we know, but quantum gravity may well replace it with some other substrate. Even MWI used it in this sense originally, sometimes capitalized as Universe, calling individual branches "worlds". Then Deutsch replaced Universe by "multiverse" and many decided that it sounds cooler. So  the "worlds" became "parallel universes", see [SEP](https://plato.stanford.edu/entries/qm-manyworlds/#ObjeMWI)
Answer: The multiverse, more broadly speaking, is of ancient origin. Heaven and hell were not of this world but in a different world altogether.
But of course the modern mania for the multiverse is not referring to this but to universes parallel to ours. There are several versions:

many worlds multiverse: this takes the evolution law of QM as axiomatic and dispenses with the collapse. It was originally formalised by Everett and championed by DeWitt amongst others.

general relativity multiverse: that the universe is much larger than our observable universe and perhaps infinite in extent.

string theory multiverse: one of the selling points of string theory was its uniqueness as a theory. However, it relies on a landscape of vacua which tunes the basic constants of our universe. This of course loses uniqueness as there is a choice of vacua which the theory doesn't single out. Some string theorists made this weakness a strength by declaring all possible universes actually exist.

Smolin's Multiverse: Smolin invoked a Darwinian selection principle amongst baby universes to select universes. In a sense, he is invoking the anthropic principle.

There are probably many others. The main criticism of multiverses is that they aren't scientific in the sense of being falsifiable in the Popperian sense. All the parallel universes listed above are causally disconnected from ours so there is no way of even finding them, never mind exploring them. Few advocates of multiverses care to tackle this critique, however one author of a book of many worlds multiverses did manage to say the notion is "extravagant". Indeed. What they are generally engaged in is not physics as understood by Galileo or Newton but metaphysics but such poor metaphysics gives metaphysics a bad name. Especially metaphysics that doesn't name itself as such but pretends to be physics ...
Sometimes these multiverses are spurious. For example, lattice QG in the early 2000s predicted a fractal-like structure of baby universes which might have prompted the invention of fractal ontology. However, the theorist Renate Loll pointed out that once these models actually used a Lorentizian metric as opposed to a Riemann metric the fractal structure disappeared. One might ask why did they dispense with a Lorentzian metric given that they were exploring quantum gravity and gravity means GR and GR as Einstein discovered it has a Lorentzian signature? The only reasonable answer is that calculations were easier in that framework ... never mind that in the light of what we know this is the wrong direction to take! The moral of this story is not to take the results of physicists on blind faith but to question them on what assumptions and approximations they used to come up with their theory ...
More broadly speaking, you are correct to identify the multiverse as simply the universe as the latter means all that there is. Likewise the atom meant something that was unbreakable but of course atoms break all the time. This is just part of language change. Language changes all the time. Much more often than inventing a new word, words change by stretching or contracting what they signify. Sometimes a new meaning stretches the word too far to be generally taken up. This is not what has happened to the world, "multiverse". It is an interesting question why such esoterica is part of everyday language now. Part of the answer, I suspect, is that people have always been interested in exploring what occurs beyond limits and what more stronger limit is that imposed by being of this universe? Another part of the answer is that publicity departments of universities weren't above hyping this esoterica to the public as they knew it would catch the publics attention. Its an easier sell than  selling the next decimal point on a measurement ...
Answer: We coin words to describe things as we currently understand them to be. As we learn more, and realise our original word no longer fits, sometimes we keep the word and change the definition. The word 'atom' means 'indivisible', so the phrase 'splitting the atom' becomes oxymoronic in the same sort of way.
We originally defined 'universe' in the way you suggest - everything that exists in space and time. We built a model of what it looked like. Then later, we learned more, and realised that you could have several of these things we were calling 'the universe' existing in parallel. But like the word 'atom', the word 'universe' was already firmly attached to a particular picture. So we changed the definition instead and invented a new word for everything that now exists in our new, much bigger, and much less familiar picture. The familiar word is used for the familiar concept; the new word is used for the new concept.
The new definition of 'universe' has to be determined from usage, and it is not trivial to do so. It's now something like "everything that exists in a part of space and time that looks like the sort of classical universe we feel we experience". 'Causally-connected component' is wrong. In the 'Many Worlds' multiverse the branches are causally connected - they're just connected like a tree rather than a straight line. Several of the other 'multiverse' concepts (like the 'deeply-nested simulations' multiverse) have causal connections linking them, too.
To some degree, the dividing line is also associated with where things become metaphysical. The stuff we can never observe or test experimentally, even in principle, tends to get excluded from our picture of 'the universe'. Occam's razor can be wielded in two distinct ways - to objects, or to rules. Scientists look at the world of objects, try to devise the simplest possible 'rules' or 'laws' that they appear to obey, and then extrapolate the consequences of those rules. Sometimes the rules imply the existence of objects we cannot ever see or test, even in principle. But to exclude them, we have to invent a more complicated rule, to explain their absence. And because it is an area beyond the reach of experiment, we have no way to decide which of the many possible more complicated rules we should pick.
It was the same with the concept of 'infinity'. We cannot see the edge of the universe, it extends out of sight in all directions, so we have no way to discover the rules that determine its size, or what happens at the edge. The simplest solution is to determine rules that apply here where we can see, and extrapolate the consequences indefinitely beyond the range of our sight. We have no rule to describe or predict an edge, so we assume there isn't one - that's 'infinity'.
If we make up an arbitrary story to explain the presence of an edge, we find we have to keep moving it as we discover more. We started when we could see as far as the edge of the tribal territory. We expanded that to the edge of the trading network of empires we were in contact with. We expanded that to the world. We expanded that to the solar system, surrounded by a celestial sphere of stars. We expanded that to the galaxy, and then we expanded that to billions of galaxies in an 'observable universe' 14 billion years old. We can't see any further, but extrapolating from what we can see, we're pretty sure there's much more of it out there beyond the horizon. Infinitely more? No way to tell. It is currently (and arguably) the simplest model. That's all.


Can the user of an app see what's in the https packets?

Question: If I exchange https packets between a server and an Android client, is it easy for the user of the client to get whatever is in the encrypted traffic? Should I consider all such traffic unsafe if the safety is dependent on the user not being able to somehow read what's in the https packets?
Answer: I don't quite understand what is your usage model where the security depends on the user of the app itself not able to know the HTTPS traffic.
But I believe if your app has no certificate pinning built in, and your client do not properly check the TLS connection (similar to how an end user click "Add Exception..." when the browser complains "This Connection is Untrusted"), the user can simply install a proxy (such as Burp) in the middle to intercept the traffic.
Answer: I would not say it would be easy for the user to get this information but it is possible. I would consider this traffic unsafe on the client end. If you are encrypting this traffic it will be harder for people other than the client to access. The client needs to be able to decrypt the information to access it so yes they can access it and it is unsafe.
Comment: So the user can somehow intefere in the whole TLS process (excuse me if I sound noobish) and gain whatever information is needed to decrypt the packets, more so than an outsider could? Do developers generally consider everything they send to the clients as unsafe with respect to the user itself? Or can I take more measures to hide the information from the user, instead of changing what I exchange between client and server?
Comment: For the user to decrypt the encrypted information it needs a key the key needs to be in the app or else the user can't see the message. If the user has the key in the app what's stopping them from getting it? You could generate a key for each individual connection based on connection properties like usernames or IP address so no two keys are a like.
Comment: @utopikern The user can decompile your app, add a `println` call every time your app sends or receives something, recompile it, and then run that version of the app instead of the one they downloaded from the Play Store. (I say "just", but really that's fairly time-consuming, not least because decompilers suck. But still, users **can** do that)
Comment: It is trivial to set up a debugging proxy that will let you view even encrypted communication.
Answer: HTTPS is end-to-end encryption. That means on both ends of the connection the traffic is not encrypted, only in-between. As long as the user has full access to the device it will be possible to modify the application to intercept data before encryption or it may be possible to add a new CA and do a man-in-the-middle attack (depending on the application - if pinning is involved this might not be possible).
Thus if you security depends on the idea that the user is not able to see or even modify the traffic than your security model is probably wrong. The only thing you can do is to make it harder to analyze traffic by obfuscating code and traffic.


Is there a way to follow a Wordpress site by email alerts for new posts?

Question: It seems that there's no way for me to get an email alert for new content posted on a particular Wordpress site I follow. And strangely I haven't been able to find any information about it around. I'd think this is a very important feature. I can't expect to check the site every day so email is a very natural way for me to know when there's new content out there. Is there really no way if the site owner doesn't set up a newsletter list? I don't even seem to find IFTTT able to do it.
Answer: While WordPress has functionality to send emails out of the box, it doesn't come with any newsletter functionality. Significant enough volume of emails is notoriously unreliable on typical cheap hosts anyway.
WordPress does generate RSS feeds by default, it's an extremely popular format and many tools exist to consume or convert it.
See Feeds in Codex.


Can a black hole bounce?

Question: Is there a limit to the amount of matter that a black hole can accrete per second and if so could a certain sized black hole bounce off a dense enough surface?
Answer: Let's answer the first part of your question first.  In general, astrophysical objects are limited in the amount they can accrete by the Eddington limit.
What happens is as matter is accreted onto the object (black hole in our case), it heats up due to conversion of gravitational potential energy into kinetic thermal energy. This hot matter emits photons whose total energy per time is called the luminosity of the object.  If this luminosity is high enough (and you should get a higher luminosity for more accreted matter) then the outward pressure of the photons on the matter actually can overcome the gravitational inward pull.  This point (rate of matter accretion) is called the Eddington limit.
To partially answer the second part of your question, if the black hole had non-zero total net electric charge,  then it could certainly bounce off another material of sufficient density.  However if the charge on the black hole was identically zero, there would be no repulsive force to create a bounce.
Comment: In more detail, it is possible for two merging black holes to get a 'kick' from purely gravitational interactions.  [This paper](http://arxiv.org/abs/0707.0135) discusses black hole "superkicks," which are results from simulations where the two merging spinning black holes are oriented in a specific way designed to get the largest 'kick' possible.
Comment: Thankyou, the Edington limit was what I had in mind but could not recall. I'll have a go at calculating some masses and velocities now and see what I end up with. Would I get better bounces with smaller or larger BHs I wonder;-)
Comment: If you are taking the charged BH scenario, then the important quantity would be the ratio of charge, $q$ to BH mass, $M$.  The larger $q/M$ the better the bounce.  In fact you could probably calculate a minimum $q$ necessary to get a good bounce by requiring that the electrostatic repulsion is sufficiently great as to force the BH to turn around before it could get close enough to accrete any matter from what it is bouncing off of.
Answer: Look, there's no limit to the accretion because the blackhole simply starts growing as it accretes more mass. I don't think it can "bounce off" any surface.
Yes, if the gravitational forces are comparable, for example, if it encounters another black-hole, they can get in equilibrium, bounce off each other or simply merge.
This happens in the universe.
Every galaxy is found to have a supermassive black-hole at the center. We have evidence for galaxies merging along with their black-holes. Sometimes the galaxies just tear each other apart from tidal influence and the black-holes simply don't interact.
Although, I have never heard of anything like bouncing or merging happening on garden-variety black-holes. The truth is, we haven't detected any significant sum of black-holes. All we have and are sure of are the black-holes at center of galaxies.
Comment: LIGO's main purpose is to look for mergers of stellar-mass black holes.  It's an expected event, it just hasn't been observed optically.
Comment: @JerrySchirmer Exactly!
Comment: but you can't say that stellar mass black holes are unobserverd.  You have plenty of examples of those, such as things like Cygnus X1.
Comment: @JerrySchirmer Yes, I didn't actually mean unobserved. I didn't use 'unobserved'. We have like millions of galaxies to run simulations and do data analysis, but not such a "significant sum(number)" of black-holes.
Answer: Quantum bounce could make black holes explode
please see this link:
http://www.nature.com/news/quantum-bounce-could-make-black-holes-explode-1.15573

Can a black hole bounce?


Is it possible to obtain a transit visa and board flights with separate PNRs for travel to Italy and return from Vienna via Abu Dhabi?

Question: I have two different PNRs for my flights and I need to travel from India to Italy via Abu Dhabi (Etihad and WizzAir) and return from Vienna to New Delhi via Abu Dhabi (Wizz Air and Etihad). I am wondering if it is possible for me to obtain a transit visa and board my flights given the two separate PNRs?
Answer: Yes, you can apply for such a visa on Ethiad's website
Ethiad states :

This facility is open for Guests visiting the UAE travelling on Etihad Airways and Partner Airlines, and also to Guests with valid tickets issued by any Airlines and fulfilling the eligibility conditions announced from time to time by the UAE Authorities.


should Modernizr file be placed in head?

Question: Should the reference to the Modernizr JavaScript file be in the head of the page? I always try and place all scripts on the bottom of the page and would like to preserve this. And if it needs to be in the head, why?
Answer: If you want Modernizr to download and execute as soon as possible to prevent a FOUC, put it in the
From their installation guide:

Drop the script tags in the  of
  your HTML. For best performance, you
  should have them follow after your
  stylesheet references. The reason we
  recommend placing Modernizr in the
  head is two-fold: the HTML5 Shiv (that
  enables HTML5 elements in IE) must
  execute before the , and if
  you're using any of the CSS classes
  that Modernizr adds, you'll want to
  prevent a FOUC.
Comment: Ha, FOBUC.  +1 just for that!
Comment: It looks like FOBUC (Flash Of Butt-Ugly Content) has fallen out of favor for "FOUC" (Flash of Unstyled Content). Google can't even (or won't) find any reference to it. Bah.
Comment: If you are finding this more recently, Paul Irish's update covers this in a 2014 post here https://github.com/Modernizr/Modernizr/issues/878#issuecomment-41448059
Answer: I would argue no: every script you place in the  will block rendering and further script execution. The only thing Modernizr does which must happen in the  is the integrated html5shiv, which hacks HTML5 tag support into Internet Explorer 8 and earlier.
I was testing this yesterday and found this to be fairly significant – on the site I work on, which is already fairly well optimized, adding that single script to the head delayed my load-time by ~100ms in IE9, which doesn't even benefit from the shiv!
Since around 90% of my traffic comes from browsers which natively support HTML5 and I don't have core CSS which requires the modernizr classes to display correctly on the initial render, I'm using this approach which places the html5shiv into a conditional comment and loads modernizr without the integrated shim:

        …

        …

Comment: My modernizr.custom.min.js excludes the shiv and also was tailored only to check the features which I actually use. Depending on your needs, that might actually be small enough to consider inlining on the page
Comment: I'm having that same issue! by loading modernizr.js and respond.js it slows my page load time significantly. Did you customize your js file to remove the shiv or are you including both?
Comment: thanks chris. Working a pretty big project right now so im going to need the entire suite.. just x out the shiv and include it separately. also trying to get that requireJS to do some work for us
Answer: Paul Irish is now suggesting that for > 75% of sites, there is no benefit to placing Modernizr in the head.

Move Modernizr to the bottom
It has more potential to introduce unexpected situations, however it's much better for the user to just have no scripts up in the head at all.
I bet >75% of sites dont need it in the head. I'd rather change this default and educate the 25% than watch as we slow down all these sites.

https://github.com/h5bp/html5-boilerplate/issues/1605
Answer: How about using IE conditionals in a slightly different way?
What does everyone think of this solution:
Within the  tags:

Before the end of the  tag:

This would result in Modernizr loading in the head for IE8 and below, and it will load before the body for any other browsers.
Open discussion on pros and cons welcome in the comments.
Comment: yep, that's what I thought, it seems obvious. Load custom shim+modernizer (joined for unique request) in head for < IE9 only
Comment: Is there any reason not to do it this way?


How can I reduce noise at ISO 100 in photos taken in the twilight?

Question: I shoot with a Canon EOS Rebel T5 and sometimes see noise even when shooting at ISO 100.  Is this just because there is not enough light in the dark portions of the picture (seen below)?   Is this a function of the image sensor, lens, or both?
Comment: It is a function of your choice of exposure level. Please see   http://photo.stackexchange.com/questions/21653/what-are-the-advantages-and-disadvantages-of-using-auto-iso-on-a-dslr/21654#21654
Comment: Upvoted for the Steel City, the most photogenic of skylines.
Answer: This is a perfect example of "expose to the right" — that is, even though you want the final result to be low key (largely dark), take the initial exposure as bright as you can (without blowing out the brighter part of the sky, reflections, or any more subtle brighter areas). When you expose so that dark areas are really dark — either because you are underexposing or because that area of the scene really is dark — there are fewer photons to count, and so less signal, which means the signal to noise ratio is worse.
Choose a brighter exposure even for the areas you want dark eventually, and then bring down in post. If necessary, you may actually get better results by raising the ISO — see this answer for details. But in this case, since presumably you're using a tripod for your cityscape shot already, you can probably just increase exposure time. If necessarily, you might consider using HDR or exposure blending techniques to get detail in both the shadows and the highlights (although I don't think that will be necessary in this scene).
Comment: Needed to say, one of the big advantages of doing a HDR here is that you actually take an average or several photos during the process, which itself is an significant improvement (stops being significant after some 7-8 photos though).
Comment: *"you may actually get better results by raising the ISO"* - that's only true if you're planning on increasing the exposure in post, not decreasing it as you suggest here.  See [my question](http://photo.stackexchange.com/questions/37837/) about that very post.
Comment: @BlueRaja-DannyPflughoeft If you have the other exposure parameters at their limit already (as wide an aperture as the needed depth of field allows and as long a shutter as practical), and there's still room to increase the ISO without overexposing highlights, I think it's still correct. It'd be _better_ to actually let more light in, but as I say, _if necessary...._
Answer: An alternative to "exposing to the right" proposed by @mattdm could be noise reduction through image stacking:

align images (all images taken with "as identical as possible" intrinsic and extrinsic parameters (view point, focal length, etc.))
stack aligned images as layers in a single image
blend layers using median/average/...
Comment: One of the better tutorials IMO: http://blog.patdavid.net/2013/05/noise-removal-in-photos-with-median_6.html and bases it all on open-source/free software which is good for those of us who don't like/want photoshop.
Comment: Since you're using a Canon, you could install BlackMagic (the CHDK adapted firmware for higher end Canon cameras). If you take several raw photos in succession with the same camera, BlackMagic can average the files you specify.
Comment: Of course, if your scene changes significantly between the first and last photo (such as in a sunrise), it may not work as well, since your last image would be brighter than your first. In that case, you'll have to use multiple cameras, as described in this answer.
Answer: Noise reduction is generally effective in dark areas because there is little detail to retain. Most noise will be chroma (color) noise so it is easy to remove in your RAW processor or with third party noise reduction.
Remember that there is no "correct" sunset exposure. I always bracket widely and choose the best result.


What's the definition of domestic use?

Question: My debate team's topic is about the use of domestic nuclear energy in the United States. I have been running into trouble with people saying that anything domestic needs to physically happen within the United States. I am specifically arguing the use of nuclear energy in space through SpaceX. Any definitions of domestic would be useful.
Comment: @JamesK ok, I'll stop.
Comment: Is SpaceX's use that big that whether to include it or not makes a meaningful difference?
Comment: @Ekadh Please don't do mass edits of "Thanks" from old questions.  I agree that there is no need for questioners to say "thanks" and if you are improving a question for some other purpose then you might remove the "thanks in advance".  But every edit bumps the question to the top of the home page.  Editing just to remove "thanks" from many questions disturbs the site, by putting old questions back on the home page.
Comment: Maybe you shouldn't said any definition since people will pull out the dictionary definitions. This is supposed to be politics stackoverflow not English Language stackoverflow.
Answer: Domestic:

of or pertaining to one's own or a particular country as apart from other countries: domestic trade.
indigenous to or produced or made within one's own country; not foreign; native: domestic goods.

You generally want to focus on nuclear energy produced by the US and used by the US.
You probably don't need to get too hung up on physical borders, so long as the US is the only country involved, than domestic is an appropriate descriptor.
since most words are open to interpretation, you might want to ask a person in charge if it's okay if the energy in question isn't technically within the US psychical border.

What's the definition of domestic use?


mounted summoner

Question: So I'm sure in one of the endless Pathfinder books I read about either and Archetype or Order for the Cavalier, (maybe the Summoner) there was a summoner that used it's eidolon as it's mount. It started out saying that cavaliers did not consider them real cavaliers, and views them as a joke. (This of course is not word for word as i can't find it. )
I am 99.9% sure it was not 3rd party. I am almost completely sure it was in a book not on Paizo.
Does anyone know what I'm talking about, and where to find it? Thanks
Answer: I found it! That was hard. And yep I was wrong 3pp. But at least Ive got it and I'm not going senile.  Had to google "pathfinder cavalier order eidolons" in that exact order to find it:

Order of the Chimera
This order is exclusive, eclectic, and extremely odd, as it is composed solely of summoners who have chosen to adopt the trappings and mannerisms of cavaliers and ride their eidolons into battle as armored knights. […] It is generally treated with disdain by cavaliers of other orders, who see the Order of the Chimera as farcical and insulting, and not a true order[…]
Comment: I stand corrected. I only combed 3pp. Well met. Make sure to mark your answer as complete when it allows you.
Answer: Cavalier has no archetype (Paizo or 3pp) that gives it an Eidolon in place of a mount and their Orders don't affect your mount, and Summoner has no archetype that gives it riding bonuses.
This Reddit thread agrees that the only way to make a cavalier/summoner is multiclassing which causes issues with losing Evolution and spellcasting levels.
This other Reddit thread has some decent suggestions for making a Summoner that rides his Eidolon, which you could RP as a cavalier, just without the Challenge and inherent Ride bonuses.

mounted summoner


Prolog convert integer to bytes

Question: I am using SWI prolog. I would like to write integers into binary file in binary form. I did not found any solution so far and starting to be desperate. Can any body help me with this problem?
Comment: Would this be 32 bit integers? What byte ordering do you expect? For example, do you output 0xFFEEAABB as `0xFF, 0xEE, 0xAA, 0xBB` (most significant byte first) or `0xBB, 0xAA, 0xEE, 0xFF` (least significant byte first)?
Comment: Yes, 32b integers little endian output format.
Answer: It's been a while since I used SWI Prolog.
I couldn't see anything that would write a number in a binary form in the built in libraries, but you could try and write your own.
The following only works on numbers from 0 to 4294967295 inclusive (an unsigned 32-bit int) and will output the number in 4 bytes, least significant byte first.
If you run "test", it will create a 4 byte file called "byte.dat", write the number, then read it again and print it out...
<code>doWrite(FileName, Number) :-
    open(FileName, write, O, [all(true), encoding(octet)]),
    writeInt32(O, Number),
    close(O).

doRead(FileName, Number) :-
    open(FileName, read, I, [all(true), encoding(octet)]),
    readInt32(I, Number),
    close(I).

writeInt32(OS, Number) :-
    B0 is Number /\ 255,
    B1 is (Number >> 8) /\ 255,
    B2 is (Number >> 16) /\ 255,
    B3 is (Number >> 24) /\ 255,
    put_byte(OS, B0),
    put_byte(OS, B1),
    put_byte(OS, B2),
    put_byte(OS, B3).

readInt32(IS, Number) :-
    get_byte(IS, B0),
    get_byte(IS, B1),
    get_byte(IS, B2),
    get_byte(IS, B3),
    Number is B0 + B1<<8 + B2<<16 + B3<<24.

test :-
    doWrite('byte.dat', 3287465),
    doRead('byte.dat', X),
    write(X).
</code>
SWI prolog allows arbitrary length numbers, which is probably why there is no "write number as binary" in the standard libs.
I hope this helps, if anyone knows of a nicer way of doing this, please let us know!
Comment: Thank you very much! I hoped in some hidden built-in fuctionality, but this should work as well :)

Prolog convert integer to bytes


Looking for Benchmark performance of Mac Studio

Question: I'm considering a purchase of a new Mac Studio to replace my current Dell XPS Core I-7 system. Does anyone have a benchmark report for MMA v13 running under Mac OS 12.4? A report for the M1 Ultra configuration would be ideal, but even the M1 Max set-up would be very helpful.
Comment: @DrMrstheMonarch: Which benchmark questions? Please provide links!
Comment: Look at the two benchmark questions, for version 13 and 12.3, iirc there are some max examples there.
Answer: The current Mac Studio has an Apple M1 chip with either:

M1 Max: 10-core CPU (+ 24-core or 32-core GPU) or
M1 Ultra: 20-core CPU (+ 48-core or 64-core GPU)

The 10-core M1 MAX CPU consists of 8 standard cores and 2 efficiency cores. The ULTRA version is basically two Max chips stuck together.
The benchmark report below includes results for the M1 Max chip used in the Mac Studio.
For comparison, I have carried out tests on the new Mac Mini M2 Pro just released, running Mma 13.2:

M2 Pro: 12-core CPU (and 19-core GPU).

The 12-core M2 Pro CPU consists of 8 standard CPU cores and 4 efficiency cores.
Caveat re cores
I should mention, as caveat, that having more and more cores won't necessarily improve the performance of Mathematica on your computer. This is because Wolfram artificially restrict the number of kernels that can run on your computer, depending on the type of license you have.

For a home license, your computer is restricted by Wolfram to using 4 kernels.
For an education license, your computer is restricted by Wolfram to 8 kernels.

I believe it is possible to pay extra money to allow Mathematica to take advantage of further cores on your computer --- but suspect that the uptake of such licensing is very limited, and that most people end up with the standard restrictions. As such, even if you buy the 20-core Mac Studio Ultra, you unfortunately probably won't see any increase in performance from Mathematica than over the 10-core version --- which is disappointing. My personal view is that the deliberate crippling of hardware by a software package is unsavoury and unsatisfactory. In any event, given the proliferation of cores on even entry level computers in recent years, the current Wolfram structure appears outdated. This issue (of the restriction of kernels) has very real relevance to the question being posed by the OP (Ultra vs Max).
Mac Mini M2 Pro
The Mac Mini M2 Pro being tested has 12 cores. Of these, 8 are standard cores and 4 are efficiency cores. I don't know if Mathematica can run a kernel on (or take advantage of) the efficiency cores: my understanding is that the efficiency cores are intended to take care of low level threads in the background, keeping the high performance cores free to do the heavy lifting. In any event, Mathematica restricts my new Mac to 8 kernels anyway, and the new Mac M2 Pro has 8 standard CPU cores.
Since the M2 chip is supposed to be faster than the M1 chip (other things being equal), I would expect that the Mac Mini M2 Pro will produce better Mathematica benchmarks than the Mac Studio (for all the reasons above) -- even if the Studio has 20 cores. A related question is to what extent Mma takes advantage of GPU cores, and to what extent the Benchmark carries out tests that takes advantage of the GPUs.
Mac Mini M2 Pro Benchmark results
Starting from a fresh launch yields a Mma Benchmark of 5.17
in a total time of: 2.7 seconds.
Needs["Benchmarking`"]
Benchmark[]

{"MachineName" -> "mac-mini",
"System" -> "Mac OS X ARM (64-bit)",
"BenchmarkName" -> "WolframMark", "FullVersionNumber" ->
"13.2.0", "Date" -> "February 13, 2023",
"BenchmarkResult" -> 5.167, "TotalTime" -> 2.679,
"Results" -> {{"Data Fitting", 0.138},
{"Digits of Pi", 0.144}, {"Discrete Fourier Transform",
0.222}, {"Eigenvalues of a Matrix", 0.223},
{"Elementary Functions", 0.315}, {"Gamma Function",
0.184}, {"Large Integer Multiplication", 0.157},
{"Matrix Arithmetic", 0.047}, {"Matrix Multiplication",
0.09}, {"Matrix Transpose", 0.079},
{"Numerical Integration", 0.263},
{"Polynomial Expansion", 0.042}, {"Random Number Sort",
0.351}, {"Singular Value Decomposition", 0.268},
{"Solving a Linear System", 0.156}}}
Here is the graphic comparison to other systems:
BenchmarkReport[]

Note that the above graphic includes a 10-core M1 Max which scores 4.5 and which would be presumably almost identical to the M1 Max version of the Mac Studio.
Final comment
A benchmark test that only takes 2 or 3 seconds to evaluate is not a very useful benchmark. It might have been fine 20 years ago ... but it is in need of an update. As others have noted in other threads, running LaunchKernels[] prior to running the benchmark produces much higher benchmark numbers, and much slower speeds, which sounds dubious, so it is not really very clear what the benchmark is testing in that scenario, and also why it is not automatically testing (and distinguishing between) single core AND multicore performance, like almost all other benchmarks do.
Nor is it clear how that benchmark package separates the performance of the machine (which a benchmark is meant to be testing) from the restrictions of the software, when the software may be artificially crippling the hardware on some computers simply because of the user's license type.
Comment: With Mathematica 13.2.1 my MacStudio M1 Ultra (20 cores + 128 GB RAM) returns scores of 4.25  ... and 25.88 after running LaunchKernels[].

Relative to my 8-core 2019 Intel MacBook Pro running SymbolicRegression, the MacStudio is 2.25x faster than the MBP — per Core. I have Enterprise Mathematica running on both machines so I am constrained to 8 cores on the MBP (by Intel) and 16 on the MacStudio (by Wolfram). Effectively, for my application, the MacStudio is 4.5x faster than the MBP since I prefer to run ~30 IndependentEvolutions before drawing conclusions about the modeling results.
Comment: I will vigorously agree that it would be nice if Wolfram adjusted the number of allowed subkernels to reflect the changes in chip technology after such a long period of stagnation.
Answer: I just started looking at Mathematica and have a trial version which is limited to 4 kernels. I'm running it on AMD 3995WX CPU which has 64 cores/128 threads. This however should not matter because Mathematica will only use 4 threads, and this CPU frequency is lower than several others included in the benchmark report. Yet, it beats all those CPUs by substantial margin. Maybe much larger caches help? That would probably only happen if software purposely written to take advantage of this.
Comment: I have a score of 12.3 on my 10 core Macbook Pro M1


Does latest ios version gets updated on all the iphones

Question: I am thinking of learning ios development. I have a noob doubt- right now the latest ios is 13 so my doubt is whether the latest ios gets updated in all the iphones or not?
Basically, I want to learn which ios version centric app development should I learn- I have ios 12 and ios 13 in my mind.
p.s - I don't use iPhone.
Answer:
iOS 11–12 are supported on all iPhones since iPhone 5s (2013)
iOS 13 is supported on all iPhones since iPhone 6s (2015)

Generally support is for n-1 from the latest major release of iOS. If you support iOS 12, you'll include every device since iPhone 5s. It's assumed people will be running the latest or n-1 version of iOS on their device.
Answer: Disclaimer: I have never written any app in Swift.

.. whether the latest ios gets updated in all the iphones or not?..

It's upto the users to decide whether to update or not. As per this The Verge article, 50% of iOS users were using iOS 13 within three weeks of release. So clearly, many are using older versions either by choice, or due to  hardware incompatibility.

.. which ios version centric app development should I learn ..

That might push the question a bit towards being primarily opinions based. Yes iOS 13 brought in a lot of new capabilities like

... build unparalleled augmented reality experiences with ARKit 3, Reality Composer, and RealityKit.

But being a beginner, I doubt that you should worry about that. You might want to keep track of Swift's release cycles.
https://docs.swift.org/swift-book/index.html


When to take the other body as point mass or apply parallel axis theorem on it?

Question: What is the range of $r$ in the formula for the parallel axes theorem? Eg. if two discs are attached at a certain point on their circumference and both are in a plane, what is the moment of inertia of the system about the axis of one of the discs, so should I consider the other disc as a point mass located at $2R$ or apply parallel axes on it. In many such questions, they take the other body as a point mass and in some cases, they apply parallel axis theorem on it.
Comment: Use the distance between the two centers of mass projected on the direction perpendicular to this axis of rotation.
Answer: The Parallel Axis Theorem does not have a range. It applies regardless of how far an object is from the axis of rotation.
However, as the distance $r$ from the axis of rotation increases, treating the distant object as a point particle becomes a better and better approximation. Whether you decide to use the Parallel Axes Theorem or treat the distant object as a point particle depends on what level of accuracy you want to obtain.
Suppose the moment of inertia through the centre of mass is $I_0=Mk^2$ where $k$ is the radius of gyration, which is on the same order of magnitude as the width/breadth/length $d$ of the object. Then the moment of inertia about a parallel axis at distance $r$ is
$$I=I_0+Mr^2=M(k^2+r^2)$$
If $r \gg d \approx k$ then $I \approx Mr^2$ which is the moment of inertia of a point particle. The fractional level of accuracy you can expect from using the approximation is about $(\frac{d}{r})^2$. So if $r \approx 10d$ then the approximation will be accurate to about 1%.
Answer: If the point at which you want to measure angular momentum or consider mass moment of inertia, is not at the center of mass, you need to consider the parallel axis theorem.
Most generally, to measure the mass moment of inertia at a point A not at the center of mass C in 3D to the following
$$ \mathrm{I}_A = \mathrm{I}_C + m
\begin{vmatrix}
  y^2+z^2 & -x y  & - x z \\
  - x y & x^2+z^2 & - y z \\
  - x z & - y z & x^2+y^2 \end{vmatrix} $$

In shorthand notation the above is
$$ \mathrm{I}_A = \mathrm{I}_C - m [\mathbf{r}\times] [\mathbf{r} \times] $$
where $[\mathbf{r}\times] = \pmatrix{0 & -z & y\\z & 0 & -x\\ -y&x&0}$ is the 3×3 skew symmetric cross product matrix.
The same notation is used for the general rotation matrix about an axis $\mathbf{z}$
$$\mathrm{R} = 1 + \sin \theta [\mathbf{z}\times] + (1-\cos \theta) [\mathbf{z}\times] [\mathbf{z}\times] $$
Answer: To find the rotational inertia of a solid object which will rotate about a new parallel axis which does not pass through the center of mass, first treat the object as a point mass at the CM which will resist being accelerated about the new axis, and then remember that the object will still resist acceleration about the old axis through the center of mass. (Both axes see the same angular acceleration.)


Can I use my Pasmo and/or Suica from Tokyo when traveling Fukuoka?

Question: I have a couple of Pasmo and Suica stored-value travel smartcards purchased in Tokyo several years ago kicking around.  Can I use these on an upcoming trip to Fukuoka?
Answer: Yes, you can.  On March 23, 2013, the ten largest transit smartcards in Japan became fully(*) compatible, and this includes Pasmo, Suica and all three systems used in and around Fukuoka: Sugoca (JR Kyushu), Nimoca (Nishitetsu) and Hayakaken (Fukuoka City Subway).

(diagram courtesy of JR East)
(*) For tickets, anyway, electronic money is a little more complicated, and there's a long tail of non-top-ten cards that are only partly compatible.  See this diagram with oh-so-many arrows on Wikipedia for the gruesome details.
Comment: Complicating the issue further is that some other cards are compatible with only some of the ten cards above. The most prominent example is the Paspy card, which is used by virtually all non-JR trasport operators in Hiroshima prefecture, and is compatible with Icoca only. (There are also some minor lines in and around Tokyo which accept Suica and Pasmo only.)
Comment: There's also a "expiration" of sorts, if the card is not used for five(?) years then the stored value is nullified.


Useful college minor for an aspiring UX Designer?

Question: So, currently, I planned on minoring in just general Business (don't exactly know why I did that...). I know what kind of degree you have doesn't matter as much as experience does in UX but, for someone who wants to go into the UX field, what do you think would be a useful minor to have? I am probably going to stick with something that involves business because I have already taken a few business courses and don't want them to be a waste. So, saying that, are there any business-y minors that could be useful to UX Designers as well?
Comment: What's your major? In the end, if you're specifically wanting to get into UX, then you likely want to pursue a degree program with some direct bearing on that.
Comment: I'm majoring in Informatics(which is basically all about applying technology to solve problems) with a focus on Human Centered Computing. So, I've been taking like HCI and Interaction Design classes.
Answer: Marketing is actually really similar to UX and if they have a lot of group work that might be helpful. Management might be another useful one for the communication aspects.
Personally, I wouldn't bother with the minor at all, ESPECIALLY if you can graduate faster. Just take courses that are useful. Such as:
Design courses
Sketching courses
Public speaking/presenting courses
Programing courses
Comment: Marketing is often diametrically opposed to UX. :)
Comment: I thought about Marketing but, after thinking about it more, I don't think I am going to bother with a minor. I'm trying to graduate as fast as possible haha. Like you said, I decided I'm just going to take courses I think are useful. Like a couple Graphic Design and Digital Art classes.


Time given to fix the problem

Question: In a biblical passage I am studying, I noticed that the accused was given a short span of time in order to fix the problem he had caused.  This idea (granting time to correct the situation) is important for my study and I want to include it in the index.  Is there a word (or short two word phrase) that has this meaning?
Comment: Although I don't interpret the passage ("2 And he called him and said to him, 'What is this that I hear about you? Turn in the account of your management, for you can no longer be manager.' 3 And the manager said to himself, 'What shall I do, since my master is taking the management away from me?") as offering the manager a respite or grace period, I'll answer below as if it does.
Comment: What book & verse?
Comment: Luke 16:1-12 The Parable of the Unjust Steward.
Comment: Perhaps "given a time span" isn't a good description of what happened in the parable.  I'm studying accountability as it relates to parenting.  In the KJV that I was reading, the end of verse 2 reads, "for thou mayest no longer..."  which, on my first reading sounded like the consequences were not definite yet.  So, when the manager attempts to fix the problem, the employer says he did well.  That's where the idea of a grace period (again, think 'parenting') came from.  Giving children time to correct the problem.
Answer: You might want to try grace period, which, since you are talking about a bible passage, would have a nice double entendre.
Comment: Absolutely. If you Google **car tax grace period** you'll find a vast number of entries relating to the popular misconception that DVLA (UK Driver and Vehicle Licensing Agency) allows you to keep your car on the road for up to 14 days after the tax disc has expired. I never heard of *remedial period*, which NGramp indicates is [exceptionally rare by comparison](http://books.google.com/ngrams/graph?content=remedial+period%2Cgrace+period&year_start=1900&year_end=2000&corpus=0&smoothing=3)
Answer: I believe this is legally referred to as a remedial period.
An example of this usage can be found in this recent amendment to the Americans with Disabilities Act.
Comment: Thanks!  I wasn't aware of this legal phrase.  I selected the other answer simply because it seemed to fit with the biblical context a little better.
Answer: notice
A person may be put on notice, for a definite or indefinite period, generally implying the consequences of not complying with and probably also the salutary effect of compliance.
A delinquent employee is put on notice that if does not rectify the situation, action would automatically follow. The notice period may form part of the notice, the completion of which without the condition being fulfilled satisfactorily would trigger consequential action.
Answer: Why not the word "Deadline"? That also refers to time limit given for completion of a task right?
deadline [ˈdɛdˌlaɪn]
n
a time limit for any activity
Answer: Consider hang time, "how long something stays in the air" to describe the brief interval between when a manager is fired and actually escorted off the premises.  One meaning noted in Wikipedia is "In some first-person shooters, the length of time a player flies through the air as the result of a grenade jump".
Also see delay synonyms, which include deferment, moratorium, postponement, reprieve, stay, and some of their synonyms in turn, like suspension, with useful synonyms in turn like hiatus, abeyance, and more.

Time given to fix the problem


Adding Asp.net mvc to existing web app how to get scaffold options

Question: I followed the guidance in the Professional Asp.net 1.0 Wrox book for adding the MVC references to an exisiting web application and it works well except for the scaffolding options. When i right click a controller i do not get the scaffold view options that you get in a new asp.net mvc app. I am sure there is a .csproj hack that is needed to get the scaffold options but i can't find any references anywhere. Has anyone else run into this and found a solution?
Answer: Well google to the rescue. I found an answer at the following blog: http://wildermuth.com/Tag/ASP.NET+MVC
You need to edit the .csproj file and add to ProjectTypeGuids {603c0e0b-db56-11dc-be95-000d561079b0}. Order seems to matter. Originally i added to the end of the guid list and the project would not load and threw an unsupported error. I created an empty mvc site and looked at the guids and the guid above was listed 1st. So i added it to the beginning and everything worked fine.
Comment: I added it at the end, no luck, added it at the front like you said, it worked. Thanks!
Answer: Have you looked at how you register the data context in you Global.asax file?
This link may have more details that can help:
http://msdn.microsoft.com/en-us/library/system.web.dynamicdata.metamodel.registercontext.aspx
and this:
http://msdn.microsoft.com/en-us/library/system.web.dynamicdata.metamodel.aspx


Apache Directory Server: how to backup/restore data?

Question: I have an LDAP server running using Apache Directory Server 1.5.7. How do I backup & restore the data?
Comment: I'm not familiar with Apache DS, but same to LDAP, you can export to a `ldif` file and copy to backup server.
Answer: Apache Directory Server doesn't appear (from the currently incomplete documentation) to have any integrated backup and restore mechanism.
In this scenario you could do a couple of things:

Stop the LDAP server before backing up its files, then restarting. This involves downtime though.
Take a snapshot of the filesystem and backup the snapshot. Obviously this depends upon what filesystem is in use. It also depends upon ADS being able to recover when starting with files that were in use at the time of the backup.


Book of Appalachian horror short stories, including one about a man covered in snakes, and another about a man eaten by possums

Question: I remember reading this in late '70s early '80s. The stories included one about a man covered in snakes, and another about possums that ate a man buried in a shallow grave, causing his relatives to find something to eat beside possums.
Answer: Tales of Terror by Ida Chittum
There's some photos here, including one page with an illustration of a lot of possums: http://the-haunted-closet.blogspot.com/2008/11/tales-of-terror-1975-ida-chittum.html
And someone else looking for the book on Loganberry Books with this description:

Cannot remember title, publisher, date for ghost story collection read
in elementary school circa 1984-1988 that had a story about a family
eating possum and discovers possums have eaten uncle ned's corpse and
possibly story about a man on snipe hunt falls into river and snakes
engulf him. May have been a child's recollection about picking rocks
every year so the father can plow. It had a folklorish nature, maybe
mountain folk. May have had a story about disembodied voices from a
hole in ground or abandoned mineshaft. I think book was about 8"x10"
and about an inch thick, was illustrated.
Comment: Also suggested as an answer here:  https://scifi.stackexchange.com/questions/78694/70s-scary-stories-youth-anthology-very-eerie-black-and-white-drawings-a-ghost
Comment: a voice from a hole in the ground? If it was a welsh mine, that might be The Call of the Grave by Billy Ball, found in the anthology Monster Tales: Vampires, Werewolves & Things edited by Roger Elwood. https://www.goodreads.com/en/book/show/600028.Monster_Tales


How to get bind a (WPF or Infragistics) DataGrid to a List> or List?

Question: I need to bind a collection of strings inside a collection of strings to a DataGrid (Infragistics).
However, when I bind it like this:
<DataPresenter:XamDataGrid x:Name="xamDataGrid" DataSource="{Binding TheCollection}">

to either this:
public List<string[]> TheCollection

or this:
public List<List<string>> TheCollection

I get this:

What kind of .NET types do I need to use so that it displays this collection within a collection as a grid, i.e. like this:
bank11  1111111
bank12  2222222

I can't use custom objects since this is being used by a module that can't have any references to other modules and has to accept simple .NET types.
Answer: I think you want to use a Dictionary<String,String>.


can the raspberry pi 2 automaticly setup crossover ethernet connections?

Question: can the raspberry pi 2 automatically setup crossover Ethernet connections?
I have a webserver with a networked web camera. The camera is behind a router, and the server is on the raspberry pi. I would like to move the camera into my car, and directly attach the camera to the raspberry pi via an Ethernet cable.
But I only have patch cables on hand. Cant the raspberry pi handle that type of connection, and set it up to cross over, and work properly, automatically?
Answer: Although the Pi is capable of utilizing any cable as a cross over cable and will automatically detect this. The Pi is not capillary of assigning itself an IP address so unless your camera has a built in DNS server,which is highly unlikely. You are going to have to first set up a static ip address for the Pi using a monitor and keyboard. Or by connecting the Pi to the A working internet connection then setting up your static ip to be initialized on the next boot.
Answer: The other answer for setting things up is totally fine.
I just want to add that you don't need a crossover ethernet cable for that, as the raspberry pi and probably most of the recent computers NIC's support Auto-MDIX. So you can just use a normal ethernet cable as long as the other device also supports it.
after setting an ip adress on your pi and your device they should be able to communicate with each other.


Your balance: . lumens

Question: Can someone tell me why my balance just says .lumens?
Answer: I have the same.
Update: Found the answer on a redit page: https://www.reddit.com/r/Stellar/comments/f47o07/ledger_nano_and_account_viewer_doesnt_show_balance/
The latest ledger update is to blame, they are working on it. Check your balance on the Stellar blockchain explorer : https://stellar.expert/explorer/public/
using your public key in the search at the top right.

Your balance: . lumens


Disabling Railcraft features

Question: Is there a way to disable certain features provided by Railcraft? For example, I do not want to be able to get more rails for the same amount of resources, since I want to keep the values as much vanilla as possible.
Answer: Forge does not provide any way to disable part of a mod. You can only enable or disable a mod that way. Your best option is to edit the source code of the mod which will therefore require knowledge in Java. There are many tutorials for coding minecraft mods on youtube and other places, which will at least point you in the right direction.

Disabling Railcraft features


Lighting Sabbath Candles as "Pharisee Propaganda"

Question: Does anyone know of any sources that say that the reason that we light the Shabbos candles is to show that we do use light for Shabbos, as opposed to the Karaites that do not?
Answer: To the best of my knowledge the primary opposition to having pre-lit candles in your home on Sabbath didn't come until the Karaites, hundreds of years after the "Pharisees." (Well the Pharisees had to deal with Zoroastrians who would ban any fire outside of their temples on certain days, but that's an entirely different issue.) I'm inclined to believethat when the folks who brought you the Talmud said the reason for candles was to increase the honor of the day, and make for more harmonious interactions within families (people aren't tripping over each other in the dark), that those are the primary reasons. But it's possible that the mainstream rabbis in the time of the Karaites, i.e. the Gaonim, did further stress the practice to highlight the difference.
I know Chief Rabbi Sacks points out that "Bameh Madlikin" appears in our siddur (prayers) Friday night as a way of emphasizing our belief that flames can stay kindled. (I saw this in his introduction to his British siddur; it's probably in the Koren-Sacks as well.)
I've since heard it observed that the Talmud makes no mention of a blessing on the candles, only that you have to have them lit. The blessing making it clear this is an obligation appears to have been developed by the Gaonim; it's suggested that one rationale in doing so was to stress against Karaite practice.
Answer: That's one reason given as to why we eat cholent (which stays on the fire - or nowadays, more likely, in the crockpot - through most of Shabbos). I don't believe I've ever heard of this as a reason for Shabbos candles.
Comment: Right; the hot-food-on-Shabbos (could be as simple as a hot water pot, no?) to counter the Karaites; that concept is attributed to ... I want to say Rav Saadiah Gaon?  Is that right, Alex?
Comment: Possible, but I don't know the source, or whether it predates him.
Comment: baal hamaor. see here:
http://revach.net/article.php?id=2906

though chamin, not chulent. only in modern hebrew is chamin=chulent, though some have made this silly mistake. see here:
http://parsha.blogspot.com/2008/10/interesting-posts-and-articles-88.html

point 4, about one such case.
Comment: @joshwaxman that cholent/B"T/Giyur story is horrifying. Have you heard whether or not there was more to the story?