Friction on tyres

Question: The force of friction is directly proportional to area of contact. But then why do the tyres of trucks and other large vehicles have big gaps in them? It reduces the area of contact so frictional force should be else. But by observation it is seen that it provides more friction. Can you please explain the reason for it?
Comment: Have you seen Formula One car tyres, during the course  of  one race they may have to change the tyres, if the weather changes......why?
Comment: *"The force of friction is directly proportional to area of contact ."* This needs to be understood carefully to be correct. In fact at low pressures and with many materials the force of friction appears to be insensitive to the area of contact (this is the usual approximation in introductory classes). Can you say in more detail what you understand that sentence to mean?
Comment: Formula one car tyres do not have treads in them because they drive on dry tracks. If the roads are wet they need to switch to tyres having treads to avoid slipping.@Countto10
Comment: @dmckee. P=F/A , as the area increases the pressure decreases and therefore cancels out the increase in friction
Comment: Being an American, I've seen loads of commercials for car tires that explain in neat animations that the treads ('gaps') direct the flow of water away for diving in inclement weather. I suppose you have not seen such commercials?
Comment: **But by observation it is seen that it provides more friction** Where did you source this from?
Comment: Sorry Iam just a 12th standard student.I don't know much about it,I said that statement according to my observation.
Answer:
The force of friction is directly proportional to area of contact.

This is largely counteracted by the reduction of the normal force per unit area with a larger area of contact. Taking this to the extreme yields the physics 101 assumption that area of contact plays no role in the frictional force. Strictly speaking, this is of course incorrect. It's physics 101, after all.
One need only to look at cars built for competitive racing to see that this is indeed incorrect. The designers of those cars go out of their way to shed all excess weight. Race cars would use the skinniest (and lightest) tires possible if surface area didn't matter. Race cars from 100 years ago did indeed use the skinniest of tires. Developers of race cars quickly found that tire size does matter. The relationship however is nowhere near linear.

But then why do the tyres of trucks and other large vehicles have big gaps in them?

If you know the road will be perfectly dry, the best tire to use would be a slick. What if the road isn't perfectly dry? Slicks and wet roads are a dangerous combination. With slicks, the coefficient of friction can be over 0.9 on dry pavement but less than 0.1 on a wet road. Tires intended for everyday use have grooves. These grooves do two things. One is that they give the water somewhere to go so that there is some water-free contact between tire and road. The other is that they channel water away from the tire. While those grooves do hinder friction on perfectly dry pavement, they drastically improve performance (compared to slicks or skinny tires) on wet pavement.

Reference: Personal. The tires on my car are 295/35ZR18 99Y (rear), 275/40ZR17 98Y (front). That means if I was foolish enough to desire to do so, I could drive in excess of 300 kph on dry pavement without worrying that the tires might melt (and my car supposedly can do that and more). Wet pavement is a different beast. My car has a desire to go sideways on wet roads -- and I don't have slicks.
Answer: "It reduces the area of contact so frictional force should be else."
It is important to note that the area of contact does not at all change the friction that you experience. You can work out the equations and see that kinetic friction only depends on the material and mass of the object when on earth. Basically something with smaller area will have more force in that small area, counteracting the effect.
Grooves on tires prevent hydroplaning.
Comment: Ok I just read an article here and it said that friction depended on surface area, which I am fairly certain is wrong in general. Maybe someone can explain how the scenario differs for tires if it is correct. http://boson.physics.sc.edu/~rjones/phys101/tirefriction.html
Comment: I don't know the topic of friction as well as I should, but tyres  obviously  heat up during driving, so although  I don't know if you consider adhesion to be the limiting case of friction, but possibly that's part of the reason tyres are different. Race car tyres are definitely designed to be literally sticky, at the cost of increased rolling resistance and fuel consumption.
Comment: @Goldname: What you read is correct. That "the area of contact does not at all change the friction that you experience" is an introductory physics **assumption** and is incorrect. The actual relationship is quite complex. Look at it this way: Race car manufacturers go out of their way to eliminate excess mass. Race cars would use the skinniest of tires if what you were taught is correct. They instead use big fat tires that weigh a lot.
Comment: @DavidHammen That is interesting but also terrible that they teach this then. Is there a more general form for the kinetic friction formula then? Do know of any readings about this?
Comment: No, it's not terrible they teach this. Exactly the opposite. That friction is independent of surface area is approximately correct. The details are incredibly complex.
Comment: @DavidHammen and Goldname, that "assumption" is not incorrect. The friction expression *does* include contact area when you derive it, but other parameters in it depend on a area as well. In the end, area cancels out (for small normal forces). The result is that contact area doesn't change the friction force, so that sentence is not incorrect, and that is very much in agreement with reality (remember, only for small normal force)
Answer: "The force of friction is directly proportional to area" and also
to the downward presure over that area.
For a car or truck, with flexible tires, the tire gage tells you the
tires' (circa 30 psi) internal pressure, and the 'area of contact' is
just the weight of the vehicle, divided by that tire pressure.
No matter how the tires are arranged or patterned, the downward pressure
times contact area is the weight of the vehicle.  The pattern
is intended to break the lubricating film of water when roads
are wet.
So, big trucks can pull more, because they weigh more (put more weight over
the driving wheels).
Answer: For the case of tires on a road, the surface area is unimportant. Here's why.
The frictional force is proportional to the normal force, the force pressing the two surfaces together. Let's compare a slick, tire A, with no treads at all to a treaded tire, tire B. Suppose B has only half the surface area of A. Either tire on a given car will experience the same overall force pressing it into the road, the weight of the car over that contact point. In the case of tire A there is twice as much area over which to spread that force so the force on any given unit of area is only half as much as the force on a unit area of tire B. Tire B has only half the contact area of tire A but each unit of area has to support twice the force. Twice the force per area x half the overall area = same overall normal force contributing to friction.
The purpose of treads in tires is to provide a place for the contact surface in which to press the water, avoiding a lubricating layer sandwiched between tire and road.
The puropse of slicks, according to Paul Hewitt, Conceptual Physics, is to provite a large surface area with which to dissipate heat from rapid accelerations.

Friction on tyres


Toilet bowl fills very slowly unless the shut off valve is turned off and then on again

Question: The toilet bowl is filling up very slowly.  When I take the back of the toilet off, I see that there is only a little bit of water going into the fill up tube.  I then found that if I turn off the water to the toilet and then turn it back on again, the water pressure is perfect and the toilet fills up normally.  Do I need to change the water shut-off valve or is it something in the tank that needs to be fixed?
Comment: Did you ever solve this?  I'm having this exact problem as well. From the water being shut off, first flush fills normally and very very fast.  Every flush after, there is a clear and visible leak from the fill valve as I can see water streaming out from under the cap. But turn the water off and back on again and INSTANTLY everything is perfect again.  How can it be a bad fill valve if this "fixes" it every time?  I'm really stumped.
Answer: Some fill valves turn the water down if they detect a leak, sounds like yours is malfunctioning, that or scale, rust, gravel sticking in the valve. Some can be cleaned by turning the water off removing the top of the valve and turning the water on just a little. Putting a cup on top of the valve allows a higher water pressure. If the fill doesn't improve a replacement will be needed. Not all fill valves can be cleaned.
Answer: I had the same problem. I called FluidMaster tech support, and they explained that the little black valve seal that seats in the top cap of the shutoff valve was probably sticking due to brittleness over the years, and so it would not move to open without added water pressure from turning off and on the water supply to the toilet tank.  I replaced the seal, Fluidmaster part 242, for about $3 from Home Depot, and the toilet flushing was returned to normal operation.  The seal is quickly and easily replaced by hand, in a few seconds, no tools needed, instructions on the back of the package.
Answer: It could either be the shutoff valve or the fill valve in the toilet. If your shutoff is a gate valve (turn it many times to open and close), these sometimes are affected by mineral deposits. Replacing this with a quarter turn ball valve is pretty straight forward and will ensure reliable service for the indefinite future.
Replacing the fill valve is also pretty straight forward and these do indeed fail.
I would probably start with the shutoff and if that doesn't solve it move on to the fill valve.
Answer: I had the exact same problem.  For me trying to clean the fill valve of sentiment did not help nor did the cup on top.
For me, I needed to replace the fill valve seal which has gotten a bit distorted over time.  I went out, and for less than $3, bought a Fluidmaster 242.  Just slide off the old seal and slide on the new seal after removing the top of the fill valve.


Doctrine 2 - One-To-Many with multiple Entities

Question: I have a few Entities that I would like to be able to map Comments to (Profiles, Posts, Images, Videos - things like that).
Each of these Entities has a column that contains a guid, and what I would like to do is have the Comment table hold the guid to the item to which it belongs. What I can't figure out is how to configure Doctrine to handle this kind of thing so that the joins work. The solution I think might work is to use NativeSql (although I am not sure that will work either), but would rather not have to do that if at all possible.
I don't imagine I am the first one to encounter this problem, so I hope someone out there can help!
Thanks.
Answer: I think you can use inheritance mapping for that, can't you? You will need something like CommentableEntity, from which Profiles, Posts, Images, Videos are inherited.
It adds some overhead and you need to check if it's ok for your task.


Is this moka still safe to use?

Question: My Bialetti Moka has porous holes that seem to go beneath the surface. These pictures show those small holes.

(click to enlarge)
Comment: Can you elaborate why you think it might not be safe? Are you concerned about the integirty of the device (catastrophic failure during brewing) or with the apparent disappearance of metal (and the possibility that you have ingested it)? Also, is your pot made of steel or aluminum?
Answer: Safe or not, I think it comes with the territory.  I've had mine (2 actually) for 5+ years now and it is quite pitted, itself.  I think this is naturally what happens when (mineral) water boils against metals.  I don't know how relevant it is, but I tend to get right to enjoying my coffee, and neglect the moka. Coffee (acidic) seeps down into the reservoir, and I suspect that might contribute to the pitting.  I have no doubt that I've drunk this metal, but thankfully being a food product it is a safe metal; they don't make these things out of lead, you know.  I'm no chemist, biologist or doctor, but I have had a fair amount of experience with a couple of mokas and friends who also use them, and they all inevitably pit.  I don't know if it's safe, but it seems to be the norm, and I have yet to hear of any recalls. Bialetti is a reputable company. And the FDA (or whoever) wouldnt approve a food product that was dangerous.

