Should the Nissan Skyline 350GT 2007 Sport seatbelt warning light come on for the passenger?

Question: I have a Nissan Skyline 350GT 2007 Sport and wanted to know if the front passenger is not wearing a seatbelt should the warning light come on? At the moment it only comes on when the driver is not wearing a seatbelt. Or maybe it's a problem with my sensors?
Comment: Without knowing anything about that particular car, I'd say "yes" -- that's how the warning light is intended to operate, if your car has one.
Comment: Yeah . I guess so but its only show me warning light when driver not wearing seatbelt. Or its a problem with my sensors ?
Comment: 1. If there's a separate indicator for the passenger, it might be blown. 2. Is the passenger small and not tripping the weight sensor?  3. What does the manual say?
Answer: Most seat belts are "checked" via two sensors: one in the seat (to check for pressure ... usually around 60-80lbs to activate); one in the click mechanism for the seat belt (to see if it's engaged). I'd suggest one or both of these sensors are bad. If the seat sensor never closes, it doesn't worry about whether the seat belt is buckled. If it closes correctly, but the buckle sensor is closed all the time, it would think the seat belt is being properly engaged.
You could try testing these by disconnecting the wiring. Jumping the two wires in the seat would show as though it is closed. Same with the buckle sensor. You could also run a continuity check on both to see if they are working correctly.


Will my airlock problem ruin my wine?

Question: I'm brewing a Barolo wine which is now stabilizing in a carboy with a bubble airlock fitted, the water from the airlock is being drawn into the carboy. Is this normal ? If not how can I stop this ? Will this ruin my brew ?
Answer: It's not ideal, but it's probably not a huge problem, either. It's highly unlikely to ruin your brew.
It's most likely happening because the wine in the carboy is cooling, thus reducing pressure inside the carboy, literally sucking the liquid from the airlock like a straw.  Did you put the liquid into the carboy hot or warm?  What's the ambient temperature in the environment now?
You can stop the problem by using foil over the mouth of the carboy until the temperature stabilizes, then switch to an airlock. Or, just repeatedly (every couple of hours) remove the airlock to allow pressure to equalize, then replace it.
Comment: You can also fill the airlock with vodka or StarSan to reduce the chance of infection.
Answer: Personally the chances of it ruining your batch is pretty low, but one never wants to risk the off chance that it may result in an infection.
It is from a similar previous experience that I (like many) use cheap vodka for my airlocks since it makes sure things stay clean in the airlock and if some of it seeps back into the fermenter it will not impact the flavor of the brew.
Some people use left over sanitizer, but I avoid this since I have never gotten a definite answer from someone on how long one can use a batch of sanitizer.
Also some people reckon that for primary fermentation (of wine) you don't even need to  use an airlock. You can cover the mouth of the carboy with a coffee filter and elastic. The thinking is that you want to maximize the exposure to oxygen during primary to help the yeast. Once you  transfer to your secondary that is when the exposure to oxygen really becomes important and that is where the airlocks come in.
But I am too paranoid to try this, so I use airlocks throughout and just make sure that the batch is properly aerated when going into the primary.

Will my airlock problem ruin my wine?


ASRock A320M Pro4 failing to POST with Ryzen 5 3600 CPU

Question: Posting a question & answer to share my hardships (and solution) with the internet. I hope others in this situation see this post and are able to save hours of their life on needless POST diagnostics.
ASRock currently documents on their A320M Pro4 web page that the MOBO is compatible with Ryzen 5 3600 CPU with P5.90 BIOS version. THIS IS INCORRECT (or, at least, is incorrect for the latest off-the-shelf Ryzen 5 3600 CPUs). You must use BIOS version P6.00.
That is all.
Answer: Use BIOS version P6.00 (ASRock documentation is incorrect)


How to use blender on Android

Question: I want to develop a small game in Android. But for this I need to get animation into my Android project. Can I use blender to create animations and then port it into Android. If not then what other software can I use to create animation on Android. Are there any tutorials for this on the net.
Answer: With blender you can export your mesh/animation to a number of file formats. Your Android application must now be able to read the file format you have exported the animation with. A common file format blender is capable of to export is .obj. This article describes the implementation of an .obj file loader.
This is an excellent example for an mesh loader.
Here you can find some other links.
HTH
Answer: You can play with blender animations in Unity3D which runs on Android
Answer: I wanted to do the same : animate in blender and be able to do a 3D app for Android.
I ended up choosing Unity3D which is really great : you build your animation in Blender and you export it to Unity. Then in Unity you can code your application and export a .apk :)
Cheers,
bRo

How to use blender on Android


Will having different names in my passport versus academic diploma be a problem when applying for a Schengen tourist visa?

Question: There's a surname written in my passport, but none in my academic diploma. Will this be a problem while applying for a Schengen tourist visa? Which documents should i submit for my tourist visa?
Comment: Info needed: Is it common for your country to omit surnames in diplomas? If so, the people handling visa applications are likely familiar with that.
Answer: The country where you applying for Schengen visa should provide you all the tourist visa application requirements and check list. You could gathered all information either from embassy/ consulate or through  VFS (visa facilitation service) at your home country. As far as my previous experience with Schengen countries, there is no degree requirement for tourist visas. Therefore surname in degree not a matter.
Answer: For a tourist visa, you have to establish that you plan to go back after the visit. Your degree matters only to show that you have a stable and well-paying job at home. If the bank statement and the employment contract look good, the degree should be no problem.


Deleted my stock phone application from android phone after rooting as a result can't call for now

Question: I recently rooted my HTC desire 728 and by mistake deleted the stock phone app and as a result, now I can't make calls ... the phone is not showing any sim signals too and when I go to sim settings it shows  process.com.android.phone stopped  ... what can I do now? I had factory reset the phone already a couple of times but the after root deleted apps are not showing up ... please help me out
Answer: It seems you have taken no backup, which implies that you have to flash the stock firmware. Since you have rooted your phone, I believe you already have a custom recovery like TWRP installed (if not, go ahead and flash one. Search google for the exact instructions for your phone). Then search Google for the stock firmware, and you should be able to find a version of the stock ROM. Download and move this to the phone storage, and flash it with the custom recovery. You might have to clear all internal storage data and/or Dalvik cache and system partitions before/after the flash. Check Google and XDA Developers for the exact instructions.
Note that this will delete all the data of your internal storage, so make sure to take a backup before proceeding. You will lose root access as well, and the custom recovery might be overwritten with the stock recovery.


The Fish-Tetrapod Transition, evolution of the "elbow" in Stem Tetrapods

Question: The Acanthostega and Tulerpeton limbs seem to form "elbows" in an axis perpendicular to the flexor and extensor plane of the fin. They seem to "flex" their "elbow" forwards, pre-axially. And, I assume, keep it permanently "flexed", a bit as if their humerus, ulna, and radius has been one single "V-shaped" bone. This adaptation positions the primordial hand forwards. Is this pretty much correct? Why I wonder, I always understood elbows as bending in the flexor/extensor plane, but in the first terrestrial life it seems to be in the pre-axial/post-axial plane. That probably has implications for how limbs continued to evolve, and for the embryogenesis of limbs in mammals like humans. I found that interesting.
Comment: keep in mind the orientation of limbs has changes between early terrestrial life and yourself. A salamanders forelimb bends very differently than yours. Consider you are looking at a 2D representation of a 3D structure. Also what makes you think those early limbs could not flex in the flexor/extensor plane?
Comment: Link to get you started. https://www.geol.umd.edu/~jmerck/geol431/lectures/d05limbs.html
Comment: Try reddit/ask paleontology or something. That question confused me. Simply put "it looks like these species had limbs at a fixed angle, is that correct?" Not really! You'd have to find cartilage wear marks and round joint zones on the bone to figure that out, and the litterature barely gives much info on the biomechanics of the forelimbs.
Answer: The current research doesn't venture many details on the elbows/radius/ulna and locomotion biomechanics.
For the moment they just say the elbow was "slightly flexible" and that the bones were transitioning towards a round shape.
You can research deep into the resources and will perhaps find more.
Here are a resource which give context, found via "locomotor performance in stem tetrapods"
https://www.researchgate.net/publication/236460049_Historical_Perspectives_on_the_Evolution_of_Tetrapodomorph_Movement
There's also a 3D study of the legs here: https://www.researchgate.net/publication/227857349_Three-dimensional_limb_joint_mobility_in_the_early_tetrapod_Ichthyostega
https://sandykawano.weebly.com/locomotor-biomechanics-for-moving-onto-land.html


Why does it say I've earned "Comment Anywhere" when I don't yet have 50 rep points?

Question: So I only have 45 rep points but it says that I've earned the "Comment Everywhere" privilege. But under my account it says I need 50 rep points for commenting. Is there a glitch or something I'm not understanding?
Comment: Could you provide a link and/or screenshot of where it says that you have that privilege?
Answer: You probably briefly earned this and then lost it—but the notification message was not removed from your inbox. Votes do get locked in so that people don't just randomly change their votes, but there is a grace period in the first few minutes after voting that allows you to un-vote or reverse your vote if you clicked on the wrong button.
I suspect somebody up-voted one of your posts (giving you +10 if it was an answer or +5 if it was a question) then thought better of it and un-voted before that grace period was up.
In any event I'm sure you'll be over the threshold soon enough.
Comment: @Joseph A downvote would show in your profile, bot a given the rescinded upvote as I suggest would not leave a trace.
Comment: @Joseph Even with 1 rep you can comment under your own posts and under answers to questions you asked. The comment anywhere privilege allows you to comment in _other_ places.
Comment: Would that down vote show in my profile to confirm that idea?
Comment: Now that I think of it, this can't be right because I am commenting right now on your post with only 45 Rep points.


Find language and regular expression

Question: I don't know how to find the Language and the regular expression for each one.
there are any special method for those kind of question?
Comment: What have you tried? There is an algorithm that translates an NFA to a regular expression, but the automata here are quite simple. Try first to figure out the languages by trying different inputs, and then proceed by building expressions for them. Considering the components of the automata could be helpful.
Comment: right one  0(1+0)*0* and left one  0(10*10*)*0*
Comment: I don't see why you keep vandalizing your own posts. By posting on the Stack Exchange (SE) network, you've granted a non-revocable right for SE to distribute that content, and any vandalism will be reverted. You should already know that...
Answer: Here are the first few words accepted by the DFA on the right:
$$
0 \\
00 \\
000,010 \\
0000,0010,0100,0110 \\
00000,00010,00100,00110,01000,01010,01100,01110
$$
The DFA on the left accepts a subset of these words. Here are the words it does not accept:
$$
010 \\
0010,0100 \\
00010,00100,01000,01110
$$
Perhaps you can use these lists to obtain a guess on the languages accepted by the DFAs. You can then try to see how the structure of the DFA corresponds to the language it accepts. For example, what do the states $D$ and $q_3$ signify? How do you reach them? How do you get to the accepting states $B$ and $q_1$?
Comment: thank u ,tell me what u think.
the left one 0(10*10*)*0
the right one 0(1+0)*0
Comment: What about the word $000$?
Comment: so should i fix
right one to 0(1+0)*0*
and left one to 0(10*10*)*0*
Comment: The right one now accepts $01$. Previously, it did not accept $0$. The left one still doesn't accept the word $00110$, but it does accept the word $011$.
Answer: You almost got it Right in the comments, so I will give you the last push along with one way to think about it.

In the right automaton: the language of the automaton is simply $0\cdot L(q_1)$, where $L(q_1)$ is the set of words that can be accepted from $q_1$. Its not hard to see that a word $w$ is accepted from $q_1$ iff it $w$ is the empty word $\epsilon$, or $w$ ends with 0 (indeed, consider the component of the states $\{q_1, q_2\}$, reading 0 always leads to $q_1$, and reading $1$ always leads to $q_2$). Thus, $L(q_1) = \{ w: \text{ $w= \epsilon$ or $w$ ends with 0}\}$, and therefore the language of the automaton is given by the regex $0\cdot [\epsilon + (0+1)^* \cdot 0]$. The regex that you suggested is almost correct: it does not care about whether the word has to end with 0

In the left automaton: the language is simply $0\cdot L(B)$, where $L(B)$ is the set of words that can be accepted from $B$. Since $B$ is the only accepting state, a word is accepted from $B$ if its run from $B$ ends also in $B$. To get from $B$ to $B$, you have to read a word that contains only 0s, or to read a word of the form $( u\cdot u \cdot 0^*)^*$, where $u$ is a word that has exactly one letter that equals 1 and $u$ ends with 1. Indeed, you get to $C$ upon reading $u$ from $B$. Also you get to $A$ upon reading $u$ from $C$, and once you're in $A$, you have to read 0s to move back to $B$ and stay there.
So $L(B)$ is given by the regex $r = 0^* + ( 0^*1\cdot 0^*1\cdot 0^*)^*$. Hence, the regex of the automaton is given by $0\cdot r = 0 \cdot [0^* + ( 0^*1\cdot 0^*1\cdot 0^*)^*]$. Note that maybe one can suggest a simpler regex (I leave that to you), yet this one goes well with the above explanation. Also, your regex assumes that when we move to $B$ for the first time, we have to see immediately 1. Finally, note that $L(B)$ is actually the set of words $w$ such that $\#_1(w)$ is a multiple of two, and 0 appears immediately after every 2nd 1.
Comment: thank you very much !
what about 0 in the right automata?
Comment: can i get zero from 0(0+1)*0
in seems like the minimum is 00
maybe 0(0+1)*(0+epsilon) will be good?
Comment: You're right, $L(q_1)$ contains also the empty word, edited the answer.
Comment: thank you very much

Find language and regular expression


Final Line of a Text File is Printed Twice

Question: Assume FILE_NAME is a global constant,
If I have the following code
FILE *file;
file = fopen(FILE_NAME, "r");
char string[30];
do
{
    fgets(string, 30, file);
    printf("%s", string);
}
while ( !feof(file) );