Is this moka still safe to use?


What are some other sentences with the same meaning as "I'm calling in regards to a laptop I recently purchased."

Question: I'm struggling to come up with any other sentences that inform the listener at the other end of the phone of the reason for the call; so, any sentence of the form "I'm calling ... [reason]". The main sentence format I'm interested to know is the one with the word "concern". I'd appreciate it if you could educate me on this type of sentences.
Answer:
I'm calling about a laptop I purchased.

This is probably the most informal way to say it, although it isn't generally considered rude. See (preposition) definition 4.

I'm calling concerning a laptop I purchased.

This is slightly more formal than "about" but fundamentally means the exact same thing.
Your example sentence sounds fine in normal speech too, although it is a fair bit more formal than the other two. It's also more commonly heard as "with regards to" rather than "in regards to", although I've heard both. "Regarding" also works.
Comment: I would question the use of **with regards to** in the plural. In the sense of**concerning**, the phrase would be **with regard to** in the singular. **With regards to** might be used in an entirely different context, as in signing off a letter: **With (my fondest) regards to the family....** https://writingexplained.org/with-regard-to-or-with-regards-to


I want a point and shoot to take pictures inside an auditorium without a flash?

Question: Is there a point and shoot camera that will allow me to take pictures in an auditorium without using flash?
Comment: Can you provide more details about the subject and setting?  For instance, are you trying to photograph a music performance in an indoor stage, light by stage lighting?
Comment: Yes: any point and shoot will take pictures in an auditorium without flash. Or in other words: you need to be more specific about your requirements - two very important things are what is happening in the auditorium and how far away from it are you likely to be?
Comment: As long as you don't mind them being dark and blurry there are a bunch that will! Even with it, most P&S camera's don't have a powerful enough flash to reach the front of an auditorium from most of the seats.
Comment: "I want a point and shoot to take pictures inside an auditorium without a flash?" also unfortunately is not really a question, the answer would have to be "well, we don't know; do you?".
Comment: What is your question really?
- How to use a point and shoot without triggering flash? There should be a menu or dial option (lightning drawn over with a line).
- Is there a point and shoot that is SENSITIVE enough in an auditorium without flash? It depends on the lighting. The easiest would be: ask a friend who has a good DSLR camera to make a good shot without flash (one that is acceptable for you), then provide us with Shutter+Aperture+ISO he used, and then we might be able to help you selecting a point and shoot.
Answer: Yes. Sony RX10 is among the best point'n'shoot cameras in a dark auditorium because it has a relatively large image sensor (1") and what's even better it has a f/2,8 constant aperture zoom lens to let you "get close". The constant aperture means that you have the wide aperture in use through the full zoom range.
The bad news is, it is not cheap. Amazon currently sells it for $1300.
There is a question "how do I tell which point-and-shoot cameras can take good low light photos?" which may be of help when you try to find a camera cheaper than the Sony RX10.
Comment: Should the question be edited to read "Is there a point-and-shoot camera that I can sneak into an event venue that will allow me to take pictures without using flash of an entertainment event in a large venue that likely has *no photography allowed* printed on the ticket?"
Comment: You are right, but it looks like a DSRL... In a lot of places you will not be permitted entry with it (Pepsi Center in Denver, for example).
Answer: Disable your flash, via menu options, and take the picture (if your uncertain how to do so, take a look at your camera's manual). Most compacts include an icon with a thunderbold with a slash over it, like this, on its mode dial wheel. That's the one you should use.
Comment: Enabling spot metering if it's available is also useful, as concert situations typically have a brightly lit stage surrounded by blackness, which will give bad exposure results under default autoexposure settings.


is functional requirement is necessaryfor wireframing

Question: Is there need of functional requirement for creating wireframe?
or low level requirement is enough for wireframe design.
Answer: This is more of DEPENDS type of question which depends on how and to whom you are explaining your product.
But on the same phase if you are asking in general, then of course, yes it is mandatory to do Requirement Gathering(Business, User, System requirements) to have a better user experience.
Additional
I recommend you to read Jesse James Garrett's The Elements of User Experience.
He has explained the five stages of UX in a very good manner.

You can see that Scope is the second where we focus on the requirements and Skeleton is the fourth stage where the wireframing part comes.
Happy UX.


mistake in passport no while booking slot for visa @vfs .how to rectify

Question: while booking an  appointment  for visa to Italy, I made a mistake in typing my Passport No. Instead of R***** , I might have typed T*****. Except this mistake, all are informations are correct. How to rectify this?
Answer: You'll have to cancel the appointment and make a new one with the correct passport number.
According to vfsglobal official FAQ:

I made a mistake while booking an appointment or I entered the wrong passport number while booking an appointment. What should I do?
All data submitted while booking an appointment must be correct, otherwise you will not be allowed to enter VFS Global premises . If you made a mistake while booking an appointment, please cancel it through the appointment system. You can book an appointment with the correct information right after.


Accompanist qualities?

Question: I was just wondering if there are certain qualities that makes a good piano accompanist for violin musicians? Can two musicians who just met be able to deliver a good music or do they need to establish a certain kind of relationship or rapport and understanding of the piece for them to be able to perform the music/song well? Thanks.
Comment: I've once heard that there are basically two different kind of teacher: a) focussed on the subject he is teaching, b) the relationship with the students. I think the cooperation among musicians is similar. People who have the same goal and the same interest in style and view of interpretation may become good friends. And when both aspects come together the work will be  perfect.
Answer:
being an accomplished musician.
being a good reader.
being a good listener.
being a good interpreter of body language.
being capable of 'going with the flow'.
being capable of playing as part of a team, rather than an individual.

Just some attributes of a player being successful playing with others. Particuarly someone whom they haven't met or played with previously.
It does happen at gigs where deps are used. A good dep will have the above qualities as a minimum. As long as any egos are not allowed to intrude - from either side - the gigs go successfully.
Of course, once a rapport is established, the players will complement each other even better. Some players need that 'rehearsal time' to establish a closer musical relationship. The times I've sat in with complete strangers, and the music has worked like magic, as if we'd all played together for years, are the best times to be had!
Comment: This list applies to both - or **all** musicians in a chamber ensemble.  Even for sonatas, the soloist should be aware of the pianist, particularly in passages where the piano leads.
Comment: "Go with the flow" is important.  For example, you may have to be able to figure out which pages the soloist just skipped and adjust accordingly.
Comment: @CarlWitthoft - I aimed my answer at **any** musician playing with another - whether an acccompnayig pianist, a harpsichordist in an ensemble, a dep drummer in a band, etc. Same set of crieria for all, I believe. And there's probably a couple i've missed out.
Answer: It's also important to be able to transpose things like the Schubert Lieder (or Brahms) at sight. Sometimes the singer (or whoever is being accompanied) had a late night and one may have to move the key. (Of course, different singers may sing a piece in different keys.)
Comment: @CarlWitthoft - 'skill set' - 'qualities' ? Not all (or that many) good sight readers can transpose.  Who's splitting hairs? A dv as well?
Comment: This is really just a "skill set."  The instrumental soloist has to be able to handle whatever's written in their part as well.
Comment: @Tim These things vary as the skill level of the participants increases.  I wouldn't expect a lower-level singer to have transposed the voice part either.
Comment: @CarlWitthoft - skill levels weren't in the OP's question. This answer pointing them out is relevant. I've been asked many times to transpose on the fly, at different levels. Problems often were singer not knowing what key they needed. Shouldn't be a problem for a violinist, though - I doubt they **ever** play a set piece in any other than the written key...
Answer: You need musical rapport.  It can come very quickly, or not at all.  Sometimes one participant can feel a performance had enormous rapport, the other can feel they were railroaded!
Yes, there are particular skills useful to a professional accompanist.  Transposition at sight WILL be required, but it shouldn't be in a performance.  When a singer hands me music in the wrong key my position is 'Yes, I can transpose.  But would you rather I used all my brain in playing WELL, or half of it in transposing?   Of course, with experience, there will be many items in your particular field of music that are so familiar that playing in any key is a trivial problem.  I'm thinking of theatre auditions. If a singer has mislaid their music, it's fine to say 'Can you manage Over the Rainbow in A? (Or any other key.)   But it's NOT fine to hand me a Jason Robert Brown song and ask for it down a third :-)
Answer: The best basic of making music together (apart of practice skills) is love, empathy and (self-)respect, staying modest and no leadership aspiration. When needed the leader function can be shared by job rotation.
(Almost always in a pair situation there is a difference of hierarchy or competence but it is good when this role can be exchanged by deceiving the functions: soloist - accompanist.)
Comment: Not extremely useful, honestly spoken. But clear, yes. I'm sure the answers will be opinion based, because not everybody is focussing  at the same objects. I can't make music with others when the chemistry isn't ok. Others are keeping their main emphasis on the music itself. Well, and in general I find most of the questions are not so useful: too specific (e.g. mine) or too banal, or formulated that hardly someone else will find it in the internet. I wonder sometimes  how the system can identify the relation with other similar questions.
Answer: It takes a lot of different skills. Probably the best accompanist I ever encountered was the assistant organist at Holy Name Cathedral who, when I auditioned for the choir, took a piece of sheet music I had cobbled together from memory which didn't include a full accompaniment (just the melody and no chords for the first two lines) and knowing nothing more that it was Massenet and one of the missing chords from the melody-only section which I remembered, sight-improvised a perfect accompaniment for me.
I'm a slightly better than mediocre piano player but I ended up playing piano for a church gig for a few months—when I was gone one week for vacation, the teenage cantor's mother subbed for me. Despite being an arguably better piano player and having more access to her daughter, she found it really difficult to be able to handle the go with the flow aspects of accompanying her daughter as she sang.
Overall, I'd say that the most important skill is the ability to listen and react in real time while playing. It's not always correlated with musical skill, although at least some musical skill is essential.
Answer: You can't go wrong by listening to this recording of "The Unashamed Accompanist" by the great Gerald Moore:

And then, I would find his books (listed in the Wikipedia article I linked) and wear them out.
Moore was every bit as great a teacher as he was an accompanist.

Accompanist qualities?


bitcoin-cli: Get transaction count of wallet without listtransactions

Question: I am trying to find a way to get the number of transactions returned from the JSONRPC interface without relying on listtransactions. The reason for this is that if the wallet has too many transactions (like hundreds of thousands), it can easily flood the node's memory and cause a crash. So I would like to know if there is a less intensive way to get just the number of transactions, so I can use listtransactions with the skip= and count= parameters to iterate in reverse order.
Answer: OK, so I found an output field in getwalletinfo called "txcount" in the top level of the output JSON that will list the number of transactions inside the wallet.
{
  ...
  "txcount": 680899,
  ...
}


Unity - are particles rendered and calculated when off-screen?

Question: I have a scene where I have a lot of instances of the same particle system. As the game will go for mobile, I fear the particles are calculated even when they are not shown. So to cut it short, I would like to know if the particle system is being calculated and rendered even if off-screen.
Comment: This seems like the kind of question you could easily answer for yourself by creating two scenes: one with a hundred particle systems in the camera frustum, and a duplicate scene with all 100 particle systems moved outside the camera frustum. Profile the two scenes on your target hardware and compare the results. This will tell you not only whether offscreen particles have a cost, but precisely how much, and whether it's even worth worrying about for your needs, all with zero Internet hearsay in the mix. ;)
Comment: Fair enough, though I usually get some additional wisdom on these forums other than "yes or no" :D I think I will disable those particles if off-camera, they have a warmup anyway.
Comment: This is exactly the kind of internet hearsay I was warning you about. You've currently accepted an answer that says nothing about the costs for the actual case you're asking about. It's a good way to reduce fill rate costs of drawing overlapping particles, but it says nothing about the costs for systems outside of the rendered area.
Comment: Thanks for the warning. Well I just asked a _boolean_ question, basically "yes or no"?
The answer says "yes they are calculated" and I asked in the comment below the answer for clarification and was told "in my case it's probably no big deal". I'm focusing on finishing the game and optimize this later should the need arise. I'm this sloppy because time is of the essence now :/ spent way too much time on this game already. I don't plan to use that library though :D I might turn the particle systems on/off by camera visibility or player distance.
Answer: Yes they are calculated when offscreen as stated in this library's README (this was quite a problem for them). What is cool is that this library can be used to lower the performance lost by using a second camera. If you don't have much particles then it's not worth but it might be a great improvement if you run a game heavy on particle :

In our game, we're drawing several dozen screens worth of overlapping
  particles, so the speedup is pronounced.
Comment: You will have to try it out, perhaps on different mobiles (especially on one that is not really performing well) but I think it is not a problem at all. 600 particles is nothing if you have no big shader or complex movement.
Comment: Note that the linked library, despite its name, is for speeding up the rendering of ON-screen, visible particles. They talk about fill rate as the primary cost they're optimizing, and you pay that only in-frustum. Their *solution* was to treat these particles as "off-screen" in the sense of not being drawn by the *main* camera, and instead viewed by a secondary camera rendering to an off-screen render target at reduced resolution, then upscaled and composited into the main view. So this doesn't actually answer the original question about costs of particles out of frustum.
Comment: Thanks for the answer.
by "lot of instances" I mean 20-30 instances of particle systems, each having 30 maximum particles. Is that a lot for mobile? No fancy shader, and just some basic floating up movement with some mild turbulence.


How does a HTTP Proxy utilize the HTTP protocol? a Proxy RFC?

Question: How does one go about implementing a HTTP proxy compared to implementing a HTTP webserver, what are the differences? Is there a definitive guide or RFC or a helpful book on this subject?
Answer: The header sent to a proxy is different.
For example, here is what is sent by Google Chrome to www.baidu.com via a proxy server:
GET http://www.baidu.com/ HTTP/1.1
Host: www.baidu.com
Proxy-Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
DNT: 1
Accept-Encoding: gzip, deflate, sdch
Accept-Language: zh-CN,zh;q=0.8

We can see it is
GET http://www.baidu.com/ HTTP/1.1

instead of
GET / HTTP/1.1

and here is
Proxy-Connection: keep-alive

also
Host: www.baidu.com

Host field is required for http proxy.
For HTTPS tunnel proxy:
CONNECT comet.zhihu.com:443 HTTP/1.1
Host: comet.zhihu.com:443
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36

We can see
CONNECT comet.zhihu.com:443 HTTP/1.1

domain:443 instead of https://domain.
CONNECT field turn the proxy server to something like a TCP tunnel, then the protocol HTTPS is replaced by the port :443
For socks5 proxy, things become easy, because socks5 care nothing about higher protocol, you just tell it host and port.
Comment: This answer seems to imply that the `Host:` header is only required for proxy servers. That's not true.  From RFC 2616. *"All
   Internet-based HTTP/1.1 servers MUST respond with a 400 (Bad Request)
   status code to any HTTP/1.1 request message which lacks a Host header
   field."*.  IE this is strictly required for all of HTTP 1.1 not just proxy servers.
Answer: The requirements on HTTP Proxy servers are specified within

RFC7230 - Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and
Routing
RFC7231 - Hypertext Transfer Protocol (HTTP/1.1):
Semantics and Content
Comment: this rfc does not describe anything about https proxy
Comment: @nikoss: The original RFC this answer referenced (RFC2616) was split out into multiple RFCs.  See [section 4.3.6 of RFC7231](https://tools.ietf.org/html/rfc7231#section-4.3.6) for the `CONNECT` method that is used to establish a proxied tunnel over which a TLS session for a HTTPS request can be established.
Answer: A proxy is very similar to a server; the only difference is that, after parsing the request, it merely forwards it and returns the result*, rather than processing the request, itself. Because the proxy does not have to do the same amount of processing as a normal server, it can often get away with a far more minimal parsing of the requests than a full-fleded server, but otherwise it is the same idea.
*Some proxies implement additional caching. Some also futz with the response/request, but that is the evil kind of proxy, which hopefully you do not have in mind.
Comment: Filter proxies are often used to maintain ones privacy. They are also helpful to get rid of unwanted content, like ads, or tracking cookies, and they can reduce the size to transfer. On the other hand simple passthrough proxies may be used to track and record all your activity.
Comment: This glosses over the distinction between a "forward proxy" and a "reverse proxy".  Forward proxies are commonly used for outbound traffic on a network. They interpret different headers sent by the client and must modify the request before forwarding to the target webserver. This answer seems to describe reverse proxies (AKA transparant proxy) which are designed to look like and behave like a webserver in their own right. These may not modify requests before passing forwards.


What are the best/most popular ways to do aspect-oriented programming (AOP) in C#/.Net?

Question: What are the best/most popular ways to do aspect-oriented programming (AOP) in C#/.Net?
Answer:
DynamicProxy from Castle is
probably the most used tool for
doing AOP on the CLR.
Spring framework also offers
AOP capabilities through its
Spring.Aop namespace.
Comment: DynamicProxy is not exactly AOP, however you can archive that in hard way. Spring is a horrible beast.
Comment: @aloneguid Can I know why you say "DynamicProxy is not exactly AOP"?
Answer: Postsharp is another well-known one: "Bringing AOP to .NET!" I only have very little experience with it, but it looks nice and worth having a look at it.
Comment: PostSharp went commercial, not an alternative anymore!
Comment: Why isn't commercial an alternative? Question doesn't specify "non-commercial". Also, there's still a free version of PostSharp (even free to use in *your* commercial product)
Comment: PostSharp went commercial and is really too expensive for a simple developer.
Comment: @B413 There is actually a free Express Edition which supports some AOP: http://www.postsharp.net/purchase
Comment: closed source cut down version is not an option, at least for me. Frameworks like these must be open
Answer: PostSharp is good. I have been using it for about a year now.  It's easy to install and has a fairly shallow learning curve considering the almost godlike power it enables.  Additionally, there seem to be both an active community of developers and a responsive developer.
Check out the code samples on the PostSharp home page.  Those are good examples of simper aspects done with PostSharp.
Comment: too bad it went commercial. :(
Answer: I have been using Spring.Net AOP Framework for about 9 months now. It is pretty powerful and doesn't seem to impose a performance penalty in use even though weaving is done at run-time rather than during compilation. The only things to be aware of are that although objects you are applying advices to do not need to be aware of Spring.Net AOP, they must implement at least one interface. The documentation, which incidentally for Spring.Net in general is excellent, states that this restriction will be removed in a future version but doesn't give a roadmap.
Spring.Net AOP does not require you to use the rest of the Spring.Net framework and can be used in isolation.
Answer: I've played around with rolling my own, for several different types of things.  I've had some luck.  In general, I make an interface, implement it with a class, and then make a proxy which implements the interface, does whatever precondition steps I want, calls the real object's method, and then does whatever postcondition steps I want.  One of the main annoyances of mine with this approach is that you can't have constructors in an interface, and you also can't have static methods in an interface, so there's no real obvious place to put that type of code.  The hard part is the code generation - because you're either going to emit IL, or you're going to emit C# that you have to compile.  But that's just been my approach.  And it forced me to think about one aspect at a time, really - I hadn't gotten to the point where I could abstract out the "Aspect" and think in those terms.  In short: roll your own or find a toolset you like, probably from Eric Bodden's list.


Remote extraction of passwords from browser password managers

Question: I'm writing an essay about "Browser Password Managers". As part of this I have to write about vulnerabilities and exploits. I stumbled across the following scientific paper from 2013: "Password Managers: Attacks and Defenses by Silver et al." (https://crypto.stanford.edu/~dabo/pubs/papers/pwdmgrBrowser.pdf), which describes in section 4 "Remote extraction of passwords from password managers". I don't know if the described "sweep attacks" are still possible today, like in Chrome Browser? What about the same-origin-Policy?
Comment: The attacks are described pretty well. Did you consider trying it yourself?
Comment: This is still applicable, and this is also a reason why XSS are a way bigger problem than just showing an alert box.
Answer: Concept of "origin"
The "same origin policy" can only be as robust as the definition of an origin is. The origin is the entity the browser believes it talks to.
Quoting the paper:

Next, by tampering with network traffic the attacker (...)

The idea that you can modify at least some server answers makes the origin of these vulnerable requests meaningless for security: if tampering is possible at all, it means that some (formal) "origins" don't correspond to the entity the browser is actually talking to; instead the browser is talking to the attacker, while believing it's talking to the legitimate HTTP server.
Without at least integrity of exchanged data (let's put privacy aside for a moment), you don't even have an origin.
(Of course without secrecy of the exchanged data, your password might be captured by an attacker when you log, so both integrity and secrecy matter.)
Note: These security properties doesn't have to come from robust cryptography, you could also log on a server on localhost with clear text HTTP. The OS will prevent the interception of the data on the TCP socket that uses only local routing.
If you don't have a well defined robust origin, you can't expect any protection from the browser mechanisms based on the origin.
When dealing with a remote server, with HTTP, and without lower level protections like IPsec or a secure tunnel protocol to the server, your data is vulnerable and "origin" is ill defined.
The most common vulnerable situation is using http: URLs on an open Wifi, but using the same URLs via a commercial "VPN" also exposes you, but not to the same party: using Wifi exposes you to local attacker (mostly an attack from the owner of the Wifi access point, but not only); using a "VPN" service exposes you to the manager of that service (who can spy on you).
Sound design of public websites (not private tools on an intranet) that deal with private information require the use of HTTPS. The paper insists on the fact that this is far from universal (at least when the study was done):

It is especially easy for sites that serve their login page over HTTP
  (but submit passwords over HTTPS), which is a common setup discussed
  in the next section.

Hosting a "secure" form (one that sends data on a secure URL) on an insecure page is fundamentally, absolutely, definitely unsound. All webmasters should know that. Sadly it isn't the case as understanding of even the most basic facts of the security model isn't required from people who design websites.
Any HTTP request over the Internet is exposed to spying and tampering. Many ignorant Web page designers believe that "secure transport" (HTTPS, TLS) is only for secret data and is a significant and useless overhead for inherently non secret data, like the content of a login form (anyone can see the same login form).
And because they misunderstand the scope of "secure transport" they might put pages that inherently cannot contain private information on an insecure http: URL, making these vulnerable to tampering (and also spying on the who downloads that login page, but that one isn't usually a real concern).
The idea that "https:" URLs only exist for secrecy of informations exposed on a particular page, and the others can be in "http:" must die.
Sub-resources
Also don't forget that any Web page which includes any element that is allowed to contain Javascript code that runs in the context of the page is vulnerable to tampering, so this isn't limited to tampering with the HTTP content of main URL shown in the browser address bar; making HTTPS pages that include JS scripts or even CSS content loaded via HTTP is fundamentally unsound and modern browsers rightly refuse to load these insecure elements by default.
Special permissions for websites
You can't associate a meaningful "privileges" (or permissions) to an "origin" (like the right to access your webcam or your gyroscope) if the origin is insecure and can be usurped by an attacker with network access. That's why modern browsers restrict the permissions that an insecure origin can ask (or limit these privileges in time).
Human factor
It should be understood that these concepts aren't advanced or reserved for security professionals: they should be part of the basic common knowledge of at least all Web designers, and if possible of all users. It should be considered as elementary and obvious as "you don't start a car when the windshield is obstructed by an anti sun anti heat cover".
I didn't want to discuss psychology but there is a strong human factor that I want discuss here because that's what I see as one common reason for failure to take basic security measures.
One practical problem with computers and people is the often dismissive attitude that people who don't have even elementary knowledge have with respect to such knowledge; they often say that "they aren't experts, don't want to be, don't have the time to learn a lot" and "just want to get a job done" (probably as opposed to purists?) - as if more knowledgeable users were just pedants who wanted to have encyclopedic knowledge of computers, had unlimited time, or would want to get nothing done ever but in the most pure and elegant way. I know some people who have encyclopedic knowledge and allocate a lot of time to learn more, but they also want to get some task done (if only: to get to learn even more, which is a task).
Nobody wants nothing done ever, but that "nothing" done in the "purest" way. That's an oxymoron as getting anything done in the purest and most beautiful way would actually get something done and over. The frankly insulting undertone of these remarks is why some people never learn and why other give up on explaining how to properly use a computer to others (that is, to use it to something done).
Like any activity, using a computer for anything, including something as common as setting up a website, requires at least understanding of some basics. But when dealing with computers, almost nothing is really intuitive and we need to explain stuff without sounding pedantic.
Also for websites with millions of users, we need name and shame. Designing a website that doesn't even respect the most basic security principles should be seen as equally inane as driving with the windshield entirely obstructed, and pointing out the inanity of that conduct shouldn't be seen as pedantic.


How to turn on "Hey Siri" when plugged in, but not always on

Question: I would like to have "Hey Siri" on my iPhone 6S when plugged in, but not all the time. Is there a setting for that, or was that feature lost with iOS 9 and 6S?
Answer: "Hey Siri" is now always on, if on, because of the new M9 co-processor; the same one that records your steps. Apparently it can do this without unnecessarily flattening the battery.
See the report from Apple Insider - Apple's efficient M9 coprocessor will let your iPhone 6s track pace, make 'Hey Siri' always on

In a first for the iPhone series, the iPhone 6s will measure a user's walking or running pace when they exercise, without the need for battery draining GPS. Previously, this functionality was limited to the S1 chip in the Apple Watch.
The M9 also allows for Siri to be always on. That means users will be able to use the device's "Hey Siri" voice command at all times.
Comment: Thanks. I know it can be always on, but I want it just on when plugged in, like you could do before. This is mainly because i get too many ghost queries with it in my pocket (and I am not convinced about the battery life assurances.)
Comment: OK, I'll tweak my answer from 'can' to 'is'. There's no battery switch on a 6s, presumably lower phones have no always on, as they don't have the M9. I charge mine every 2 or 3 days, much better than my old 5s.
Answer: If you are getting false positives when you have your iPhone in your pocket, you could prevent "Hey Siri" from working until your iPhone is unlocked by going to Settings> Touch ID and Passcode and scroll down to the "Allow access when locked" pane and switch Siri off.
You won't be able to use Siri at all on the lock screen, but at least you won't get any false positives while your iPhone is in your pocket. I don't allow Siri on the lock screen anyway for security.
Comment: Not allowing Siri on lock screen seems common sense, or else you can tell Siri to DO, FIND, and REVEAL many ticklish things. Just pretend you found your phone and try it out...


Shift + wheel and Ctrl + wheel doesn't work anymore in Blender 2.8?

Question: In 2.7.x it's usefull to pan only in horizontal or vertical, which I use a lot. I searched everywhere and didn't figure out, it doesn't work anymore? This page here https://developer.blender.org/T55194 says just "NO REPLACEMENT".
Comment: I'm voting to close this question as off-topic because it is about unfinished features in experimental versions of Blender
Comment: So, it doesn't exist in the beta? Don't know how could it be off topic, it still Blender and the Beta version, it's almost finished, maybe the shortcut change. Your comment is useless.
Answer: I solved the problem manually add key map item in the preferences.
User preferences - Input - 3D View - 3D View Global - Add new - in field "Identifier operator to call on input event" type view3d.view_pan - then choose your key and action Pan left or right \ up or down.
This is not solved by Import key configuration from blender 2.79.

On Blender 2.83.4:

Click Edit > Preferences.
Click the Keymap tab.
Expand 3D View.
Expand 3D View (Global).
Scroll to Pan View Direction.

At this point, you can change the options to suit your preferences.
Answer: I can't comment so here is an answer:
Fairly sure this is not possible in 2.8 for the moment. This requires specific RNA (?) in the hotkey bind (you can see this in 2.79 when you search using hotkey and for "shift scrollwheel" where there is this unique RNA and "panning" tab on the hotkey you can't get by creating new hotkey)
Since there is no default hotkey entry for this in 2.8 I don't think you can make this without coding. (I tweeted at Pablo, though, so if he happens to reply with solution I'll update here)
Comment: I hope it is not removed, I use this shortcut quite a bit.
Comment: It would be rather big loss :/ but I'm sure it will make eventual return.
Answer: It is User Preferences - Keymap, not Input.
A viable alternative is to activate Zoom to Mouse Position:
Comment: Hi. Please upload images using the built-in uploader: https://meta.stackexchange.com/questions/75491/how-to-upload-an-image-to-a-post Thanks.


SharePoint Enterprise installation

Question: I have SharePoint Standard 2013 Server Sp1 setup files, Now in my production environment I want upgrade my license to enterprise. I have already installed SharePoint. Do I need to re-install SharePoint if not can you share the procedure?
Answer: You don't need to reinstall the SharePoint. Simply update the product key in central admin.
<code>Go to Central Admin -> Upgrade& Migration -> Convert farm license type
</code>
type the Enterprise key and After that you have to enable the enterprise features as well.
http://www.themossblog.com/sharepoint-general/enable-sharepoint-2013-enterprise-features-convert-from-sharepoint-2013-standard-to-sharepoint-2013-enterprise

SharePoint Enterprise installation


vb.net and ContextMenuStrip?

Question: How can I get the Y position of the ContextMenuStrip?
Answer: As far as I know, contextMenuStrips don't have a "location" field. A location is set once it's shown like so:
<code>Dim thePoint As Point = (New System.Drawing.Point(someXValue, someYValue))
ContextMenuStrip1.Show(PictureBox1.PointToScreen(thePoint))
</code>
The previous code creates a point, and as the contextMenuStrip is being shown, it assigns the location right then. If you wanted to retrieve the location of that contextMenuStrip after show() as been called, you can cast the object and retrieve the location like so
<code> MessageBox.Show(DirectCast(ContextMenuStrip1, ToolStrip).Location.Y)
</code>

vb.net and ContextMenuStrip?


Is mkdir still atomic? (Windows 7 filesystems mounted on SAN)

Question: We have some old applications that communicate via directory-based queues. Each item in the queue is a file, and there's a header file that maintains an ordered list of the filenames for the items in the queue.
Naturally, this old code needs to lock the queue while items are pushed and popped. What it's doing is creating a lock subdirectory, on the assumption that mkdir() is an atomic operation - if multiple processes attempt to create a directory, only one of them is going to succeed.
One of my co-workers has been trying to chase down an obscure problem, and he thinks the causes is that this locking is no longer working, when the processes are running on different machines, and when the filesystem in question is mounted on a SAN.
Is there any possibility that he might be correct?
Comment: I've experienced some odd behaviour (since moving to Windows 7/2008R2) related to creating and/or removing directories on a file server.  I haven't been able to nail the details down, but it wouldn't surprise me if your co-workers observation was correct.
Comment: Suggestion: change the code so that when it creates a directory in this way, it also adds a file with a randomly generated (but identifiable) name.  If it later sees two such files in a single directory, you've confirmed that the locking is not working.
Comment: I'm not sure that would work. Seems like the same sort of low-level optimizations that are allowing two mkdirs to happen would be just as likely to allow one program to not see that the other has created a file, until it's too late.
Comment: I don't mean this as a solution, just as a possible way of confirming that what you think might be happening is in fact happening.  While it wouldn't prove that it isn't happening, it might prove that it is!  Another possibility would be to create a global log file on the same share (with appropriate explicit locking semantics) recording directory creation and removal.
Answer: Very old question I know, but I hope someone finds this interesting.
I was also getting confusing results using PowerShell to create a shared folder for use as a mutex, so I created a test script.
function New-FolderMutex {
    try {
        New-Item -ItemType directory -Path .\TheMutex -ErrorAction Stop > $null
        $true
    } catch {
        $false
    }
}

function Remove-FolderMutex {
    Remove-Item -Path .\TheMutex
}

1..100 | % {
    if (New-FolderMutex) {
        Write-Host "Inside loop $_"
        Remove-FolderMutex
    }
}

This script is run while the current directory is in a network share.
When I ran this script simultaneously in two separate PowerShell consoles, it was clear from the error messages that the approach was doomed.  There are a number of different errors produced by the call to Remove-Item, even though it is being called only by the process that created the folder.  It seems that behind the scenes there are a whole bunch of non-atomic steps occurring.
Of course, the OP was asking about mkdir (probably the system call) and my example uses the much higher level PowerShell cmdlets, but I hope this is of some interest.
Example output from one of two processes (edited for brevity)
Inside loop 30
Inside loop 31
Inside loop 32
Inside loop 33
Inside loop 34
Remove-Item : Access to the path 'H:\My Documents\PowerShell\MutexFolder\TheMutex' is denied.
At H:\My Documents\PowerShell\MutexFolder\Test-FolderMutex.ps1:93 char:5
+     Remove-Item -Path .\TheMutex
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (H:\My Documents...Folder\TheMutex:String) [Remove-Item], UnauthorizedAccessException
    + FullyQualifiedErrorId : RemoveItemUnauthorizedAccessError,Microsoft.PowerShell.Commands.RemoveItemCommand

Inside loop 39
Remove-Item : H:\My Documents\PowerShell\MutexFolder\TheMutex is a NTFS junction point. Use the Force parameter to delete or modify.
At H:\My Documents\PowerShell\MutexFolder\Test-FolderMutex.ps1:93 char:5
+     Remove-Item -Path .\TheMutex
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (H:\My Documents...Folder\TheMutex:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DirectoryNotEmpty,Microsoft.PowerShell.Commands.RemoveItemCommand

Inside loop 42
Remove-Item : Could not find a part of the path 'H:\My Documents\PowerShell\MutexFolder\TheMutex'.
At H:\My Documents\PowerShell\MutexFolder\Test-FolderMutex.ps1:93 char:5
+     Remove-Item -Path .\TheMutex
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (H:\My Documents...Folder\TheMutex:String) [Remove-Item], DirectoryNotFoundException
    + FullyQualifiedErrorId : RemoveItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand

Inside loop 44
Inside loop 45


Wifi cannot find available networks

Question: I was facing some issue where wifi is losing internet access within few minutes after connecting. So I did a driver update with driver update software and it update the atheros wifi driver. Still I was facing same issues. So, I downloaded wifi driver from sony website and installed it. After that when I switch on wifi, I cannot find any networks. Also vaio smart network won't let me switch on the wifi but I can switch on bluetooth. So I have found some more related wifi drivers from other sites and installed them after uninstalling existing ones.
I have also uninstalled smart network program in between and reinstalled to see if it is causing the problem.

I have tried system restore but computer is unable to do that.
I have tried installing the driver provided by sony website but still same issue.
Model : VPCEB36FG.
How can I make my laptop wifi work?
Please help me. I am not interested to reinstall my OS.
Btw, does OS installers have wifi driver or should we install it after OS installation?
Answer: Okay first,make sure ur wifi is enabled.by pressing fn button + any f button(in my case it f12)
second try driverpack solution to make sure u having a correct driver.find that at google

Wifi cannot find available networks


How to export raster of Mean Annual Land Surface Temp from Landsat Imagery?

Question: I am using google earth engine to estimate Mean Annual land surface temp of a local scale from 1984 to 2019 from landsat Imagery.
I am having trouble determining a script for my goal, there are many example but the problem is that all of them are calculating the LST for one year.
I have tried this script but I think there is some thing wrong with it and I cannot export the raster of calculated Mean annual LST for my study.
I will be helpful, if anybody could help me to rectify the script. The GEE Code for Export raster of mean annual lsthere
Answer: You can create a function calculating LST for a single year (you already have all the code for the function), invoke it for every year, finally combine the results to a single multi-band image.
<code>function calculateLST(col) {
  // ...
}

var annualLST = ee.ImageCollection(
    years.map(function (year) {
        var colForYear = col.filter(
          ee.Filter.calendarRange(year, year, 'year')
        )
        return calculateLST(colForYear)
          .rename(ee.String('LST_')
          .cat(ee.Number(year).int()))
    })
  )
  .toBands() // Convert ImageCollection to a single image
  .regexpRename('.*_(LST.*)', '$1') // Get rid of 'n_' band name prefixes

Export.image.toDrive({
      image: annualLST,
      description: 'annualLST',
      scale: 30,
      region: geometry
    });
</code>
https://code.earthengine.google.com/0bc544dd0048db04e713cd7f235e2309
Comment: Hi @Daniel thank you very much for your replay. My goal is just calculating the Mean Annual Land Surface Temp for each year separately, I am trying to export the raster images of  Mean Annual Land Surface Temp from 1984 to 2019 which is about 35 images. There is no need to combine all of annual rasters. My code is written for the yearly but It is not estimating Mean Annual Land Surface Temp.


Multiway Systems Rules List Management

Question: I'm working with a multiway system and I have a number of different mutation rule lists. I need an efficient way of managing which rule lists I apply.
Here is the basic multiway system code that I'm using:

MWStep[rule_List, slist_List] :=
  Union[Flatten[Map[Function[s, Map[MWStep1[#, s] &, rule]], slist]]];

MWStep1[p_String -> q_String, s_String] :=
  Map[StringReplacePart[s, q, #] &, StringPosition[s, p]];

MWEvolveList[rule_, init_List, t_Integer] :=
  NestList[MWStep[rule, #] &, init, t];

StepNtimes[Rule_, string_, n_] := (
   i = 1;
   Subfunc[x_] := MWStep[Rule, x];
   Results = Flatten[NestList[Subfunc, string, n]] )

So for example, with a rules list "M1", I might do
StepNtimes[M1, SampleString, 5]

But say I have Rule lists M1,M2,M3,M4,...,MK
And I want to apply them in different patterns and save the results after each application.
That is, if
ResultSetA = StepNtimes[M1, SampleString, 5]
ResultSetB = StepNtimes[M2, ResultSetA, 5]

...
I want
FinalResults = Flatten[{ResultSetA, ResultSetB, ...}]

Nested Functions? Composition?
Answer: k[{data_, {}}] := {}
k[{data_, rulez_}] := k[{Sow@StepNTimes[data, rulez[[1]], 5], Rest@rulez}]
Reap@k[{data, {M1, M2}}]

(* {{}, {{StepNTimes[data, M1, 5], StepNTimes[StepNTimes[data, M1, 5], M2, 5]}}} *)

Multiway Systems Rules List Management


How do you create a cbuffer or global variable that is gpu modifiable?

Question: I'm implementing tonemapping in a pixel shader, for hdr lighting.
The vertex shader outputs vertices with colors.  I need to find the max color and save it in a global.
However when I try and write the global in my hlsl code,
<code>//clamp the max color below by this color
clamp( maxColor, output.color, float4( 1e6,1e6,1e6,1e6 ) ) ;
</code>
I see:

error X3025: global variables are implicitly constant, enable compatibility mode to allow modification

What is the correct way to declare a shader global in d3d11 that the vertex shader can write to, and the pixel shader can read?
I realize this is a bit tough since the vertex shaders are supposed to run in parallel, and introducing a shader global that they all write to means a lock..
Answer: This is not possible with 11.0.


Poolish deflated after refrigeration

Question: After I allowed the polish to rise for approx. 10 hours ( it had risen quite a bit) and I placed in the fridge overnight - I find that the level has dropped from the high it had prior to refrigerating ? Why ?
Answer: Yeast fermentation slows down under refrigeration but does not stop altogether. After 10 hours, the poolish probably exhausted all of its food for the yeast. Putting it in the fridge did not accomplish much of anything afterwards. It needed to be fed again.
Comment: Thank you for the comment, but if I may ask you if I'm doing this correctly : 250g flour, 250g water and 5g fresh yeast - this combination allows the Poolish to rise to maximum (before it recedes) only after 9 hours at room temp (20°C) - I can't seem to be able to do what a lot of others do by having the Poolish rise for 10-12 hours at room temp and then placed in fridge overnight without the whole thing collapsing ( and they only use 0.1% yeast) Can you advise me ?
Comment: Hi Rob, again, when you say I need to feed it.... does it mean that I can proceed with the Poolish at room temp for, let's say 9 hours and then before placing it in fridge overnight, I feed it , say 50g flour and 50g water ?
Comment: @Audie After the poolish rises, that is the time to add additional flour and water for the rest of your recipe. A poolish is used for flavor for the final dough.

Poolish deflated after refrigeration


Simile Mark on sheet music

Question: On the sheet music I am playing, I have faced 3 simile Mark each on different bar continuously. Does it mean I should repeat 3 measures back ?
Comment: An image would make a big difference!
Comment: The tags make no sense (?)…
Comment: Are you asking about the word "simile", or are you asking about the measure repeat sign */*?
Answer: The marking simile or sim. instructs the performer to continue to play something in the same way (in a similar way, I guess is the easiest way to remember this translation from Italian). For instance, a bar or passage of music may have staccato markings over each note; a marking of simile over the following notes would tell you to continue to play staccato. It saves continuing to write performance markings which remain the same.

Simile Mark on sheet music


How to store multiple selections from InfoPath form into different fields of SharePoint list?

Question: I have a InfoPath form which has a lookup and allows user to select multiple options from the lookup.
After selection, the values are getting stored in a single field of my SharePoint list, separated by semicolon. I want them to be stored as different fields. Is there a solution possible?
Answer: In your InfoPath form you would have to create separate fields and then use function to populate them with the selection from the lookup and then promote those fields to SharePoint list.
Comment: Can you please tell more about this? Or provide links? Thank you for your help
Comment: The user can select as many options from the list as he wants. So I cannot create many fields in the InfoPath form at once.
Comment: you wrote 'I want them to be stored as different fields' so you will have to create as many fields equal to how many options users can select, or have I misunderstood?
Comment: My doubt is that, if a user selects only 5 out of, say, 10 options, then 10 fields will be created in the SharePoint list right?
Comment: well your requirement is "I want them to be stored as different fields" so yes if you have 10 options you will need 10 fields.


Tag rename request [fire-emblem] -> [fire-emblem-blazing-blade]

Question: The description for the tag fire-emblem mentions that this is for a specific game named Fire Emblem : The Blazing Blade in the Fire Emblem game series. The tag name is misleading because it could be confused with the name of the series itself. Therefore please rename it to fire-emblem-blazing-blade.
Comment: What's the reason for creating a tag synonym, as opposed to just editing the question to have the tag specific to that game, and editing the [tag:fire-emblem] tag wiki?
Comment: Well then we have to create a new tag for fire-emblem-blazing-blade. Whatever seems easier for the mods. I am not requesting it to be a synonym, instead I am requesting it to be renamed.
Comment: It's not about what's easier, it's about what has a better outcome. And for the record, creating a tag requires 300 rep, while creating a tag synonym requires 2500 rep and agreement from 3 or 4 other users who also have 2500 rep (or moderator action). And I think a tag rename without creating a synonym can only be done by a mod.
Comment: What do you mean by better outcome?
Comment: A tag synonym leaves the original in place as a kind of signpost so that you can use it when tagging a question, and it automatically gets mapped to the other one. This is useful when there are multiple common names for the same thing (e.g. [star-wars-the-old-republic] and [swtor]). But it has the potential to be confusing when the original is the name for the whole series, because people might use it when they mean the series as a whole or any other game in the series. A tag rename isn't a separate thing, it's just creating a synonym for an existing widely-used tag.
Comment: It is possible to avoid leaving that signpost by creating the synonym to retag all existing questions, and then deleting the synonym, but then it's essentially just a mass retag. Doing a mass retag of one question is excessive and unnecessary.
Answer: I made the synonym fire-emblem-the-blazing-blade for the original tag fire-emblem.  If anyone uses the synonym, the post will automatically be tagged with fire-emblem.


How to speed up search in dash?

Question: I use Ubuntu 14.04. Search in dash is taking very long time. Is there any procedure to make the search faster?
Answer: Here are some things to do:

Disable online search results:
Launch System Settings and go to Security & Privacy, under the Search tab, turn off the check box which says When searching in the Dash: include online search results
Stop recording file and app usage:
In System Settings and go to Security & Privacy, under the Files & Applications tab, first click clear records and then turn off Record file and application usage
Remove unwanted Unity lens, scopes:
Open the Ubuntu Software Center and search for unity-scope. In the results, check the information on installed scopes and remove the scopes you don't need...
Comment: This is absolutely correct, but also limits the functionality if you turn off application usage as well!  **:(**
Answer: Install the Privacy Indicator applet and just turn off all the features you don't need.
Then (in the same applet) click on Clear Zeitgeist log.
That's the easiest and fastest way to improve the speed of the dash while keeping the functionality you do need.

How to speed up search in dash?


How do you prevent players to break spawn on a server in mchost.co?

Question: I have been trying to prevent players to break spawn but how can I and I am also asking how do you set spawn for everyone?
Comment: What do you mean by `break spawn`?
Answer: From the Wiki:

spawn-protection
Type: integer
default value: 16
Determines the radius of the spawn protection. Setting this to 0 will not disable spawn protection. 0 will protect the single block at the spawn point. 1 will protect a 3x3 area centered on the spawn point. 2 will protect 5x5, 3 will protect 7x7, etc. This option is not generated on the first server start and appears when the first player joins. If there are no ops set on the server, the spawn protection will be disabled automatically.

Add a line to the server.properties file of your server, and put spawn-protection=10.
This will set an area around your spawnpoint that only OPs can interfere with (this includes opening chests, breaking and placing blocks).  You can change the 10 to any suitable number to fit your setup, so long as it remains an integer.
EDIT
As this appears to have plugins on it, I would recommend getting WorldGuard (or similar).  This way you can select what regions of the world can be modified in which ways.
Comment: I am not 100% sure but the question is for mchost.co. At the moment this hosting service does not provide a web interface. Therefore you have no access to the server.properties file of the server and you are not able to change this that way.
Comment: @Gerret Ah, sorry, I didn't realise this. I was assuming it was just a vanilla-only server.  It seems to have plugins on, so WorldGuard or similar might work


Get statistics from TIFF and shapefile in QGIS

Question: I have imported to QGIS two files, one .tiff that contains the coverage data in a given area and a shapefile that contains the division of the area (e.g., states). I want to get statistics using both, like for example, I want to know the percentage that each subarea is covered.
Comment: Please see the screenshot. I have tried merging them together but I get an error message saying that in order to merge both files have to be vector files. I have also tried converting to vector the raster but that won't work either because the raster doesn't have the areas IDs.
Answer: There are a number of tools in the processing toolbox that may do what you want.
If your coverage tiff is a simple binary raster then the Zonal Statistics tool will give you the the sum or count of the pixels from there you would add an attribute field to calculate the percentage of the pixel area vs the total state area.
If it is a classified layer such as different kinds of land cover then Zonal Histogram will give you the count of each landcover in that state then you would have to create some new attribute fields to calculate the percentage.
Comment: If your raster has only 1's (the pink area) and not data (the white area) then they will be the same. Although I am confused because according to your layer legend you should have 0,1,2,3. You will need to figure out the area of each pixel and then multiply the count or the sum by that and then compare it to the area of the state.
Comment: Thanks. That was super helpful. However, when using Zonal Statistics to calculate the count and the sum (in order to get the percentage of area covered) , I get the same value for count and sum. Any idea why this might happen? Thanks again


Dynamically Update a Map

Question: I have a bit of a situation. I was assigned a task to create a system that will take a KML file and update markers dynamically on a map. I'm currently generating the KML from a Wireshark Dissection and now need a way to take said data into a mapping tool. There are a few situations:

The PC that will be running the system will not have internet access, so I will need to cache de map data.
Each marker might move location so I need to erase said marker's previous location and update it with a new marker location. I do have a sequence ID I can identify it with, but I don't know how I'll update the new location.
It needs to be dynamically updated. A system will send data, my Wireshark Dissector will dissect the data and export it into a KML. This KML will need to be dynamically loaded into the system.

The basic idea in mind is like looking at Google Maps and watching your car move as it tracks your GPS location. But I need to make this tracking system work for a lot more targets than just one.
I'm sorry I currently have no foundation on where to start, but that's why I ask for your guidance. I've researched on ArcGIS, QGIS, Google Earth and Maps, but I haven't found a way to upload dynamically nor refresh the system.
Anything that could help me start finding a solution for this task will be appreciated.
Thank you for your time.
Answer: I had experience using leaflet js which allowed you to use bing map, google map, or opensource MapQuest to display mobile-track and car-tracking (for GM OnStar). I am also coding for kml to display flight-tracking on google earth now.
First, I am not sure it is possible or not :

you have a machine not connecting to internet
you want to use those map resource on internet

SO that I will assume that your machine can access internet. Then, there are many solutions.
You may try to see the simple tutorial on http://leafletjs.com/
You will have idea how to do it.
Plus, you have search for examples for Google earth (on which, I can display 3D tracking route).
Hope this help.
Answer: Other than map, see my sample to " Dynamic update data on Google Earth " in the following :
https://sites.google.com/site/canadadennischen888/home/kml/auto-refresh-3d-tracking
hope this help ....
(The following are copy from my link which talking about KML for 3D Google Earth. But I believe you can make it into 2D if you have to "not-use-google-earth".)
...
How to make a dynamic Auto refresh 3D Tracking :

prepare a RestFul service to generate KML file from DB
(sample as in https://sites.google.com/site/canadadennischen888/home/kml/3d-tracking)
My other jsp code will generate a KMZ file which has a link to my Restful service. KMZ file has onInterval ( as in the bottom)
Jsp web page allow user to download KMZ file.
When Google Earth open KMZ file, Google Earth will auto refresh to get new data from that Restful service
Everytime refreshing, server will send the latest update KML data with new data to GE.
KMZ sample:
<code> <?xml version="1.0" encoding="UTF-8"?>
  <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2"
  xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
  <NetworkLink>
  <name>email@example.com</name>
  <open>1</open>
  <Link>
  <href>http://localhost:9080/google-earth-project/rest/kml/10001/20002</href>
  <refreshMode>onInterval</refreshMode>
  </Link>
  </NetworkLink>
  </kml>
</code>
see result
Comment: The above are copy from my link which talking about KML for 3D Google Earth. But I believe you can make it into 2D if you have to "not-use-google-earth".

Dynamically Update a Map


How do I remove weight from weight painting?

Question: I am trying to remove some weight. I left click to add it, but I cannot figure out how to remove it.
Answer: From the Manual on  blend mode:
Subtract: In this blend mode the specified weight is subtracted from the vertex weights. The strength determines which fraction of the weight gets removed per stroke. However the brush will not paint weight values below 0.0.
Lighten: In this blend mode the specified weight value is interpreted as the target weight very similar to the Mix Blend mode. But only weights below the target weight are affected. Weights above the target weight remain unchanged.
Blur: tries to smooth out the weighting of adjacent vertices. In this mode the Weight Value is ignored. The strength defines how effectively the blur is applied.
Answer: You can enter edit mode, select the part(s) of the mesh where you need the weight changed (you can press C and also paint select) and in the Data panel (the button with the triangle) in the Properties context under Vertex Groups, set the weight slider to 0 and press Assign.
Answer: Paint zero weight to effectively remove it (zero weight has no effect)
If you want to remove the vertex from the group you can run the "Clean" tool, or manually select and remove the vertices from the group.
See: Weight Paint Mode -> 3D View Header -> Weights -> Clean
Comment: what i "`the "clean" tool`" ?
Answer: You can erase with draw brush. Change the weight parameter.

0.0: Deep eraser
0.3: Shallow eraser
0.7: Shallow brush
1.0: Deep brush

*Precautions:
Weight paint does not wet only vertex. Clicking on the vertex makes it dark.
Mirror side is not wet.
Weight values is recorded on the vertex data of the target mesh.
Vertex data is made only of the number of bones. When is it? Setting armature to parent. (with Automatic weight or with Empty group)
Please select together the target mesh and the bones in the order goes to the weight painting mode.
Operation: Shift+Click Selection of the bones. can be released by Shift+Double Click. This operation looks confusing.
When you paint the weight value is easy to understand and see while switching the object mode and weight painting mode in the Ctrl+Tab.


Is it safe removing block-inner clearfix classes from block templates?

Question: Is it safe to remove block-inner clearfix templates from block? I use mainly context module which works with blocks. Looking at html there is too much wrappers involved. Thank you.
Comment: Classes are just a stylesheet convenience. If your stylesheet is not referencing the class, then it is probably safe to remove them. Try it out and see. If you site is adversely affected, put them back.
Comment: I use omega theme, clearfix rule contains clear:both and obviously is for removing any floats. I wanted to know if it is neccessarry for admin theme or so. Thank you
Comment: Only way to tell is to try it and see.
Answer: You can remove them, but they are there so that you can properly float elements within your content. That will depend on the modules you use (whether they include clearfix), and your own CSS.
Not sure about whether Admin requires it. In my case, I use an admin theme for all editing, precisely to avoid such complications.
Answer: You can override the template that includes that corresponding block. For example, I wanted to remove a clearfix in my branding region. I copied region-branding.tpl.php from the omega directory to my theme's templates directory. I then edited the file and removed the clearfix.
Answer: Instead of removing it is better to override them so that if you need to have them in case of any problem, you should have access to them. For exammple you can override .form-item, .form-text, .clearfix etc. etc.   in your CSS.


Since the matter in the brain is recycled every few days how does consciousnesses work?

Question: Since parts of the brain are recycled every few days does that mean that materialistic theories of consciousness don't work?
Comment: How does any other body part work, when the actual matter is generally recycled over shorter or longer periods?  FTM, how does your car keep running when you have to keep filling the gas tank, replacing tires, batteries, & other parts?  If you kept it long enough that you eventually had to replace every single part, wouldn't it still be a running car?
Comment: @vkehayas: The turnover/consciousness argument is, at least to me, so obviously false ("not even wrong" comes to mind :-) that it's actually hard to think of how to refute it.  But consider a computer as an analogy.  With RAID storage, you can replace one of the hard drives (often hot-swapping while the computer is running), and all the data will remain unchanged.  Over time, you could replace all the disks.  With a largish cluster, you can swap out CPU nodes while programs are running, and (if properly designed) they'll continue working just fine.  (Continued...)
Comment: ... The programs (and presumably consciousness - not that I'm claiming to know what that is) are PROCESSES that aren't tied to specific bits of matter. You can replace the underlying hardware, whether it's silicon chips or proteins, and the process continues unaffected.
Comment: Notice that the link you provide concerns development, where plenty of things change. You have added a tag for proteins but do not really discuss the implication of protein turnover given the prominent role that modern neuroscience gives to translation-dependent synaptic plasticity. @jamesqf The question is not how can the brain work given the turnover, but if we can for example claim that a person is the same over time. Or put differently, how much of this turnover is critical for "consciousness". If none of it is, then "consciousness" cannot reside in matter, or so the argument goes.
Comment: What is consciousness?
Answer: That was an interesting read, and I saw nothing to support your statement that "brain parts die every few days".
Neural plasticity demands that some synapses degrade as new ones are formed. But there are (an estimated) 100+ trillion synapses (some put it an order of magnitude higher) so, really, a few here and there means little. It's when there is wholesale loss that problems arise.
A strong argument for a materialist theory of consciousness is that as neurons involved with memory die, so does memory. This is evident in the transition that occurs in early childhood allowing for the formation of long term memory as well as the degradation of short-term memory and other brain functions in people with, say, Alzheimers.
Hippocampal Neurogenesis Regulates Forgetting During Adulthood and Infancy Science 9 May 2014


What is difference between hmac_sha256, hkdf_sha256 and hmac_sha_512?

Question: In the open source (https://github.com/bitcoin/bitcoin/tree/master/src/crypto) there are these algrithms that as I know connected with gerenation the new keys and master key. So I try to understand what exactly each algorithm does and how they related in Bitcoin Core.
Answer: They implement 3 distinct cryptographic schemes:

HMAC-SHA256 is a MAC (message authentication code, or a keyed hash function) based on SHA-256. It is used in the RFC6979 nonce generation function for deterministic ECDSA signing.
HMAC-SHA512 is a MAC based on SHA-512. It is used in the BIP32 key derivation logic.
HKDF-SHA256 is a (symmetric) key derivation function (KDF) based on HMAC-256. It is currently unused, but was added in anticipation of being used in the BIP324 (v2 P2P transport layer) implementation.
Answer: HMAC in the name stands for "Hash-based Message Authentication Code" and the hmac_sha_512 is used to generate keys in hierarchic-deterministic BIP-0032 wallets, and to generate a master key from the seed phrase (BIP-0039), for example here.
HKDF in the name stands for "Hash-based Key-Derivation Function", and there's a comment in the code which describes it:

A rfc5869 HKDF implementation with HMAC_SHA256 and fixed key output length of 32 bytes (L=32)

If you look at rfc5869 specification, it uses some HMAC as a primitive in the key derivation scheme, and in hkdf_sha256 the hmac_sha_256 is the primitive i.e. hmac_sha_256 is used for hkdf_sha256. The hmac_sha_256 is also used in httprpc.cpp and torcontrol.cpp.
But what is hkdf_sha256 used for? It doesn't seem to be used anywhere.


Silverlight c# socket

Question: Has anyone gotten a silverlight socket application to run successfully over the internet? Like have a console server that listens for client.  The client uses silverlight sockets where users can go on any web browser and connect to the console server.
Answer: Out-of-browser applications in Silverlight 4 work with sockets just fine. Our SecureBlackbox product offers implementations for various protocols (HTTPS, FTPS, SSH/SFTP, SSL/TLS) over Silverlight socket, and they work just fine. If you want to have something in browser, you need to make/modify the server to (a) listen on the port that belongs to specific port range (4502 to 4534) and (b) accept requests on another port 943 and provide a policy file. For more information about these requirements see Microsoft document.
Answer: While I haven't had the chance or need to do so, a user group meeting I attended covered just this topic. You can watch the video of the presentation here and a copy of the code sample here.
Answer: Try example from "Pro silverlight 4 with c#" or "Pro silverlight 3 with c#". It can be downloaded from Apress.
I have used exaple for silverlight 3 and it works fine.

Silverlight c# socket


Questions about illegal immigrants/immigration

Question: How will we deal with questions regarding illegal immigration/immigrants?
Answer: I think there will be three types of questions regarding illegal immigrants/immigration:

Legal questions: such as asking how to change the illegal status to legal. IMO, These should be allowed.
Illegal questions: such as asking how to enter x country illegally. IMO, These should be closed.
Gray zone questions: such as how to get health care if you are an illegal immigrant. These are tricky, I think common sense should be applied.
Answer: Off-topic as per the scope defined in the help center. It's not reasonable to expect an answer to a question about ways you can illegally enter (country), therefore the question itself isn't on-topic here.
As you said, if someone realized Oh no, I overstayed my visa! - I think we can help them to the best of our ability, depending on the question. Sometimes that might just be "contact an immigration attorney".
<Tongue In Cheek>

Is it better to swim, or cross by land to sneak into [country]?

Put on hold as primarily opinion based by ............

</Tongue In Cheek>
I don't think we'll see too many on the illegal or 'gray' scale of them, at least I hope not. All kidding aside, these 'help me do something immoral/illegal/unethical' questions can generally be closed for multiple reasons, so it's not very difficult to deal with them.
If these were to become a problem, we do have custom close reasons, but let's not spend too much time on problems until we actually have them - or it's clear that we will.
Comment: @MeNoTalk At some point that ceases to be our responsibility. You can only be responsible for the information that you share to the extent that you believe it to be benign and helpful. I'd tell an illegal immigrant with a gunshot wound to seek a hospital, even though I _know_ they're obligated to report the wound and the patient. I don't think we're going to run into this too often, but I have pretty solid faith in the moral compass of this community. Like you said, common sense.
Comment: "per the scope defined in the help center" - could you point me to the exact page?  I wasn't able to find a clear definition of the scope there.
Comment: I think for clear questions no one will argue that it should be closed, but in some cases, for example seeking medical care in Saudi Arabia, if the hospital provides a medical care to an illegal immigrant the hospital will be in trouble, they have to report the case before they start any care. That's the kind of questions which look legal but they are not.
Comment: true that... :)


What does it mean that the transcript is enriched?

Question: I think I don't get the meaning of "enriched" in the context of genes.
What's the difference of gene being "enriched" and "expressed" in the cell?
Comment: Welcome to SE Biology. It would be far better if you cite an actual example of the use of "enriched in the context of genes" that is unclear to you (with a link if possible). That way we would be able to clear up any misunderstanding, for example whether it is the gene that is enriched or its transcript. See the [Help on Asking Good Questions.](https://biology.stackexchange.com/help/how-to-ask)  (In general when one has a problem it is good to explain it in detail: often that helps one see logical flaws or questionable assumptions.)
Answer: In the context of transcriptomics the term 'enrichment' is usually connected to differential analysis:

If a transcript (or some/all transcripts of a gene) are detected in a given sample that transcript is expressed
If a transcript is detected at (statistically significant) higher levels in sample  (or condition) A compared to another sample B, that transcript is enriched in sample A.

In some cases one might compare two cell types, where only one expresses a given transcript, in this expression and enrichment in that cell line (compared to the other one) would be almost the same.
Comment: Thank you so much! Totally makes sens now.
Answer: In most cases (i.e. assuming there is no aneuploidy) a gene won't be enriched, however, the transcript from a gene may be enriched. A synonym in this case would be overrepresented. In other words, you find relatively more of the transcript compared to other transcripts.
Since you seem to confused about the difference between transcripts and genes, I highly recommend working through the material on a site like Khan Academy. This will help you understand the basic vocabulary and concepts of molecular biology. There are also a number free online textbooks available at NCBI where you can get more in depth information.


How do I shutdown 12.10 when ACPI is set to OFF?

Question: I recently installed 12.04 on an HP Spectre XT ultrabook. I installed 12.04 from a USB. When the install was complete, and the computer restarted, I got a blank screen.
After some searching, I found that I had to choose "acpi=off" during the installation, which now shows up in the grub screen.
Once I was on 12.04, I upgraded to 12.10.
The issue now is that when I hit shutdown, the computer hangs on a purple shutdown screen. Usually, at this point, I press the power button on the machine to completely power off the machine.
I am new to ubuntu, and would appreciate the help. Thanks.
Answer: I have two machines running Ubuntu. I modified my grub menu on the HP Spectre XT ultrabook to mirror my other machine.
I changed the following lines, from:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

GRUB_CMDLINE_LINUX="acpi=off"

To
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

GRUB_CMDLINE_LINUX=""

After doing this, my machine successfully shut down.
There was another problem, when the machine boots up, the LCD backlight is completely dark. I have to increase the brightness using keys on my keyboard, and I am then able to see the login screen.
Answer: This has been happening to me every once in a while on my Toshiba Satellite L300D laptop since 12.04 and it occurred a couple of times to me after installing 12.10. On my computer it didn't happen all the time.  I'd estimate about 1 in 15 shutdowns would result in an endless purple screen that required holding down the power button to force a shutdown of the computer.
It hasn't happened for a while now, however, and I think it has something to do with my recently having disabled the "speech-dispatcher" service at start-up (It always seemed like the last thing Ubuntu would try to shutdown before hanging.
I have no reason why this would have helped, but if you want to give it a try, it can't hurt anything (unless you need your computer to talk to you!)
Install Boot-up Manager (BUM)
$sudo apt-get install bum

Open boot-up manager from the dash and then uncheck the box beside "speech-dispatcher" save and quit. At the very least you will save yourself some RAM and make your boot-up and shutdown times quicker, and hopefully solve stop the shutdown from hanging (fingers crossed!)
All that said, even if it works it is just a work-around. I think this is a bug and needs to be reported.
Cheers.
Comment: Thank you Matt. I found a solution just before I saw your message. Thanks again.


Powershell Custom Object property order issue

Question: When creating a custom object in powershell my properties are not ordering in the same precedence I type them in (top to bottom -> left to right).
I was told to use [ordered] on my table declaration as done below;
$AllMailData += New-Object PSObject -Property [ordered]@{
            'Unique ID' = $sharedmail.PrimarySmtpAddress
            'Display Name' = $sharedmail.DisplayName
        }

However this gives me a syntax error. Can anyone suggest where I have gone wrong?
Comment: You shouldn't rely on property order, but rather on their names
Answer: You will get rid of the error when you enclose everything you're passing to -Property in parenthesis ().
Also shorter way of writing this would be:
$AllMailData += [PSCustomObject]@{
            'Unique ID' = $sharedmail.PrimarySmtpAddress
            'Display Name' = $sharedmail.DisplayName
        }

[PSCustomObject] guarantees preservation of property order, where [PSObject] does not. But it seems that using ordered hashtable in your example accomplishes that, too.


Interpreting coefficients of beta regression

Question: I have implemented a beta regression and am a little confused on how I should interpret the coefficients of my model. For context, both my independent variables and dependent variable are expressed in percentage form, ranging from [0, 1]. The only exception is one independent variable which takes the binary value of 0 or 1. Also, I used a logit link. Does anybody mind sharing how I could interpret the coefficients here in this beta regression? I've never worked with a dataset like this before; any help would be appreciated!
Comment: This is a statistical question, so you may have more luck on CrossValiated, which is the stats area. That said, you may find these links contain helpful information: https://rcompanion.org/handbook/J_02.html https://www.andrewheiss.com/blog/2021/11/08/beta-regression-guide/
Answer: You interpret a logit-link beta regression output in a same way that you would interpret a logit-link logistic regression. We are modelling the expectation of the Beta-distributed Random Variable $Y$, via a logit link. Your model is something like:
$$
\text{logit} ( E[Y] ) =  b_0 + b_1x_1 + b_2x_2 + \cdots
$$
Let's say that $x_1$ is your $[0,1]$ proportional predictor, and $x_2$ is your binary predictor.
Interpretation of $x_1$: it's probably not useful to do the usual "an increase in $x_1$ by 1 results in a ..." interpretation. You may want to say something like "and increase in $x_1$ by 1 percentage point (i.e. 0.01) results in an increase in the odds by a factor of $\exp(0.01 \times b_1)$."
Interpretation of $x_2$: basically a standard interpretation: "$x_2 = 1$ (or whatever the class label is) corresponds to an increase in the odds by a factor of $\exp(b_2)$".


How to create a wrapper for a large interface

Question: I want to create a wrapper that traps a particular exception and retries for all methods in a large (100+ methods) interface. I have the retry code working no worries, but I can't figure out how to hook up an implementation of the interface without cut'n'paste into all the methods.
I tried to use a missing method handler but that meant that I couldn't have it implement the interface. Abstract is obviously out as I won't be able to instantiate it.
I'm hoping for a better solution than creating the class as a template on the fly but I'm willing to do that.
Answer: Have you tried overriding invokeMethod for the interface?
YourInterface.metaClass.invokeMethod = {String name, args ->
   def result
   println "Calling method $name"
   try{
      result = metaClass.getMetaMethod(name, args).invoke(delegate, args)
   }catch(YourException | AnyOtherException | Exception e){
       println "Handling exception for method $name"
       result = //Call retry code here
   }
   println "Called method $name"

   result
}

Overriding invokeMethod works as as interceptor for all the method calls in the interface. Handle the exception for each method and return the success result.
Comment: I kept on getting IllegalArgumentException using this solution. Refer to my self-answer for the working version (+1 anyway for the right direction).
Answer: I tried to use @dmahapatro's example but I kept getting IllegalArgumentException. I eventually realised that it only happened for mixin methods (the method shows the signature of the mixin). Instead of invoke() I needed to use doMethodInvoke() to get the appropriate type coersion.
errorProneInstance.metaClass.invokeMethod = { String name, args ->
    def result

    def method = delegate.metaClass.getMetaMethod(name, args)

    while(true) {
        try {
            result = method.doMethodInvoke(delegate, args)

            break

        } catch (AnnoyingIntermittentButRetryableException e) {
            print "ignoring exception"
        }
    }

    result
}


Transformer before or after switch?

Question: From a 5A 240V supply - I have two puck type 12V 10W lights in a cupboard and a round plastic switch. Each light has a 10V halogen bulb. I need to buy a new transformer - will any do? Is the transformer to be wired before or after the plastic switch or does it not matter? Can any size output wire be used or does it need to be relatively small to carry the current to the lamps? Thanks
Comment: Are you really going to use halogens until the end of time?  Do you have a hoard for when they stop being made? You're never, ever going to upgrade to LED?  If the answer to any questions is "no" you really ought to seize the moment to switcheroo to LED.  The market is mature now and the available products no longer suck (unless you insist on scraping the bottom of the price barrel).
Comment: Not enough information for any sort of definitive answer. You should get a transformer that meets the same specifications as the one you're replacing. The switch is usually on the line side, cutting power to the transformer itself, but it wouldn't surprise me to find someone's made a setup differently, putting the switch on the load (bulb) side of a transformer. Impossible to know what switch you have; if you put it on the line side, make sure it's rated for the voltage and current. Wires also need to be large enough, but for low-current applications like this one, that's not very large.
Answer: The switch should be prior to the transformer for several reasons.
First this kills power to the transformer; if the lamps were only disconnected, even with no load, transformers waste power. This use of power usually increases with age and later it may start buzzing as the core delaminates. The power usage in this case is from eddy currents.
Second, with the switch turning off power to the primary, if you need to work on it the circuit is dead, you did not say if this is a hard wired application or a plug in.
The size of the wire would be based on the current the lamps draw. Since it is about .83 amps each or 1.66 amps, if it is not a long distance 18awg wire would probably be fine, but if it is a long distance I would verify the voltage drop.
As Harper mentioned halogens, I would bet you could find replacement LED's that will last longer and draw ~1/3 the current.

Transformer before or after switch?