It prints all the lines in the txt file but the last one is printed twice. How do I prevent it from printing twice?
Comment: [Why is "while ( !feof (file) )" always wrong?](https://stackoverflow.com/questions/5431941/why-is-while-feof-file-always-wrong)
Answer: You need to change your loop to:
while ( fgets(string, 30, file) != NULL ) {
    printf("%s", string);
}

fgets() will fail and return NULL before feof(file) becomes true, and it won't update string. So right now you're successfully calling fgets() on the last line, printing it, unsuccessfully calling fgets(), printing the last line again, then terminating your loop.
The key thing to understand here is that you only know you're at the end of the file when you've tried to read from it and your read has failed. Until then, someone might have appended data to the end of the file since the last time you read it, for all you know, for example.


Magento 2 : How to Merge Payment and Shipping Method steps in Checkout

Question: Give me useful suggestion, How to merge payment and shipping method steps in checkout.
Comment: Why you don't use  one step extension?
Answer: For starters:

Create a new checkout step and for the sake of compatibility, upgradability and easy maintenance, do not edit the default Magento code, add your customizations in a separate module.
Customize the view of the new step, show the required checkout ui components.
Change the checkout flow.
Etc.

This is no small task, start by reading here:
https://devdocs.magento.com/guides/v2.2/howdoi/checkout/checkout_new_step.html
https://devdocs.magento.com/guides/v2.2/howdoi/checkout/checkout_customize.html
If you need a good example of modifying the checkout:
https://github.com/danslo/CleanCheckout
and the demo: https://demo.cleancheckout.com/
Answer: You can try any One step checkout for that below I have provided some links with paid and free extensions.
Onestep Checkout: https://www.onestepcheckout.com/magento-2/
Amasty: https://amasty.com/one-step-checkout-for-magento-2.html
Mageplaza: https://www.mageplaza.com/magento-2-one-step-checkout-extension/#section-pricing
Aheadworks: https://ecommerce.aheadworks.com/magento-2-extensions/one-step-checkout/
Mageplug: http://mageplug.net/magento-2-one-step-checkout/
Coder: https://landofcoder.com/magento-2-one-step-checkout.html
Bsscommerce: https://bsscommerce.com/magento-2-one-step-checkout.html
Iwdagency: https://www.iwdagency.com/extensions/one-step-page-checkout.html (thay have free also)


Getting translations programmatically from non-default language

Question: Scenario: I have the original string: "Perro", which has its translations: EN => "Dog", FR => "Chien".
Mission: In my custom module, I have the string "Chien" and I need to get its English translation, "Dog".
Answer: This will work for a node that has a field_animal with translation (in Drupal 8).
First we found the french translation then we compare with the string, second we fetch the english translation.
<code>$myString = 'Chien';
$translation = \Drupal::service('entity.repository')->getTranslationFromContext($node, 'fr');
$animalFr = $translation->get('field_animal')->value;
if ($myString == $animalFr){
  $translation = \Drupal::service('entity.repository')->getTranslationFromContext($node, 'en');
  $animalEn = $translation->get('field_animal')->value;
}
</code>
Comment: This answer is valid if the string is the only content of an entity field. It doesn't work when the field contains *Chien fidèle*, for example, or when the string is not contained in an entity field. The question doesn't say where in the custom module the string is stored. (This is not the answer's fault.)


What is the pattern behind respond_to / respond_with in Rails?

Question: Is there a specific name to this? For me it looks like a view router, or a presenter router (I would name it like that) but maybe there is a better name and explication.
Answer: You might get away with calling this a strategy pattern or a collection of template methods.
But don't try too hard to assign names to how ruby is used.  In ruby you can add and modify classes and individual objects, throw around code blocks etc., with such ease that the standard design patterns seem less pertinent after a while.
Comment: If it doesn't have a specific name, then I'll stick with Strategy. If we take Strategy and Bridge, they are actually the same pattern, except that a Strategy objectifies an algorithm, a behaviour, while Bridge is for specifying object structure. Maybe this thing will get a name if it gets more popular.

I think that it doesn't depend much on what tools the programming language provides. The design patterns seem more about a concept than of the actual implementation. So if you implement the Strategy pattern with modules or Roles with extending objects, it is still going to be the given pattern


Passing inputs from one column to the Other within a post

Question: I have a post with 2 column layout.  The first column has an mp3 player.  I am thinking of adding a Lyrics window in the second column.  Based on the song selected by the user, the Lyrics window will display the Song Lyrics.  (without refreshing the whole page).
Is this possible in a self-hosted wordpress site?  Thanks for helping.
Comment: The mp3 player is actually a plugin.  That's the reason for keeping the Lyrics window in a separate column.  I guess it would be more complex to modify the plugin to achieve the result in a single column.
Comment: Which plugin you are using ?
Comment: I am using HTML5 jQuery Audio Player.
http://wordpress.org/extend/plugins/html5-jquery-audio-player/
Answer: You can use jquery to accomplish this or javascript, without looking at your code I would hazard a guess at what is required, this might take some effort.
Some things you will need to think about include how you are going to retrieve the lyrics, i.e. are you going to get the information from another site, store the lyrics within your own database or maybe a site has an api which will allow you to get the information.
The following process will most likely be initiated by the user clicking a song or clicking the next button, or choosing a song from a drop down menu depending on your setup. From the Demo page for this plugin it seems more like clicking a song or the next button.
In short you will need to get the text from the div with a class called title (from the music player html output) using jquery or javascript to capture the value.
You will need to use the jquery ajax methods to send the value to your php file which contains the logic. This implies that you would have an sql statement which resembles the following:
select lyrics from musicTable where song-title = '$songTitleRequested'
This can be messy and you might want to find out an easier way to reference songs maybe using a synthetic key or some other technique.
So if this is successful you can return the results from your php file to the jquery ajax request.
You will then target the div in which you want to display the lyrics and use jquery to append the data. Remember to use .empty() before appending a new song.
So a bit of jQuery, ajax, php, sql and you will be fine, especially to avoid page reloads. Hope this somewhat guides you in the right direction. It would be nice to provide code examples, but as you can see this is a ton of work.
Get a useful IDE, utilise xdebug and firebug is your friend.
Comment: Thank you. This is perfect and is the exact thing i have been looking for.


Any cydia App for choosing specific proxy country?

Question: Like for those tv apps, in my case, from Spain which will only show certain content if you have a Spanish ip.
For me in Germany I thus need some kind of proxy from Spain. Does such an app exist in cydia? Or would there be any other way in order to appear as a Spanish client to the servers of that tv app?
Answer: This is a non-Cydia solution. I hope it still applies as answer for your question though.
Maybe you would like to try an app called VyprVPN. It lets you choose your server location basically with a single button. It advertises on its Website as a "security measure", but this review states

VyprVPN can be used to bypass website restrictions or bans implemented by certain countries.

I have not tested this app myself, so I cannot "recommend" it as such, but I think based on the information provided it should to the job for you. Good luck!
Comment: thx! I always thought I would need Cydia for these kind of things, but that app looks great without any need of cydia. I might try the test version. thx for your answer!


Linear subspace and Affine subspace

Question: I am currently reading a paper titled "Another view of division property" and encountered the terms "Affine subspace" and "Linear subspace". I am new to the field and having some difficulties to understand the topics. Can anyone describeb or give any reference about it so that I can read that.
Answer: In general an affine subspace is not a subspace, it's just a translate (coset) of a subspace. This is because normally we expect $0$ to be in a subspace $V$, since due to closure $x-x \in V.$
If $a+V$ is an affine subspace for $a\neq 0,$ and $V$ a subspace then automatically $a$ is required to be not in $V.$ Otherwise $a+V=V.$
Comment: One can also visualize this with lines in the space.
Comment: $a$ could still be in $V$, there is no contraddiction. Indeed ever linear subspace is also an affine one.
Answer: By "linear subspace" $V$ of some vector space, say $\mathbb{R}^n$, we mean a subgroup of the vector space. So in particular we must have that:

$0\in V$,
For every $v\in V$ we have that also $-v\in V$,
For every $a,b\in \mathbb{R}$ and every $v,w\in V$ we have that $a\cdot v + b\cdot w \in V$.

In other word, in a linear subspace you can do every linear combination of the element of the subspace and you still end up with an element of the same subspace. This is different if we consider "affine subpaces".
An "affine subspace" W of a vector space $\mathbb{R}^n$ can be seen a subset of $R^n$ such that there exists a vector $a$ with the property that
$$
W-a=\{v \mid v = w - a \text{ with } w\in W\}
$$
is a linear subspace.
From this "definition" we can see that:

every linear subspace is also an affine one (just take $a=0$),
linear combination of elements of an affine subspace need not be in the same affine subspace.
Answer: The other answers provide nice technical definitions. I'm going to provide a more intuitive/visual one.
An affine subspace is a linear subspace plus a translation.
For example, if we're talking about $\mathbb{R}^2$, any line passing through the origin is a linear subspace. Any line is an affine subspace.
In $\mathbb{R}^3$, any line or plane passing through the origin is a linear subspace. Any line or plane is an affine subspace.
Any text or course in Linear Algebra will help you learn more about this if you're interested.

Linear subspace and Affine subspace


Interpreting an ARIMA model in Time series

Question: I would like to request your assistance in interpreting this model in Time series.
$$
(1 − B) (1 − B_{4})(1 − 0.43B_4)X_t = (1 + 0.22B)(1 + 0.88B_4)W_t.
$$
Answer: The seasonal ma polynomial (coeff =.88) is effectively cancelling the seasonal difference . I suggest that you simplify your model by eliminating the seasonal difference irrespective of the poor guidance by your software's overfitting  . Make sure that the model errors don't suggest pulses and/or level shifts or other gaussian requirements otherwise you have effectively mis-modelled.
Answer: Time series models usually do not have interpretation the same way that cross section econometrics has.
What you can interpret (assuming you have a series with quarterly frequency) is that the model is a SARIMA.


Pyrex Percolator on stove?

Question: Does anybody use a vintage Pyrex percolator on their stove?  Electric? Gas?  Is it 100% safe?  I just saw it in an old movie, which is what gave me the idea to look for one.
Comment: I don't know for sure, but my grandma always used hers on the stove.  She had electric and then gas.
Answer: Pyrex percolators made after 1940 were not intended to be used directly on a heating element as stoves made after 1940 had a higher burner heat level that those made in previous years. (Presumably, those made before 1940 were placed directly on a burner.)
The Pyrex percolators I remember had a wire 'grid' or 'heat spreader' that was to be placed on the burner and then the percolator sat directly on that. If memory serves me correctly, they came in a variety of shapes. See below for an example.
Comment: The story I had heard was that Pyrex used a different glass formulation before 1940 that was more resistant to thermal shock; around 1940 they changed their formulation to be more resistant to physical shock (at the expense of thermal resistance), which also made it less expensive to produce.  Therefore, I'd recommend finding a percolator made before 1940.
Answer: I have a Pyrex 7756B (4-6 cup percolator) that I purchased about a year ago. I use it daily on a gas stove. Mine came with the heat spreader, but I've never used it as the instructions on the packaging state that it's only necessary on an electric heating element. From the envelope the heat spreader came in:
IMPORTANT
Heat Spreader Grid for use with PYREX® Brand Rangetop Ware. The enclosed heat spreader grid MUST ALWAYS BE USED when PYREX brand items (image of the Flameware logo, then on bottom) are placed on ELECTRIC RANGES. The guarantee does not remain effective if this item is used on an electric range without a wire grid or if it is allowed to boil dry on any range.

Place the wire grid on top the electric heating unit and the PYREX brand rangetop item on top of the grid. (This is not necessary on gas.)
Use low to moderate heat. Sticking of food indicates too much heat
Always put liquid in a PYREX brand rangetop dish before placing it over direct heat on top of the range.
ALLOW HOT DISHES TO COOL BEFORE ADDING LIQUID.
Handle a hot PYREX brand dish with a dry cloth and never set hot PYREX brand dishes on wet surfaces.
DO NOT USE FOR DEEP FAT FRYING.

Capitalizations above are the original writer's. It's worth noting that entire thing is printed in bold, red type.
Answer: I have a couple of them, and have used them on both gas and electric stoves with no trouble. Using a heat spreader isn't a bad idea, but I have found no issues using them without. I do not even know how old mine are -- pre-1940s or not -- but either way, they work really well.
Answer: I think I have the definitive answer to this question. I found the Pyrex percolator at the Corning Glass Museum. It came with a metal heat diffuser. If you scroll through all the pictures (links to the other images are to the lower right of the main image), you'll even see the paper sleeve the diffuser came in.
If you search the museum collection for glass percolator, a number of them come up and most have a metal heat diffuser in the full set.
We've been using our vintage coffee pot on an electric stove without a diffuser for a week. It hasn't damaged it but we're now using the diffuser that came with our Chemex coffee maker.
Answer: Mine blew apart over medium-high heat.  Glad top burner.

Pyrex Percolator on stove?


How to configure 'git log' to show 'commit date'

Question: How can I configure git log to show commit date instead of author date?
Comment: @Colleen Each commit has two dates associated - AuthorDate and CommitDate (`git show --pretty=fuller HEAD` to se an example). For local development, these are usually the same, but for patches added via e-mail or other mechanisms, they can differ, where the AuthorDate is the date the patch was generated, and the CommitDate being when it was actually applied to the repository.
Comment: Kind of related: [How to make `git log` show only the commit date, nothing else](https://stackoverflow.com/q/71384830/4561887)
Answer: There are several options to pretty print the date. Probably the easiest is to just use one of the pre-baked --pretty formats, like git log --pretty=fuller - this will show both dates. If you want to see only one date, but make it the commit date, you can use git log --format=<some stuff>. All the allowable codes for defining the format are documented in git help log. The commit date is one of %cd, %cD, %cr, %ct or %ci, depending on what format you prefer it in.
If it's something you want to do often, put it in an alias or write an auxiliary script to save on typing.
Comment: From `%cd` can we get only year and month?
Answer: You can use --pretty=format and use %cr for commit date relative.
For example:
$ git log --graph --pretty=format:'%C(auto)%h%d (%cr) %cn <%ce> %s'

You can define an alias in git to make this easier to use. I have the following in my .gitconfig:
[alias]
# see `git help log` for detailed help.
#   %h: abbreviated commit hash
#   %d: ref names, like the --decorate option of git-log(1)
#   %cn: commiter name
#   %ce: committer email
#   %cr: committer date, relative
#   %ci: committer date, ISO 8601-like format
#   %an: author name
#   %ae: author email
#   %ar: author date, relative
#   %ai: author date, ISO 8601-like format
#   %s: subject
# my awesome git log replacement
lol  = log --graph --pretty=format:\"%C(auto)%h%d%Creset %C(cyan)(%cr)%Creset %C(green)%cn <%ce>%Creset %s\"
# same as above, but ISO date
lold = log --graph --pretty=format:\"%C(auto)%h%d%Creset %C(cyan)(%ci)%Creset %C(green)%cn <%ce>%Creset %s\"
# using build-in standards
lol2 = log --oneline --graph --decorate
# shows branches and their last commits
lol3 = log --all --graph --decorate --oneline --simplify-by-decoration

On Linux or similar systems, you can use single-quotes ' instead of double-quotes ":
[alias]
lol = log --graph --pretty=format:'%C(auto)%h%d%Creset %C(cyan)(%cr)%Creset %C(green)%cn <%ce>%Creset %s'

With this, simply run git lol, or the other variants to see the pretty output.
Here's the output of git lol --simplify-by-decoration:

It looks good. :)
lol is easier to type than log, and sounds better too.

Also gives you access to the regular git log if you ever need it.

Your eyes can scan contents quickly by the different colors.
Names and e-mails are very useful for large projects/org with many contributors.
Using default coloring for hash/ref as it is already pretty good.

Here's the output of git lold with dates in ISO format. Useful to see the exact date/time a commit is made, with the bonus of being able to see the contributor's timezone easily.

Edit 2020-06: Added screenshots. Updated to use %C(auto) (auto/default coloring) for %h (commit hash) and %d (ref names). Added %cn (commiter name) in addition to email.
Comment: Corrected line: git log --graph --pretty=format:"%C(yellow)%h%Creset%C(cyan)%C(bold)%d%Creset %C(cyan)(%cr)%Creset %C(green)%ce%Creset %s"
Comment: @frakman1 — you need to un-escape the "s for the above line to run in the terminal
Comment: I get a parsing error: `git log --graph --pretty=format:\"%C(yellow)%h%Creset%C(cyan)%C(bold)%d%Creset %C(cyan)(%cr)%Creset %C(green)%ce%Creset %s\"`
bash: syntax error near unexpected token `('
Answer: I prefer this format, doesn't include author name and includes actual date for commit.
git log --graph --pretty=format:"%C(yellow)%h%x09%Creset%C(cyan)%C(bold)%ad%Creset  %C(green)%Creset %s" --date=short

Comment: 'actual date' that the _author_ created the first version of that commit content. If it had since been rebased or otherwise re-committed, the final commit date for what you see there is found with the '%c' format stem. The '--short-date' option is synonymous with the 'iso' date format output of %ai and %ci
Answer: Might be useful to someone. I was looking for date and time stamps with the author name.

git log --graph --pretty=format:"%C(yellow)%h%x09%Creset%C(cyan)%C(bold)%ad%Creset %C(yellow)%cn%Creset  %C(green)%Creset %s" --date=default

Comment: Since the question is about showing commit-date, you will need to change `%ad%` with `%cd%` to view commit-date. `ad` is for author date.


How to make apache error log entries longer

Question: I'm sending some rather long stack traces to the apache error log using php's 'error_log()' and the entries are getting truncated. I have not found a way to make entries longer.
Any ideas?
Comment: Please consider changing the accepted answer to be [kumade's answer](https://stackoverflow.com/a/43281399/3303195).
Answer: The default limit on the maximum length of error message passing through error_log() is 1024 bytes.
Detailed information there http://www.php.net/manual/en/errorfunc.configuration.php#ini.log-errors-max-len
Answer: As Leopoldo said, setting log_errors_max_len seems pretty useless in this situation, and PHP manual states this clearly.
The only solution I was able to find so far is to use:
error_log("Long error message...", 3, CUSTOM_LOG_FILE);

The second parameter of error_log() allows you to redirect message to a custom file. So, the last parameter should be a path to a custom log file.
This way I'm getting full error message and, what might be more important for someone, non ASCII characters are clearly readable there (not sure though, might be my bad, but when I'm logging them with standard log file - I get things like \xd0\xbf).
Comment: Thanks for this.  I fail to see their logic in the function truncating the message for the configured error log file entries but not for those in a custom path.
Answer: PHP Manual says about the settings log_errors_max_len in php.ini:

Set the maximum length of log_errors in bytes. (...) The default is
  1024 and 0 allows to not apply any maximum length at all.

Some suggest that you can change it doing for example:
ini_set("log_errors_max_len", 2048);

But the Manual adds:

This length is applied to logged errors, displayed errors and also to
  $php_errormsg, but not to explicitly called functions such as
  error_log().

I'm trying to find a solution. Will edit if I do.
Answer: Reading the question above made me wonder if the problem is within Apache.
Yes, the truncation occurs within PHP for Apache will allow even over 10,000 characters.  Here's a Perl script assessing Apache's ability to post long error messages into its log:
#!/usr/bin/perl -w
#
# Test error log length limitations
# Result: no limitation
#
#

use strict;
use CGI;

my $query = CGI->new;
print $query->header;

print "You have reached "
    ."cgi-bin/admin/test_error_log.pl"
    ."\n";
print STDERR "This is an error message from $0\n";
print STDERR "
[Above should be a blank line] here is a multiline error message
here is the third and final line of it\n";
print STDERR 'abcde' x 200;   #1,000 characters
print STDERR "\nAbove is 1,000 characters of output of 'abcde'\n";
print STDERR 'vwxyz' x 2000;  #10,000 characters
print STDERR "\nAbove is 10,000 characters of output of 'vwxyz'\n";

Comment: I have the same problem with Nginx.
Answer: ErrorLog "|bin/rotatelogs /var/logs/errorlog.%Y-%m-%d-%H_%M_%S 5M"

This configuration will rotate the error logfile whenever it reaches a size of 5 megabytes, and the suffix to the logfile name will be created of the form errorlog.YYYY-mm-dd-HH_MM_SS.
For more read official documentation from apache.org Link Here
Comment: -1 I'm not sure why this is an accepted answer.  This won't do anything to prevent truncation of individual entries in the log.
Comment: This will actually truncate long logs because it is restrained by the OS' pipe length limit.


How can the Sterile Neutrino be detected?

Question: If the Sterile Neutrino only feels Gravity (and not the Weak Force) how can it ever be detected? I assume current neutrino detectors would be useless.
Answer: By hypothesis, sterile neutrino would be difficult to detect directly (even by the standards of experimental neutrino physics) because we define them by their failure to participate in the only interaction that normal neutrino participate in (the weak interaction).
Accordingly we detect them by their effects on the physics of things we can access by direct experimental efforts.
The primary channel for observation of sterile neutrinos would be through high precision measurements of the mixing matrix of the three ordinary neutrino species, so that the unitarity of that matrix could be assessed with confidence.
Real quantum system are unitary, so if the (3-flavor) mixing matrix were found to be non-unitary to high confidence in some range of $L/E$, then we would infer the existence of some additional state (or states) of the system which none-the-less did not show up in our detectors. Because the detectors are (by design) sensitive to the kind of interaction that normal neutrino have, those state would necessarily not have that interaction channel.
Comment: Are you saying that neutrino mixing is due to gravity? As I understand your answer, sterile neutrino behaviour is not described by electro-weak theory, so what remains is strong interaction or gravity?
Answer: Sterile Neutrinos are hypothetical they have not yet been proven to exist. We can't really detect them. There have been attempts to detect radiation given off by Sterile Neutrinos but with no success.

The production and decay of sterile neutrinos could happen through the mixing with virtual ("off mass shell") neutrinos. There were several experiments set up to discover or observe NHLs, for example the NuTeV (E815) experiment at Fermilab or LEP-l3 at CERN. They all led to establishing limits to observation, rather than actual observation of those particles. If they are indeed a constituent of dark matter, sensitive X-ray detectors would be needed to observe the radiation emitted by their decays

We have ideas of how we can detect them but we haven't actually ever detected one before.
A sterile neutrino was possible explanation of the results of the Liquid Scintillator Neutrino Detector experiment. Recent results and data have given support to the existence d of such a particle. Even though researchers at the MiniBooNE experiment at Fermilab announced that they had not found any evidence supporting the existence of such a sterile neutrino.
Two separate detectors near a nuclear reactor in France found 3% of anti-neutrinos missing. They suggested the existence of a 4th neutrino with a mass of 0.7 keV.

Daya Bay Collaboration measured the anti-neutrino energy spectrum, and found that anti-neutrinos at an energy of around 5 MeV are in excess relative to theoretical expectations. It also recorded 6% missing anti-neutrinos. This could suggest that Sterile neutrinos exist or that our understanding of Neutrinos is not complete.

The Seesaw mechanism
As the sterile right-handed neutrino gets heavier, the normal left-handed neutrino gets lighter. The left-handed neutrino is a mixture of two Majorana neutrinos, and this mixing process is how sterile neutrino mass is generated.

Apart from empirical evidence, there is also a theoretical justification for the seesaw mechanism in various extensions to the Standard Model. Both Grand Unification Theories (GUTs) and left-right symmetrical models predict the following relation:

According to GUTs and left-right models, the right-handed neutrino is extremely heavy: MNHL ≈ 105—1012 GeV, while the smaller eigenvalue is approximately equal to

Sterile Neutrinos in trouble?


PIC18F various output voltage level

Question: How can I control voltage level on a specific pin in PIC18F? Let's say then I want to send about 0.6V to transistor base. But I cannot use a voltage divider. I need to control output voltage by my PIC18F (PIC18F2525).
Comment: Is this a programming problem? It sounds like you just need a resistor, which is clearly a hardware issue.
Comment: So you need software control over the voltage output. Are you asking *how* to do PWM? Or do you know how to do PWM and are asking for other solutions?
Comment: It is programming issue. I know that I can use PWM in some way. Let's say that I want to achieve a fading LED effect via change the output voltage level (using timer modlue).
Answer: You don't actually want to send 0.6V to the transistor base.  $V_{BE}$ will vary a good deal between various transistors, so you won't get a well defined current through the transistor if you set it to 0.6V.
The standard way to bias a transistor is by sending a small amount of current through it.  Let's assume you're working with a MMBT3904, and want to send 30mA through it.  Get the datasheet, and find the graph which relates $h_{FE}$* and $I_C$ (Line 2 is at $25^{\circ}{\rm C}$):

$h_{FE}$ is about 140, so you need to send $214\mbox{ }{\mu}A$ through the base:
$$\frac{I_C}{h_{FE}}=\frac{30\mbox{ mA}}{140}=214\mbox{ }{\mu}A$$
Note that this parameter isn't precisely defined (that's why they used a graph), is temperature dependent (that's why there are three lines in this figure), and varies with $V_{CE} (as indicated by Figure 3).  However, it varies a lot less than $V_{BE}$.
There are many circuits to perform the task of sending a small current through the base.  Basically, every way you can connect resistors to $V_{CC}$, GND, and $V_{EE} (if a negative supply is used) has a name.  Wikipedia has a good article, but my college course spent a good two weeks talking about these different modes, so don't be discouraged if you don't get it in the first pass. I'll explain the simplest circuit (fixed bias) here.
The schematic looks like this:

$R_L$ is your load; if you need to connect your load to ground, use a PNP and invert everything.
When you drive pin 5 into a low or high-impedance state, only a leakage current will flow through the collector.  According to the datasheet, this value is $I_{CBO}=50\mbox{ }nA$ with $V_{CB} = 30\mbox{ }V$.  When you drive it high (say, $3.3\rm V$), there is a voltage established across $R_B$ and the base-emitter junction of the transistor.  This is an N-P silicon junction, very similar to a diode.  It has a similar voltage characteristic - According to Figure 4 of the datasheet, it will be about $790\rm mV$, but that will vary as we've said before.  But $800\mbox{ }mV$ is close enough for our purposes.  We need to find the value of $R_B$ that gives a current of $30\mbox{ }mA$:
$$ I_C = h_{FE} * I_B = 140 * \frac{ 3.3\mbox{ }V - 0.8\mbox{ }V }{R_B} $$
$$ R_B = \frac{140 * ( 3.3\mbox{ }V - 0.8\mbox{ }V ) }{I_C} $$
$$ R_B = \frac{350}{I_C} \rightarrow 11.66\mbox{ }k\Omega $$
An $11\mbox{ }k\Omega$ 5%, 2%, or 1% resistor should do nicely!
* - $h_{FE}$ is roughly synonymous with $\beta$, so you may see both values in datasheets.  $h_{FE}$ usually refers to the quiescent/DC state of the transistor, while $\beta$ is used when working with small-signal/AC currents.  They both denote the ratio of base current to collector current.
Answer: Some PICs have built in low resolution DACs that you can use. Check the datasheet!
Answer: If you need to supply a digital signal to a transistor base of 0v or 0.6v, use a resistor.
If you want to provide an analogue output, you need to use an external DAC (Digital to Analogue Converter) (some PICs may provide these internally). You can make a simple DAC with a resistor ladder and several digital output pins. The more pins you use, the more bits of resolution you'll get.
If you want to control the brightness of an LED you can rapidly toggle a digital signal and modulate the width of your pulses. This is called PWM, Pulse Width Modulation. Because we humans cannot see the rapid pulses, we perceive them as a continuous analogue output.

PIC18F various output voltage level


QGIS Project to Raster (Geotiff)

Question: I've a question about rendering a qgis project (src: postgis) into raster files (e.g. geotiff).
My Goal is it to render my qgis project into 256x256 tiles for Mapnik.
I know there are a lot of python scripts which can do that, but I want to use gdal2tiles (it's better performance). So I need big Geotiff files in the max. zoom level as input for gdal2tiles. For example 2x2km (14.000px x 14.000px).
The QGIS Print-Composer can't do that for me. Using the "cmd" command for making high resolution image ("qgis --project x.qgs --snaphot --width --height.." and so on) doesn't work with that high number of pixel.
Does someone has an idea?
Answer: Have you looked into qtiles plugin? Looks like what you're after.
https://plugins.qgis.org/plugins/qtiles/

QGIS Project to Raster (Geotiff)


Page Titles - Including gender of a fashion product in page titles?

Question: I need a bit of help to decide whether it is worth including gender in page titles.
In the webmaster tools: I looked at our search queries that include "women", and they account for 9% of our total search queries for the site.
I am wondering if it is the right way assess the benefit of including "woman" or "men" in page titles, looking at it with existing results pointing to us already?
Is there another tool that I can check the actual queries that may not include us in search results?
Like google insights maybe? http://www.google.com/insights/search/#q=shoes%2Cshoes%20for%20women&cmpt=q
So it looks like 1.1% of searches for "shoes" are also "shoes for women" is that correct?
As a direct comparison, doing the same analysis on our own search queries, I get 1.8% when comparing "shoes for women" to "shoes"
Implementing this automation would probably affect 99% of our site if not more, splitting it in 2 segments (one portion of page titles including "women" and the other including "men")
Will doing so create a massively repetitive keyword throughout the site, hurting SEO?
http://support.google.com/webmasters/bin/answer.py?hl=en&answer=35624 (see "Avoid repeated or boilerplate titles.")
Comment: I feel very confused about this issue too. Best practice is supposed to be including keywords at the beginning of titles but we shouldn't use boilerplate titles. A bit of clarity from Google would be great.
Answer: I would go for a url structure that includes gender along with h1 page titles which include the gender - this should have the desired effect.


Vimeo captions not working in IE

Question: I have VTT closed captions files that I generated from YouTube.  After some edits, I uploaded the .vtt file into my Vimeo version of the video.
I see the captions on Chrome but not in IE.  Why?
Answer: I stumbled upon this solution.  Just delete the extra lines at the top.
<code>WEBVTT
Kind: captions  (delete this line)
Language: en    (delete this line also)

00:00:00.890 --> 00:00:04.770
</code>

Vimeo captions not working in IE


Getting into Web Design

Question: I'm a graphic designer (at least I like to call myself that) specializing in illustration and vector graphics. I'm self-tauggt and I work with Photoshop, CorelDraw and Blender. I really want to get into web design but I have no idea where to start. Do I really need to get awesome at PHP/HTML5/CSS/Java/Flash to get anywhere in this field? Any blogs/websites that I can add to my RSS feed, magazines I can check out? Are there any good courses (online, free or paid) or books that would help me on my endeavour? Must-have software? I've tried to google the subject but couldn't really find anything meaningful and the courses I've stumbled upon are always coding-only. I've really been trying to tackle this myself but I guess it's time to admit defeat and seek help from people smarter than me. Thank you to anyone who decided to read this (and answer) and sorry for any language errors.
Comment: You're asking a lot of questions that are all really broad. This is a huge topic. Can you narrow your question down?
Comment: I guess I'm trying to get a nudge in the right direction by finding out the bridge between a guy who knows a little HTML/CSS and can work in Photoshop and full-on, guns blazing, professional website designer. There are scattered pieces of knowledge lying all around me and I can't seem to make any connections between them.
Comment: What might help is that there is no one definition of 'web designer'. It's a huge field full of all sorts of job titles and there's plenty of room to find your niche that fits your interests. UX designer, UI developer, Visual designer, Interaction Designer, Usability Testing, Information Architect, etc, etc.
Answer: This Q is not really a good fit for this site, but I will give it a shot.
It is hard to know where to start, so I will just suggest the absolute lowest common denominator for the direction you want. Focus on basic HTML and CSS first. Ignore dynamics and server side for now. Why? Because having a grasp of how the "static" basis of web sites are structured and build is the basis for everything else.
First. Get rid of the idea that you are going to "design" something. First, you must learn to create a web page structure.
Get a text editor. Chances are your machine already has one. There are plenty of free ones, Wrangler being but one. Personally, I use Coda (Mac). This is what you want it to be able to do:

autocomplete
colour differentiation
language support: css, html

There are lots of other fancy stuff, but for now this will do.
I could make a gigantic list of links, but any search for "basic html page" will give you examples.
W3School is often suggested as a place to start: note the "try this yourself"-buttons where you can fiddle with the code.
Mozilla also has examples.

Learn to set up a single HTML page with a CSS stylesheet linked in
the header

Then... you must just put in the hours, there is no shortcut.
In your mind/on paper make a very very simple webpage layout (classic: header, sidebar, main content, footer) and find out how to do it.
BUT I hear you say; is this really how it is done?? Do web designers sit down with a blank text document and start typing??
<!DOCTYPE html>

Heading....

No, not anymore. But you need to be able to create the header, sidebar, main content, footer from scratch before anything else will make sense. The logic of HTML and CSS is key.

Then you can look at frameworks. But the code will not make any sense unless you got the basics in. Take a look at for example Bootstrap.
W3School has some Bootstrap tutorials. Search for Bootstrap for beginners and you should be able to find stuff that you can understand.
When you get the principles of HTML and CSS you can start to look at JavaScript.
Best of luck.
Comment: W3Schools is not a site StackOverflow recommends highly: http://meta.stackoverflow.com/questions/280478/why-not-w3schools-com
Comment: W3Schools is only to be used as a reminder of certain traits, not as documentation or something to be taken as always true as it is prone to errors and being outdated
Comment: I agree and I would never suggest it there, but for this purpose I think it will work fine.
Comment: Yes, yes, but this is meant as a reference to basic, basic HTML and for that I think it actually works. Feel free to add a better answer.

Getting into Web Design


How did astronomers first come to understand that the Sun's core was a gas?

Question: I was reading a very old book (around 1850) on astronomy and the author explains Sun spots as a phenomena where you can see the black planetary like hard core of the Sun through two different atmospheres.  It got me interested that somewhere between 1850 and now it became understood that the Sun's core is a gas.  How was this determined conclusively and approximately when in history?
Comment: Bear in mind that the solar core density is around 150 g/cm³, which is more than 13 times the density of lead under standard conditions here on Earth.
Answer: Well simply said: All data fits the premise that it should be a gas.
But what data?

First of all, in the late 1960's the 5-minute solar oscillations on the surface of the sun have beend discovered. Those have been recognized as surface features of internal pressure waves with penetration depth $d$, wavenumber $k$ and their relation roughly $d \sim  \frac{1}{\sqrt{k}}$.
So from the measurment and simple existence of certain wave-ripples on top of the photospheric plasma-ocean we can learn about the interior of the sun. To relate the strength of certain wavemodes to the interior structure of this plasma-ball we use usually a reverse-engineering approach called modelling. We take what we know about gases, energy transport etc. and calculate from this how a solar-oscillations-spectrum on a modelled sun would look like. Then compare, scratch your head, change the modell and repeat until it fits. More mathematical details, if you are interested can be found in the excellent lecture notes on Helioseismology from Christensen-Daalsgard.
So all this gave us a pretty good look into the sun's interior and it was quite clear, that the observed solar parameters like, size, energy output, surface temperature must lead to certain Pressure, Temperature and Density values for the core corresponding to a fusing plasma.
But those theoretical predictions would imply the core-plasma to create neutrinos from nuclear reactions, which famously (wiki: Solar_neutrino_problem) were off by a factor of about 3. With the discovery of neutrino oscillations (wiki: Neutrino_oscillation) this problem was also solved in that the sun didn't produce too few neutrinos, but the produced neutrinos would simply change their types. After some distance from the sun those changes would redistribute the numbers from 3:0:0 for electron-myon-tau neutrinos to 1:1:1.
This problem persisted until approx. the year 2000.
Comment: Actually, I don't know. I know for sure that since the works of Bunsen and MKirchhoff in the late 1800s it was certain that the sun's surface is a gas (forgot to add that). And also from [Kirchhoffs laws of spectroscopy](http://en.wikipedia.org/wiki/Gustav_Kirchhoff#Kirchhoff.27s_three_laws_of_spectroscopy) ppl had a first idea about the thermal structure of this surface gases. But I'm not sure how far down into the star they did extrapolate this.
I think more important here are energetic arguments: How should a solid core produce all this energy we see? (assuming this happens in the core)
Comment: I mean, we could elaborate a bit more on the arguments why ppl excluded that the sun's energy source can't be coal burning. Then, with discovering of the atomic nucleus, and measurments of binding energy per nucleus per element ppl got the idea of a fusioning gas around ~1930's I think, rather fast. Plus the neutrinos were pointing at nuclear reactions.
But glad that I could help.
Comment: Interesting +1. Do you know if it true then that astonomy books before 1950 still thought the sun might have a solid core?
Comment: Think your answer is pinpointing why and 'around when' but seems close enough, thanks.
Comment: Erm, guys. Why are we all going along with the proposition that the Sun's core is made of gas? The Sun's core has a dense, treacle-like consistency.


GoogleTest: How to skip a test?

Question: Using Google Test 1.6 (Windows 7, Visual Studio C++).  How can I turn off a given test? (aka how can I prevent a test from running).  Is there anything I can do besides commenting out the whole test?
Answer: The docs for Google Test 1.7 suggest:

If you have a broken test that you cannot fix right away, you can add the DISABLED_ prefix to its name. This will exclude it from execution. This is better than commenting out the code or using #if 0, as disabled tests are still compiled (and thus won't rot).

Example from the above documentation:

// Tests that Foo does Abc.
TEST(FooTest, DISABLED_DoesAbc) { ... }

class DISABLED_BarTest : public testing::Test { ... };

// Tests that Bar does Xyz.
TEST_F(DISABLED_BarTest, DoesXyz) { ... }

If you have access to more recent versions of Google Test (the current version is v1.12.1), check out the GTEST_SKIP() macro suggested by jslmsca in the comments and Peter Bloomfield in another answer. From the sample in advanced.md:

TEST(SkipTest, DoesSkip) {
  GTEST_SKIP() << "Skipping single test";
  EXPECT_EQ(0, 1);  // Won't fail; it won't be executed
}

class SkipFixture : public ::testing::Test {
 protected:
  void SetUp() override {
    GTEST_SKIP() << "Skipping all tests for this fixture";
  }
};

// Tests for SkipFixture won't be executed.
TEST_F(SkipFixture, SkipsOneTest) {
  EXPECT_EQ(5, 7);  // Won't fail
}

Comment: just found it too and filters
Comment: @Bill, I found it just before you posted your comment... (and I put it up as an answer too). I then removed my comment, figuring it's obsolete... but that's some really good info! +1
Comment: But disabling is not skipping. Skipping is a temporary not available state (like not connected to internet) and is only detected dynamically in the setup call.

Just mentioning it as this is the #1 google result 11 years later
Comment: I agree with @Lothar because disabling makes it easy to forget that the test exists.  Disabling will prevent it from appearing in the Test Explorer Window (VS2022 using Test for Google Adapter) so it's preferable to use GTEST_SKIP until the test can be fixed.
Comment: @jslmsca, this is a great addition to the answer if using a more modern version of Google Test. GTEST_SKIP (and VS2022 integration) didn't exist with Google Test 1.7 back in 2011. :D
Answer: You can also run a subset of tests, according to the documentation:
Running a Subset of the Tests

By default, a Google Test program runs all tests the user has defined.
Sometimes, you want to run only a subset of the tests (e.g. for
debugging or quickly verifying a change). If you set the GTEST_FILTER
environment variable or the --gtest_filter flag to a filter string,
Google Test will only run the tests whose full names (in the form of
TestCaseName.TestName) match the filter.
The format of a filter is a ':'-separated list of wildcard patterns
(called the positive patterns) optionally followed by a '-' and
another ':'-separated pattern list (called the negative patterns). A
test matches the filter if and only if it matches any of the positive
patterns but does not match any of the negative patterns.
A pattern may contain '*' (matches any string) or '?' (matches any
single character). For convenience, the filter '*-NegativePatterns'
can be also written as '-NegativePatterns'.
For example:
./foo_test Has no flag, and thus runs all its tests.
./foo_test --gtest_filter=* Also runs everything, due to the single match-everything * value.
./foo_test --gtest_filter=FooTest.* Runs everything in test case FooTest.
./foo_test --gtest_filter=*Null*:*Constructor* Runs any test whose full name contains either "Null" or "Constructor".
./foo_test --gtest_filter=-*DeathTest.* Runs all non-death tests.
./foo_test --gtest_filter=FooTest.*-FooTest.Bar Runs everything in test case FooTest except FooTest.Bar.

Not the prettiest solution, but it works.
Comment: In my case, I need to put the filtering condition in quotes as * is recognized as a wildcard.
Answer: You can now use the GTEST_SKIP() macro to conditionally skip a test at runtime. For example:
TEST(Foo, Bar)
{
    if (blah)
        GTEST_SKIP();

    ...
}

Note that this is a very recent feature so you may need to update your GoogleTest library to use it.
Comment: `GTEST_SKIP()` is available from 1.10.0.
Comment: This feature is not released yet. It's unlikely that it will be included in a 1.8.x branch, since only fixes are accepted there. 1.9 is not available yet, not even announced at this time.
Comment: It's `#define GTEST_SKIP() GTEST_SKIP_("")` in [gtest.h](https://github.com/google/googletest/blob/477998eefac3d55831e7f3974671ba22b8739b93/googletest/include/gtest/gtest.h#L1904) to allow an optional skip message.
Comment: Sadly documentation is still scarce around this. It seems there is also `GTEST_SKIP_("some message")` (note the trailing underscore)
Answer: Here's the expression to include tests whose names have the strings foo1 or foo2 in them and exclude tests whose names have the strings bar1 or bar2 in them:
--gtest_filter=*foo1*:*foo2*-*bar1*:*bar2*

Comment: in some environments, the pattern needs to be enclosed in single quotes

```--gtest_filter='*foo1*:*foo2*-*bar1*:*bar2*'```
Answer: I prefer to do it in code:
// Run a specific test only
//testing::GTEST_FLAG(filter) = "MyLibrary.TestReading"; // I'm testing a new feature, run something quickly

// Exclude a specific test
testing::GTEST_FLAG(filter) = "-MyLibrary.TestWriting"; // The writing test is broken, so skip it

I can either comment out both lines to run all tests, uncomment out the first line to test a single feature that I'm investigating/working on, or uncomment the second line if a test is broken but I want to test everything else.
You can also test/exclude a suite of features by using wildcards and writing a list, "MyLibrary.TestNetwork*" or "-MyLibrary.TestFileSystem*".
Comment: This is a great solution. I use it to exclude some tests by default if the filter is blank. They can be enabled with `export GTEST_FILTER='*'`.
Comment: Actually that doesn't work because the default is "`*`" not "". Instead I'll just use another environment variable that overrides the filter.
Comment: Where did you define the "filter"? Is it a string ?
Comment: I don't define it so I think it must be a global included from gtest/gtest.h?
Comment: Seems like a great solution. Unfortunately, this doesn't seem 100% properly supported on Windows when linking dynamically and results in unresolved external symbol for the `filter` flag. Also, seems like the latest is to use `GTEST_FLAG_SET(filter, "-MyLibrary.TestWriting");` instead of `testing::GTEST_FLAG(filter) = "-MyLibrary.TestWriting";`.
Answer: If more than one test are needed be skipped
--gtest_filter=-TestName.*:TestName.*TestCase

Comment: in some environments, the pattern needs to be enclosed in single quotes

```--gtest_filter='*foo1*:*foo2*-*bar1*:*bar2*'```
Answer: For another approach, you can wrap your tests in a function and use normal conditional checks at runtime to only execute them if you want.
#include <gtest/gtest.h>

const bool skip_some_test = true;

bool some_test_was_run = false;

void someTest() {
   EXPECT_TRUE(!skip_some_test);
   some_test_was_run = true;
}

TEST(BasicTest, Sanity) {
   EXPECT_EQ(1, 1);
   if(!skip_some_test) {
      someTest();
      EXPECT_TRUE(some_test_was_run);
   }
}

This is useful for me as I'm trying to run some tests only when a system supports dual stack IPv6.
Technically that dualstack stuff shouldn't really be a unit test as it depends on the system. But I can't really make any integration tests until I have tested they work anyway and this ensures that it won't report failures when it's not the codes fault.
As for the test of it I have stub objects that simulate a system's support for dualstack (or lack of) by constructing fake sockets.
The only downside is that the test output and the number of tests will change which could cause issues with something that monitors the number of successful tests.
You can also use ASSERT_* rather than EQUAL_*. Assert will about the rest of the test if it fails. Prevents a lot of redundant stuff being dumped to the console.
Comment: I recommend using GTEST_SKIP() or GTEST_SKIP_("") to exit after runtime environment checks that you have to "live with", so the skipping is separately logged at the end, rather than as a pass or fail.
Answer: I had the same need for conditional tests, and I figured out a good workaround. I defined a macro TEST_C that works like a TEST_F macro, but it has a third parameter, which is a boolean expression, evaluated runtime in main.cpp BEFORE the tests are started. Tests that evaluate false are not executed. The macro is ugly, but it look like:
#pragma once
extern std::map<std::string, std::function<bool()> >* m_conditionalTests;
#define TEST_C(test_fixture, test_name, test_condition)\
class test_fixture##_##test_name##_ConditionClass\
{\
    public:\
    test_fixture##_##test_name##_ConditionClass()\
    {\
        std::string name = std::string(#test_fixture) + "." + std::string(#test_name);\
        if (m_conditionalTests==NULL) {\
            m_conditionalTests = new std::map<std::string, std::function<bool()> >();\
        }\
        m_conditionalTests->insert(std::make_pair(name, []()\
        {\
            DeviceInfo device = Connection::Instance()->GetDeviceInfo();\
            return test_condition;\
        }));\
    }\
} test_fixture##_##test_name##_ConditionInstance;\
TEST_F(test_fixture, test_name)

Additionally, in your main.cpp, you need this loop to exclude the tests that evaluate false:
// identify tests that cannot run on this device
std::string excludeTests;
for (const auto& exclusion : *m_conditionalTests)
{
    bool run = exclusion.second();
    if (!run)
    {
        excludeTests += ":" + exclusion.first;
    }
}

// add the exclusion list to gtest
std::string str = ::testing::GTEST_FLAG(filter);
::testing::GTEST_FLAG(filter) = str + ":-" + excludeTests;

// run all tests
int result = RUN_ALL_TESTS();

Comment: How did you define "filter" in std::string str = ::testing::GTEST_FLAG(filter);?

GoogleTest: How to skip a test?


How to check if a geometry is contained in a geometry collection in postgis?

Question: How can I check if a geometry is contained in a geometry collection ? Specifically , I am using ST_ClusterWithin in PostGIS to get a cluster which returns each cluster as a geometry collection. Now I want to extract the cluster_id for each geometry. For this I need to check if the geometry is within the geometry collection. How can I do it ? It is related to this question I asked on stackexchange some days ago.
Comment: For the application you describe, it should be sufficient to figure out which geometry collection each input intersects.
Answer: you can use a combination of ST_CollectionExtract and ST_Dump()
and compare results to your geometry. You will need to specify the geometry type you want to extract:
1 == POINT, 2 == LINESTRING, 3 == POLYGON
WITH c AS (
SELECT (ST_Dump(ST_CollectionExtract(geom),2)).geom AS geom
FROM my_geo_collection)

SELECT c.geom, t.geom FROM
c, my_geometry AS t

WHERE c.geom = t.geom

This might not work if your reference geometry is a multigeometry, since ST_Dump expands multi geometries into simple geometry types
Comment: Are you sure it works? ST_Dump returns a set. In my case I have `ERROR: operator does not exist: geometry = geometry_dump` error.
Comment: Right, you have to use (st_dump ()).geom. I corrected my answer


What happens if I get an "I am error" room in the Backasswards challenge?

Question: In the new Backasswards challenge, due to the nature of the challenge itself, every trapdoor and hole on the floor is closed shut. What happens if, by chance, I get into an "I AM ERROR" room? Does that end the run since I cannot advance, or the trapdoor to exit the room is replaced by a beam of light (the only way to travel through levels in this challenge)?
Answer: It seems that this is actually an issue that has not been solved yet. Looking at this Reddit comment:

IMPORTANT ISSUE: I Am Error rooms break Backasswards
Finding an I Am Error room during the Backasswards challenge leaves you unable to continue, as the only way to exit is to take the trapdoor down. Problem is, Backasswards forcibly closes all downward trapdoors, so you're just stuck.

So you would remain trapped in this room, and wouldn't be able to continue your run.
Comment: Can you get out with another teleport?
Comment: If you can charge your teleport yes but most of the time you need to clear a few rooms to do that.


Allow author to choose his featured image size

Question: Request from a client. He wants his authors to be able to upload their image and then set it as featured, just like normal. The difference is that when setting it as featured, he wants the author to be able to choose 'small' or 'large' which will then be output appropriately on the front-end.
How would you go about this? I'm well aware of how to create new image sizes in the theme, but how can I allow the author to select his image size when making his post?
Answer: You could add a meta box to the post add/edit screen below the featured image box to allow selection of size via a dropdown select menu. You could generate the list from available sizes (via get_intermediate_image_sizes), or just use your small/large strings. The data would be saved as post meta and you would simply get_post_meta() to get the selected size, then pass that result to the thumbnail function as the size parameter.
Comment: That is superb! I don't know why I didn't think of adding custom meta info to the posts.  Thanks!
Answer: You can alter the content of that meta box, which is unusual.
Proof of concept:
function alter_thumb_box($content, $postID) {
  return $content.'<input type="radio" name="thumb-size" value="" />';
}
add_filter( 'admin_post_thumbnail_html', 'alter_thumb_box', 1, 2 );

You just need to add your fields and then provide a function to save the data, similar to function in the Codex examples.
Comment: This is great. Combining your answer with Milo's produced a very nice interface for selecting the image size. Much appreciated!


iCloud calendar command line utility

Question: Is there a CLI utility that allows one to sync up with their iCloud calendar (i.e., iPhone calendar on the cloud) to modify calendar events, etc.?
Answer: khal can be used in combination with vdirsyncer, which is able to synchronize with iCloud. Setup takes a while though.
Answer: According to this release note for version 22.214.171.124 from 26 May 2014, syncevolution offers basic iCloud interoperability:

It now [...] works with iCloud. However, syncing with iCloud ran into a server bug (reported as 17001498 "CalDAV REPORT drops calendar data") and needs further work.
Answer: Another solution is suggested in this blog:

I used a software from http://icloud.niftyside.com/ which I installed on my Uberspace. It was just unpacking it into a directory of the webserver and visiting the site. Then entering my credentials and I got all the URLs.

iCloud calendar command line utility


Android WallpaperManager crops image

Question: I am working on a simple wallpaper app of some images that I have.  They are .png files in drawable folders.
Here are some code snippets:
WallpaperManager myWallpaperManager = WallpaperManager.getInstance(getApplicationContext());
....
myWallpaperManager.setResource(R.drawable.image1);

No matter what size or resolution I seem to use, when the wallpaper is set it crops the original image.  When I use the same image as a background it is the correct size and shows the entire image.  I thought it might be a problem with my emulator so I have tried running it on an actual device (HTC eris) and I am having the same problem.  I have made the image the screen size and resolution for the eris and it is still cropping it.  I then made the image only one inch high and a resolution of 100 dpi.  It was very pixelated on the eris, but still cropped the image.
Any help would be greatly appreciated.
I attempted to add some images to show the before and after, but as a newer user I was prevented from doing so.
Comment: https://stackoverflow.com/a/73663041/9057721
Answer: Check the values returned by http://developer.android.com/reference/android/app/WallpaperManager.html#getDesiredMinimumWidth() and http://developer.android.com/reference/android/app/WallpaperManager.html#getDesiredMinimumHeight() and try to use these values as the dimensions of your wallpaper.
Answer: Maybe I can help.

// 1. Get screen size.
DisplayMetrics metrics = new DisplayMetrics();
Display display = getWindowManager().getDefaultDisplay();
display.getMetrics(metrics);
final int screenWidth  = metrics.widthPixels;
final int screenHeight = metrics.heightPixels;

// 2. Make the wallpaperManager fit the screen size.
final WallpaperManager wallpaperManager = WallpaperManager.getInstance(ViewWallpaperActivity.this);
wallpaperManager.suggestDesiredDimensions(screenWidth, screenHeight);

// 3. Get the desired size.
final int width = wallpaperManager.getDesiredMinimumWidth();
final int height = wallpaperManager.getDesiredMinimumHeight();

 // 4. Scale the wallpaper.
Bitmap bitmap = getBitmap(); // getBitmap(): Get the image to be set as wallpaper.
Bitmap wallpaper = Bitmap.createScaledBitmap(bitmap, width, height, true);

// 5. Set the image as wallpaper.
try {
  wallpaperManager.setBitmap(wallpaper);
} catch (IOException e) {
  e.printStackTrace();
}

Note that you should call suggestDesiredDimensions, then call getDesiredMinimumWidth and getDesiredMinimumHeight to get the size to be scaled to.
Answer: I had the same problem. I made an image that is the size of the screen and adding padding to the image so that it is as large as the WallpaperManager getDesiredMinimumWidth() and getDesiredMinimumHeight().
It seemed better to have some code automatically add the padding so that is what I used below.  Make sure the image is the same size as the screen.
private void setWallpaper() {
    try {
        WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
        //import non-scaled bitmap wallpaper
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inScaled = false;
        Bitmap wallpaper = BitmapFactory.decodeResource(getResources(), R.drawable.wallpaper, options);

        if (wallpaperManager.getDesiredMinimumWidth() > wallpaper.getWidth() &&
                wallpaperManager.getDesiredMinimumHeight() > wallpaper.getHeight()) {
            //add padding to wallpaper so background image scales correctly
            int xPadding = Math.max(0, wallpaperManager.getDesiredMinimumWidth() - wallpaper.getWidth()) / 2;
            int yPadding = Math.max(0, wallpaperManager.getDesiredMinimumHeight() - wallpaper.getHeight()) / 2;
            Bitmap paddedWallpaper = Bitmap.createBitmap(wallpaperManager.getDesiredMinimumWidth(), wallpaperManager.getDesiredMinimumHeight(), Bitmap.Config.ARGB_8888);
            int[] pixels = new int[wallpaper.getWidth() * wallpaper.getHeight()];
            wallpaper.getPixels(pixels, 0, wallpaper.getWidth(), 0, 0, wallpaper.getWidth(), wallpaper.getHeight());
            paddedWallpaper.setPixels(pixels, 0, wallpaper.getWidth(), xPadding, yPadding, wallpaper.getWidth(), wallpaper.getHeight());

            wallpaperManager.setBitmap(paddedWallpaper);
        } else {
            wallpaperManager.setBitmap(wallpaper);
        }
    } catch (IOException e) {
        Log.e(TAG,"failed to set wallpaper");
    }
}

Android WallpaperManager crops image


Python with Netbeans 6.5

Question: Can you give me some links or explain how to configure an existing python project onto Netbeans?
I'm trying it these days and it continues to crash also code navigation doesn't work well and I've problems with debugging. Surely these problems are related to my low eperience about python and I need support also in trivial things as organizing source folders, imports ecc,, thank you very much.
Valerio
Answer: Python support is in beta, and as someone who works with NB for a past 2 years, I can say that even a release versions are buggy and sometimes crashes. Early Ruby support was also very shaky.

Python with Netbeans 6.5


What level of resistance effect is equal to full Protection 4 Netherite armor in Minecraft Bedrock?

Question: What level of resistance effect is equal to full Protection 4 Netherite armor in Minecraft Bedrock?
Answer: In Minecraft Bedrock Edition, Protection IV (somehow) works as if it were Protection V in Java Edition. Normally, Protection gives you (4 × level)% of damage reduction. So, if you have Protection III on any armor, it gives you 4 × 3 = 12% of damage reduction.
However, for some reason, only in Bedrock Edition, Protection IV gives you (4 × (level + 1))% of damage reduction - that means, (4 × (4 + 1))% = 20% of damage reduction.
Apparently, because of bug, Bedrock Edition's Protection IV works as if it were Protection V. Normally, you would only get (4 × level)% of damage reduction, so you would only get (4 × 4)%(16%) of damage reduction bonus, but in its current state, Protection IV would give you (4 × 5)%(20%) of damage reduction bonus. However, it is a bug so it may be fixed in future version.
As a sidenote, if you give your armor pieces to have Protection V, it would work as intended (follows (4 × level)% formula, so (4 × 5)%.)
So, the Netherite armor set will provides you 20 Armor Points. Each Armor Point gives 4% of damage reduction, so you'll get 4 × 20 = 80% of damage reduction. If you got Protection IV on each armor pieces, this number goes up to 96%.
Base damage reduction(80%) + Protection IV(80%) ((100% - 80%) * 80% = 16%) = 96%.
AFAIK, in Bedrock edition, there's no difference between Diamond armor set and Netherite armor set except durability and knockback resistance, so you can just let your Diamond armor set to have Protection IV to get same effect.
In summary, you would need 96% of damage reduction to match the effect of full set of Netherite armor with Protection IV.
So, about Resistance level.
Actually, it's impossible to Resistance to have 96% of damage reduction. Since Resistance gives player 20% of damage reduction at each level, so if player gave themselves a Lv5 Resistance, the player will get 100% of damage reduction, which is practically invincible (still, some of damage source can deal damage to the player. See Resistance page from Minecraft fandom for more info.)
Nearest possible is Lv4 Resistance, but that only gives you 80% of damage reduction, which is same as Diamond/Netherite armor set without Protection IV enchant.
Comment: This answer doesn't answer the question fully, the user is asking about what level of resistance they need, which isn't provided by your answer.
Comment: Apparently, [Protection 4 works as if it were Protection 5](https://bugs.mojang.com/browse/MCPE-113191) so there shouldn't be any difference.
Comment: @pinckerman Uh, yes I know that... So, what you're saying is, the program somehow thinks Protection IV as Protection V and formula goes `(4 × 5)%`, rather than `(4 × (4 + 1))%`?
Comment: I believe that. In the bug page I linked there are some numbers proving that they work the same, so the formula should be pretty much that.
Comment: @pinckerman Thank you. I've edited the texts accordingly.
Comment: @Topcode Thanks. I thought OP meant to mimic its effect, not resistance level (that's my fault). Actually, that's impossible to do so, since resistance gives player 20% of damage reduction at each level, so if player gave themselves a Lv5 resistance, the player will get 100% of damage reduction. Nearest possible is Lv4 Resistance, but that only gives you 80% of damage reduction, which is same as Diamond/Netherite armor set without Protection IV enchant.


SQLite database not persisting between sessions

Question: I working with a Windows Phone 8 application using

C#/XAML
  SQLite v3.7.15
  sqlite-net 1.0.7'
  & Peter Huene's sqlite-net-wp8 (https://github.com/peterhuene/sqlite-net-wp8)

When debugging from VS I'm able to create a table, add data to the table and display the data in the UI. However, stop debugging and then resume the data from the last session is gone.
I create the connection like this
Connection = new SQLiteAsyncConnection("taskDB.db");

I'm not sure where that is putting the database?
I have tried the below so I could be sure where the database was being put but it results in the below error. I am surprised by this as I have seen this statement used in multiple examples.
_dbPath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "taskDB.db");
Connection = new SQLiteAsyncConnection(_dbPath);

Which results in this error within SQLite.cs itself:
Error Message
SQLite.SQLiteException was unhandled by user code
HResult=-2146233088
Message=no such table: Tasks
Source=JustSQLite

Any idea why the database is not persisted between debug sessions?
Answer: The Emulator instance persists the changes till it is running.
Once you close the Emulator, the file will no longer persist as it is dependent on the Emulator instance


Particle filter for likelihood evaluation

Question: I struggle to implement a particle filter to evaluate the likelihood of a textbook example. I got the following process:
$x_t = \alpha  + \beta x_{t-1}/(1+x_{t-1}^2) + w_t$ where $w_t \sim \mathcal{N}(0, \sigma^2)$ and
$y_t = \delta x_t + v_t$ where $v_t \sim \mathop{t}(2)$.
I want to know the likelihood $p(y|\alpha, \beta, \sigma, \delta)$ given some observations $y$ and a known $x_0 = 1$. To achieve that, I draw $N$ particles $x_t^j$ for every $x_{t}$ and calculate the density of the residuals $\hat{v}_t^j = y_t - x_t^j$. After that, I resample the particles with stratified resampling. Now $\sum_{t=1}^n\ln \left(\sum_{j=1}^N \mathop{p}(\hat{v}_t^j)/N\right)$ gives me my approximated log-likelihood.
The problem is: It works very poorly. If I deviate a little from the true parameters, the likelihood gets, as expected, smaller. However, there are always alternative constellations which give me a higher likelihood.
Let's suppose e.g. I have $n=1000$, $N = 10000$, $\alpha = 0.5$, $\beta = 0.3$, $\sigma = 1.0$ and $\delta = 1.0$. Then my likelihood is significantly lower for $\delta = 1.1$, but the overall estimate can be extremely poor (e.g. all paramters deviate by $0.5$ from their true state).
Does someone have an idea, what goes wrong in my example?
Answer:
The problem is: It works very poorly. If I deviate a little from the
true parameters, the likelihood gets, as expected, smaller. However,
there are always alternative constellations which give me a higher
likelihood.

This is to be expected. The approximation is just that--an approximation. The approximation's variance tends to increase for parameter constellations far away from "truth," too.

...but the overall estimate can be extremely poor

You didn't tell us how you're estimating the model. What algorithm? How are you tuning it? What's your data? This is a nontrivial estimation task.
Comment: Thanks! I used stratified resampling (clarified in link).


How frequently should I request additional credit?

Question: Assuming I simply want additional credit to improve my credit utilization ratio, how frequently (how long between requests) should I request the credit increases?  What negative consequences should I be concerned about if I request credit too frequently, and how big of a problem might that reasonably be?
Answer: I don't know of a guideline to how often you can ask for an increase. You can ask as often as you like.
As for consequences, refer to Is there a downside to asking for a credit increase?, where the consensus is that, aside from a possible (temporary) hard pull on your credit report, there's probably no risk to asking.
Depending on your credit score/history, and especially in the current economy, you may get "no" as an answer most often. You can try talking to your card's Credit Department or even Customer Retention Department as they may have more leverage. They may say yes or no or that they need to review your account.
When you do ask for an increase, I would make sure to ask if there will be a hard pull on your report, if there is any cost or downside to applying, and to make sure that this would be an increase to your current credit line, not a new account.
Answer: I do this all the time, my credit rating over time plotted on a graph looks like saw blades going upward on a slope
I use a credit alert service to get my credit reports quarterly, and I know when the credit agencies update their files (every three months), so I never have a high balance at those particular times
Basically, I use the negative hard pulls to propel my credit score upwards with a the consequentially lowered credit utilization ratio, and the credit history.
So here is how it works for me, but I am not an impulse buyer and I wouldn't recommend it for most people as I have seen spending habits:
Month 1: charge cards, pay minimum balance (raises score multiple points)
Month 2: PAY OFF ALL CREDIT CARDS, massive deleveraging using actual money I already have (raises score multiple points)
Month 3: get credit report showing low balance, charge cards, pay minimum balance ask for extensions of credit, AND followup on new credit line offers (lowers score several points per credit inquiry)
Month 4: charge cards, pay minimum balance, discretionally approving hard pulls - always have room for one or two random hard pulls, such as for a new cell phone contract, or renting a car, or employment, etc
Month 5: PAY OFF CREDIT CARDS using actual money you have. (the trick is to NEVER really go above a 15% credit utilization ratio, and to never overleverage. Tricky because very quickly you will get enough credit to go bankrupt)
Month 6: get credit report showing low balances, a slight dip in score from last quarter, but still high
continue.
Comment: No judgement, but I am curious as to why you do all of this effort.  Are you rebuilding, or just building?  How many times have you done this?  If you don't mind, what number did you start at and where have you made it to?
Comment: @MrChrister above comment for you,  but in reality it really isn't that much effort. Its just knowing when I can make a minimum payment vs a well-timed bigger payment. And the credit reports come automatically. its more effort for everyone else that has to request them.
Comment: multiple goals, `1)` building `2)` getting to avg 800 score without having a long credit history. the main point being access to capital in case I ever really wanted to leverage up. For instance, I never go above a credit utilization ratio of 15% so if I spent $5000 that means I would have at least $33000 completely unsecured. Banks weren't lending for a while and I saw what happened when other people couldn't access capital. In general many of my decisions lean toward avoiding future liquidity crisis. Taking advantage of FICO score computations are a small part of it really


Get user security attributes on AIX 5

Question: Is there a way to get user security attibutes (like password expiration warning time, maximum age for password and so on) by AIX 5 API?
Answer: Look at the getuserpw() API for password information, and getuserattr() for the more generic user information.
Note that you will have to be a member of the appropriate group(s) in order to access the files in /etc/security.

Get user security attributes on AIX 5


German keyboards for recent model Mac lap-top

Question: I have an apple lap-top with an external keyboard.  My computer has the capacity to compose in German  (a capacity I need) but my keyboard is in English and many crucial keystrokes (extra characters, punctuation, etc.) are different on the German layout. Since I have to plug in my external keyboard any way, why could I not buy a German external keyboard to plug in when I have a lot of German stuff to type? Where could I buy such a keyboard?
Answer: You don't need a German keyboard to use the German keyboard layout. You can enable the German keyboard layout from System Preferences > Language & Text > Input Sources, and you can use the virtual keyboard viewer to look up the positions of characters.

Even if you buy a keyboard with a German keyboard layout, the input source won't change automatically when you connect the keyboard or press some keys on it.
You can buy keyboards for different keyboard layouts from store.apple.com.
Note that there are some differences between the Apple and standard PC versions of the German keyboard layout. Particularly the five ASCII special characters under option are all under different keys. You can download a keylayout file for the PC version from http://www.nullpointer.de/stuff/keylayout/.
ISO (European) keyboards have one more key than ANSI (U.S.) keyboards. The extra key is a dead key for <code>^</code> in both the Apple and standard PC variants of the German keyboard layout. In the version of the German keyboard layout that is included in OS X, option-shift-6 enters the same dead key state as the extra key.
Comment: There are numerous companies that sell plastic overlays for the different laptop keyboard, with the various layouts. With these covers, you don't need to memorize the layout or keep the Keyboard Viewer visible. (Google "apple keyboard cover"—I have no connection other than customer with any of the sellers.


How do I access my personal vehicles?

Question: How do I access my personal vehicles as I have 12 but no clue as to access them?!??
Comment: You can call you mechanic with your phone and select the vehicle you want
Answer: I'm fairly certain your question has been asked before, but I have no way to find out, so I will answer it anyway.
To access your personal vehicles, you simply have to call your mechanic on your in-game phone. As long as you are in an area where the mechanic can deliver the vehicle, and it's not impounded or destroyed, he will deliver it to you. There is a short cooldown on this, however. Also, if you have not paid your mechanic within the last 24 hours in-game, he will be unavailable until the next time you pay him.
Alternatively, you can visit your garage to grab a vehicle, or, if you already have one out, but it's not nearby, you can use the interaction menu to call it to you.

How do I access my personal vehicles?


Does peanut butter need a Hechsher

Question: What's the Halacha regarding whether Jews may eat peanut butter without a Hechsher? If they buy peanut butter from gentiles, do they require a kosher certification to eat?
Answer: There are actually two questions here, though they are related:

A.) Do we recommend today that people buy peanut butter without a kosher certification?

Really not a good idea. Today's peanut butters usually contain non-peanut oils/shortenings, which can in turn be processed on lines with animal fats.

B.) Are peanuts subject to a special Talmudic law requiring Jewish preparation, as is the case for wine, cheese, or milk?

No way. Peanuts are a New World crop. Could they be subject to the rule of bishul yisrael, that foods which can only be eaten cooked and are served as a standalone item at a royal banquet, have to be cooked by Jews? I think peanut butter fails on most of those criteria pretty easily.
So we have two reasons why something would need a hechsher: there's a Talmudic law inherently requiring one, or we're just concerned about the way it's made in 2024. A good way to determine between those two categories is to search for "peanut butter" in the London Beth Din's Kosher Search (of course, this only applies to products sold in the United Kingdom).

Some peanut butters are determined "not kosher." Presumably they are processed on lines that also do not-kosher, or may include not-kosher additives.

Some are "approved, though not certified." The contemporary British rabbis did their homework about how they are made, and concluded it should be fine. But there isn't a rabbi in the factory. You won't find cheese or wine in this category, because by Talmudic decree, those need Jews involved in the manufacture. But "made by non-Jews, with their reputation on the line that the processing aids etc. are all kosher", is kosher enough for peanut butter.

And some are actually "certified", with the rabbis doing regular inspections.

Does peanut butter need a Hechsher


installing numpy for python 3.1.2 on Ubuntu 10.04

Question: I have installed numpy for python 2.6.5. I want to use it for python 3.1.2 and I don't know how to install it. I'm new to ubuntu and I don't know how to install it from tar file. I am using Geany for programing in python3.  If I managed to installed it from there would it work in Geany?
Answer: I have tried it on Ubuntu 11.10, but this should work. Download the numpy-1.6.2.tar.gz from sourceforge than open a terminal:
<code>sudo apt-get install python3-dev build-essential
tar xzf numpy-1.6.2.tar.gz
cd numpy-1.6.2
sudo python3 setup.py install
</code>
Than you need to wait for converting from python2 to python3 and to compile.


Sell bitcoin to account

Question: So let's say I have multiple bitcoin addresses (some of them already received bitcoins), created a new bitcoin address, received bitcoins on it and would like to use the very same address to send them elsewhere - how can I do that?
Comment: Does very same address means the newly generated address?
Answer: Most wallets don't pay attention to which addresses you "send from", and for most purposes it doesn't matter.  When you try to send coins, they will select inputs from among all the transactions paid to all your addresses, hopefully in such a way as to minimize your transaction fees in the long run.
However, some wallets, such as Bitcoin Core, have a "coin control" feature that lets you manually select the inputs for a new outgoing transaction.  You could use this to choose only inputs that come from your desired address.  But in most cases there isn't any need to do this.
Answer: your question is very vague and it is hard to help because you have not specified your bitcoin wallet, so I will assume you are new to this.
Yes-just like cash you can transfer bitcoins from one wallet to another.
To do this, you will need:

Your bitcoin address
The private key associated to it (think password)

Most wallets keep your private key stored for you, so you really only need to be able to access your wallet.
Finally, because you have not specisified what wallet you are using, the next step can vary.
Most wallets today have a simple send button. Simply type the address you want to send coins to (from a wallet that has a balance), and type in how much you want to send.
From the looks of your question, it seems like you lost private key or don't have access to the wallet. If this is the case, the coins are lost forever.

Sell bitcoin to account


VoltDB Logging Level

Question: How much (estimated percentage) is going to worsen the response-time of the database if the logging level is lowered to "DEBUG". ?
Answer: I work at VoltDB. I wouldn't recommend setting the overall logging level to DEBUG except perhaps for a DEV environment for limited tests. It's hard to say what % the performance impact would be. Everything might be a bit slower, but there could be a lot more GC triggered which can have an unpredictable impact.
You can adjust the level for specific loggers, if you have an idea of the area of functionality where you want to see more detail. We have a howto guide on configuring logging here: https://github.com/VoltDB/voltdb/blob/master/examples/HOWTOs/ConfigureLogging.md

VoltDB Logging Level


ElasticSearch stemming with protected words

Question: I'm using ElasticSearch (via Ruby, Tire) for a search feature on an ecommerce clothing website. I need a stemming filter, BUT I also need to be able to specify a list of protected words which do not get stemmed. Currently I'm using the snowball filter for the stemming, but I can't figure out if it's possible to specify protected words. I've also looked at some other stemming filters:

Porter Stem seems to be too aggressive with it's stemming, leading to weird confusions
KStem seems to be english-only, and this is for a multilingual project
Stemmer claims to be like snowball but more feature-full, but I can't find any good documentation about it

My question is this: Is there a way to achieve these goals with snowball (and if so, how?) or do I need to switch to one of the other stemming filters?
Answer: Use the Keyword Marker filter:
https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-keyword-marker-tokenfilter.html