Pejorative term for Indian English

Question: There was, it seems,  a pejorative term during the British Raj to describe Indian people trying to speak English. What was it?
Comment: Maybe you're thinking of 'Baboo' or 'Babu' English? 'Hinglish' is another possibility.
Comment: Are you looking for pejorative terms for Indian English or Indian people who try to speak English? Please edit your question with your own research effort.
Answer: As suggestd by @JEL in a comment, Babu or Baboo were terms used to refer to the ungrammatical English language used by Indians during the colonianl period:

British commentators during the colonial period sometimes expressed amusement at the kinds of English used by their subject populations. Babu, or Baboo, English of India attracted particular attention because it aspired to poetic heights in vocabulary and learning, despite being full of errors. Arnold Wright, the author of this study of Babu, might have been surprised to hear that linguists today find a great deal in common between Babu English and the ornate style used by many British writers in past centuries.
Baboo English as 'tis Writ, first published in 1891, considers the language of Indian newspapers. It reproduces begging letters, characterised by their indirectness and excessive politeness. The writer of this letter – an Indian local – is pleading with a gentleman to give him work. Job applications today are phrased very differently.

From: (www.bl.uk)
Answer: You might be looking for Pidgin English [MWD]

pidgin: a simplified speech used for communication between people with different languages

or Butler English [Wikipedia]

Butler English, also known as Bearer English or Kitchen English, is a dialect of English that first developed as an occupational dialect in the years of the Madras Presidency in India, but that has developed over time and is now associated mainly with social class rather than occupation.

Pejorative term for Indian English


What is the difference between a data flow diagram and a flow chart?

Question: I want to know why we use Data Flow Diagrams instead of flow charts.
Comment: I fixed the yelling.  That was just too painful.
Answer: A flow chart details the processes to follow. A DFD details the flow of data through a system.
In a flow chart, the arrows represent transfer of control (not data) between elements and the elements are instructions or decision (or I/O, etc).
In a DFD, the arrows are actually data transfer between the elements, which are themselves parts of a system.
Wikipedia has a good article on DFDs here.
Answer: You should use whatever you like. The diagram is just a tool. Use whatever tool fits you and your problem best. I usually just use boxes and arrows and squiggles and circles and little stick figures and whatever else I think gets the point across to the viewer. In short it doesn't matter if you even use a standard diagraming standard. People are usually pretty good at understanding pictures.
Comment: "Use whatever you like" does not really answer the question of the differences between flowcharts and DFDs and is, in any case, less than stellar advice. You don't use a hammer to chop down a tree, or a sledge hammer to hang pictures on the wall or, more specifically, a DFD if you want to show *process* flow. You use the *appropriate* tool.
Answer: Data flow diagram shows the flow of data between the different entities and datastores in a system while a flow chart shows the steps involved to carried out a task. In a sense, data flow diagram provides a very high level view of the system, while a flow chart is a lower level view (basically showing the algorithm).
Whether you use data flow diagram or flow charts depends on figuring out what is it that you are trying to show.
Answer: The difference between a data flow diagram (DFD) and a flow chart (FC) are that a data flow diagram typically describes the data flow within a system and the flow chart usually describes the detailed logic of a business process.
Answer: Data Flow and Flow Chart differ in processes, flow, and timing.

Processes
a.) On DFDs, processes can operate in parallel (at-the-same-time).
b.) On flowcharts, processes execute one at a time.

Flow
a.) DFDs show the flow of data through a system
b.) Flowcharts show the flow of control (sequence and transfer of control)

Timing
a.) Processes on a DFD can have dramatically different timing (daily, weekly, on demand)
b.)
Processes on flowcharts are part of a single program with consistent timing
Comment: can you expand on the flow section with some examples
Answer: A DFD shows how the data moves through a system, a flowchart is closer to the operations that system does.
In the classic make a cup of tea example, a DFD would show where the water, tea, milk, sugar were going, whereas the flowchart shows the process.
Comment: You're missing the "prepare the teabag" part. I'll take mine with 2 sugars, no milk :-)
Answer: Other answers have gone over the basics of what each thing is. At the higher level, a flowchart is a design level tool, while DFDs are more analysis.
DFDs have some nice features. Since they show the flow of data, some things become more obvious when charted this way: some data is only used by a few routines, some routines use only some bits of data, some routines touch everything. Seeing that up front helps organize, restructuring, and planning.
A follow-on worth exploring is the Event-Response Diagram, which is basically a DFD only showing process and data needed to process an "event", meaning something triggered externally (customer makes payment, etc.).
Answer: A Data Flow Diagram is functional relationship which includes input values and output values
and internal data stored.
A Flow Chart is a process relationship which includes input and output values.
Answer: Flow chart describes the program (see old fortran flow charts - surely, there are some floating around on google).
Data flow diagram determines the flow of data, for example, between subroutines, or between different programs.
Answer: Although my experience with DFD diagrams is limited I can tell you that a DFD shows you how the data moves (flows) between the various modules. Furthermore a DFD can be partitioned in levels, that is in the Initial Level you see the system (say, a System to Rent a Movie) as a whole (called the Context Level). That level could be broken down into another Level that contains activities (say, rent a movie, return a movie) and how the data flows into those activities (could be a name, number of days, whatever). Now you can make a sublevel for each activity detailing the many tasks or scenarios of those activities. And so on, so forth. Remember that the data is always passing between levels.
Now as for the flowchart just remember that a flowchart describes an algorithm!
Answer: have a look to this site
http://yourdon.com/strucanalysis/wiki/index.php?title=Chapter_9#The_Flow
its really help u to understand what is DFD
Answer: Between the above answers its been explained but I will try to expand slightly...
The point about the cup of tea is a good one. A flow chart is concerned with the physical aspects of a task and as such is used to represent something as it is currently. This is useful in developing understanding about a situation/communication/training etc etc..You will likley have come across these in your work places, certainly if they have adopted the ISO9000 standards.
A data flow diagram is concerned with the logical aspects of an activity so again the cup of tea analogy is a good one. If you use a data flow diagram in conjunction with a process flow your data flow would only be concerned with the flow of data/information regarding a process, to the exclusion of the physical aspects. If you wonder why that would be useful then its because data flow diagrams allow us to move from the 'as it is' situation and see it that something as it could/will be. These two modelling approaches are common in structured analysis and design and typically used by systems/business analysts as part of business process improvement/re-engineering.
Answer: Data flow diagram: A modeling notation that represents a functional decomposition of a system.
Flow chart: Step by step flow of a programe.
Answer: Data Flow Diagrams
The formal, structured analysis approach employs the data-flow diagram (DFD) to assist in the functional decomposition process. I learned structured analysis techniques from DeMarco [7], and those techniques are representative of present conventions. To summarize, DFD's are comprised of four components:
Comment: which four components?


How to write simple SMPP server

Question: I want to write a simple SMPP Server that basically forwards traffic to another SMPP server (C#, PHP). What are the things I need to know? How do I proceed?
Comment: If you only want to forward requests you do not need to know anything about the application protocol, just connect the incoming and outgoing socket with the real server in the background.
Comment: Well, maybe I should be clearer. I need to intercept the PDU bind packets, so I can implement an extra layer of user authentication at my end, and forward other PDUs to an external SMSC.
Answer: With regards to Goran's comment, one possible solution would be a simple tcp proxy such as simpleproxy.
From the Ubuntu package description:

simpleproxy acts as a simple TCP proxy. It opens a listening socket on
  the local machine and forwards any connection to a remote host. It can be
  run as a daemon or through inetd.
Answer: Olaseni,
I've done something similar in the past, but i used perl. What i did was taking a port forwarding proxy which i downloaded from accordata.com. (port-proxy.pl)
I modified this to use the NET::SMPP module to validate PDU's when reading the incoming socket. Once the PDU was of type "Bind_request" i would validate against a dbase, replace credentials if validation was successfull and than forward or if credentials were not validated, issue a reject to the client and disconnect. Alternatively if the PDU contained anything else, i would forward using the logic that was already existing in port-proxy.pl.
Comment: Makes a lot of sense - I'll give it a try
Answer: You can write simple smpp lib and forward smpp traffic from many applications to the one smpp connection to the sms provider
I can advice you jsmpp lib, but it's for java. It's very simple and cool lib. Many low level things happen behind the scenes and you can focus on your business logic
Find more here
Answer: I have written exactly what you are asking for in vb.net
What i did was listen for inbound PDU (connect, bind, sms, and disconnect too) identifying each inbound connection uniquely - for the authentication bit,
then i forward the traffic onward to the delivery smsc.
Your SMPP service simply needs to listen for inbound PDU packets... as well as send heartbeat packets to the connected clients, if required.

How to write simple SMPP server


Are Legendre transforms of non-convex functions useful?

Question:
Do Legendre transforms have any applications that do not appeal to convexity?
What is the intuitive interpretation of the Legendre transform of a non-convex function?
Answer: (Edit added years later: I want to make clear that J.R.'s answer - the accepted one - is completely correct if we're using the Legendre-Fenchel transform, which is the one people generally use. The Legendre-Fenchel transform is defined in terms of the supremum and can be applied to non-differentiable functions. I believe that Legendre originally defined his transform in terms of explicitly setting the derivative to zero instead, which is what I'm doing below. So this answer is about the original Legendre transform, rather than the usual Legendre-Fenchel one.)

I would like to propose a different answer to the second part of your question. Let us examine a simple example of a non-convex function, $A(x) = x^2-x^4$, which of course looks like this:

(plots are from Wolfram|Alpha.)
Let us define $y=\frac{dA}{dx}=2x-4x^3$ and consider the Legendre transform $B = xy-A(x) = x^2 - 3x^4$. Solving explicitly to get $B$ as a function of $y$ involves solving a cubic equation and doesn't seem to lead anywhere nice, but we can easily do a parametric plot of $B(x)$ against $y(x)$ to see what it would look like. The result is this: ($B$ is the vertical axis and $y$ is the horizontal axis)

I believe that Legendre transforms of functions with a single non-convex region will always be qualitatively similar to this. In general the Legendre transform of such a function will be a multiple-valued function with this distinctive "swallowtail" shape. It won't always be symmetrical of course, but there will always be two points where the curve reverses direction and one point where it crosses itself. The direction of curvature of the three line segments will also always follow the pattern of this plot.
The reason the curve reverses direction is simply that $y$ is the slope of the $A(x)$ curve. For a convex function, $\frac{dy}{dx} = \frac{d^2 A}{dx^2}$ is always negative, so $y$ changes monotonically with $x$; but for a non-convex function there is a region where $\frac{dy}{dx} = \frac{d^2 A}{dx^2}>0$, corresponding to a reversal in the slope of $y(x)$. Indeed we can see this non-monotonicity by plotting $y=2x-4x^3$ against $x$:

If there are multiple concave regions then there will be multiple reversals of the sign of $dy/dx$, corresponding to multiple swallowtails in the Legendre transform. I think these multiple swallowtails can be sort of nested inside one another.
If one replaces the non-convex function with its convex hull then the "swallowtail" will disappear, with the point where the curve crosses itself becoming a "kink" in the curve, where the second derivative becomes infinite. This results in a single-valued convex function.
As for whether this interpretation is useful, I'm not sure but I think so. It seems related to the swallowtail catastrophe (although I don't know much about catastrophe theory), and it also seems related to first-order phase transitions in statistical mechanics. These can be seen as being due to a non-convexity in the entropy (which then gets replaced by its convex hull). This is equivalent to a swallowtail in the free energy being replaced by a kink, since the two are Legendre transforms of one another. I've never seen this swallowtail curve depicted in a thermodynamics text, but it's not uncommon to see plots corresponding to the $y(x)$ plot above.
Comment: That swallowtail's awesome! Make some more, print them onto canvas, rent out an expensive office and hold an exhibition entitled "The Non Konvex Kaleidoscope"- I'm sure you could sell them off at $50K each as art pieces!
Answer: I can answer your second question.
Recall that by convex duality, applying the Legendre transform twice on a convex (and coercive) function gives you back the original function.
Now even if you plug in a non-convex function $W$ instead, the Legendre transform $W^*$ will be convex and coercive (one can see that by the definition) and so is $V:=(W^*)^*$. So clearly the convex duality will not carry over to the non-convex case. However one can show (under appropriate assumptions of course) that $V$ is the convexification or convex hull of $W$, that is roughly (here $W:\mathbb{R}\rightarrow\mathbb{R}$) the function whose graph is the boundary curve of the convex hull of the set $\{(x,y)\in\mathbb{R}^2\,|\,y\ge f(x)\}$. By convex duality we conclude that $V^*=((W^*)^*)^*=W^*$, so the Legendre transform of a non-convex function is the Legendre transform of it's convexification.
Comment: Thanks! Is it possible to give me some references that would allow me to study these points in greater detail?
Comment: E.g. Evans' book "Partial Differential Equations" contains a proof of convex duality (in a chapter on Hamilton-Jacobi equations I think). For the non-convex case, I think looking at $(W^*)^*$ for the example $W(p)=(1-p^2)^2$ is instructive (Hint: don't try calculating $W^*$ first, it's a mess and doesn't help).
Answer: See I. Ekeland, "Legendre duality in nonconvex optimization and calculus of variations", SIAM J. Control and Optim., 15 (1977), 905-934. Also, see McEneaney/Dower, "Static Duality..." (http://maeresearch.ucsd.edu/mceneaney/pubs/).


Are there any couples in the Culture?

Question: Is sex in Iain M Banks's Culture limited to orgies and one-night stands? The only romantic love I can think of is in the one that has a Hell and the one where they're descended from carnivores and they have a war that isn't their fault. But both of those are societies outside of the Culture. Can anyone think of examples within it?
Comment: Consider that a "long term" relationship in our way of thinking is one that lasts a decade or more, and that six or seven decades is the limit admitted by current medical standards. Now compare that to the length of a life in the culture. Finally, not that Banks mostly writes about people who are in a high pressure, high risk link of work.
Answer: In the back story to Excession, two characters - Dajeil and Genar-Hofoen - were a dedicated couple, going so far as to get one of them pregnant and then undergo sex changes and getting the other one pregnant too. The relationship only broke up when Genar-Hofoen was unfaithful.
Comment: In the Culture, **anything** goes as long as it isn't harming anyone without their consent. That includes long term monogamy. It might be considered an eccentric minority interest, but an "insignificant minority" in the Culture could still be several billion strong.
Comment: I don't think so. Genar-Hofoen himself had previously thought that "mutualling" (the dual babies thing) was pretty icky, but it was clearly prevalent enough to have a name.
Comment: When she's upset about him sleeping with her friend, he protests "it wasn't like we were juveniles or in some dumb monogamy cult or something", so monogamy exists, but is considered childish
Comment: If memory serves, their friends thought their relationship was weird and icky

Are there any couples in the Culture?


Thick Film Resistor FIT rate for Hardware FMEDA

Question: I am currently working on a hardware FMEDA as per IEC 61508 and I am using thick film resistors such as AC0402FR-071K5L and I want to calculate/find the FIT rate of the thick film resistors according to SN29500. According to the SN29500 document there are resistor types such as carbon film, metal film etc. with different FIT values. Which type of resistors should I consider for the thick film resistors?
Answer: "Thick film" says nothing decisive about the composition. And it is the composition and construction which determine the safety.
So either ask the manufacturers of all your resistors about specific failure data or at least check all their datasheet for their respective composition and then assume standard values for this composition.
For "thick film" resistors nowadays, both carbon and metal composition are unusual. I think most use some oxide composition.
Moreover, unless you have resistors with guaranteed failure behavior, assume that they can fail open or short and that they can catch fire when overpowered.
Answer: See Panasonic's surface mount resistor technical guide, section 6 (as one example)...
https://industrial.panasonic.com/cdbs/www-data/pdf/RDM0000/DMM0000COL11.pdf


Pull data when cell value is selected

Question: I am Trying to pull data from part of a sheet to another part depending on if dirt level 22 value is filled in. Please see attached Picture, basically, the bottom section pulls data from rows above depending on if dirt level 19, 20, 21 or 22 is displayed. I have only used 22 in the image.
Comment: filled in where? pull it how? what selection? what do you mean by "pull when selected"? share a copy of your sheet with example of desired output.
Comment: I Have shared the example. The numbers on the bottom of the picture are how i want the output. Example - If Row 7 has a value of 22 in the column headed dirt money, then i want the job number row 7 to copy to the bottom job number column, dirt money rate (22) to copy to the bottom (Rate) Column and time on the job, ie 2hrs on the monday = 0200 in the (Hours:Mins) Column at bottom of picture.
Answer:
paste in AH27 cell:
=ARRAYFORMULA(QUERY(IF(O7:O21=22, VLOOKUP(22, O7:X21, {3,4,5,6,7,8,9,10}, 0), ),
 "where Col8 is not null", 0))
paste in AT27 cell:
=ARRAYFORMULA(QUERY(IF(O7:O21=22,
 Y7:Y21+AC7:AC21+AE7:AE21+AG7:AG21+AI7:AI21+AK7:AK21, ), "where Col8 is not null", 0))

Pull data when cell value is selected


Wavy stream of liquid

Question: While pouring a liquid into a glass from a bottle, some streams have a wavy shape, like the one in the following photo:

What causes the stream to be of such a shape?
Comment: See https://physics.stackexchange.com/a/512344/155230
Answer: On the one hand, as the liquid is not being poured very slowly, there are different velocities in the incoming liquid: it's faster at the top, and, it seems, at the back. On the other hand, the cohesive forces (resulting in particular in surface tension at the surface of the flow) are sufficient here to prevent separation of some liquid from the rest — splattering. Then it is as if you had two masses going at different speeds (the liquid at the back and at the front) linked by some piece of rubber (cohesive forces) : they turn around one another.
The smooth appearance due to surface tension gives the final touch for a beautiful flow. You'll probably enjoy taking a tour in John Bush's gallery if you like this, http://math.mit.edu/~bush/?page_id=252. A very relevant example is the case of colliding viscous jets, pdf and below, which exemplifies beautifully the present discussion at low flow rate (left) but gives much more impressive results at higher flow rates! (right)
Answer: You have made a very interesting observation. In short, this is due to the shape oscillations of the flowing stream of water.
I did the experiment and observed the pattern too. Here you can see the same image from two different angles.
Front view

Side view

When you look carefully at the two images, you would see the flowing water is flattening out in mutually perpendicular directions as it falls down the cup. This works due to a principle similar to the one behind shape oscillations of a freely suspended water droplet. Only difference is that here, you don't have an oscillation in the direction of the flow. So this is actually a 2D case of water drop shape oscillation.

Consider water flowing out from the cup at a uniform rate.
We can imagine that the flowing stream of water consists of several cross-sectional films falling down one after another (marked in the picture as green rings). For simplicity, we neglect any interactions between the adjacent films. Let's track the shape of one of the films. When no other force is at play, the film tends to remain in a circular shape.
At the point where water loses contact with the cup (which I shall call 'Base'), the film is stretched out horizontally due to the normal reaction of the cup.  When the film leaves the base, surface tension would provide a restoring force for the film. The film would get fully stretched in the perpendicular direction at position A.

This sets up a 2-D oscillation. The film would oscillate between these two states as it falls down.

The oscillations may not be exactly as above but is somewhat similar.
Now imagine all of the films falling one after other down the cup. Note that all the films start out with a horizontal stretch. This would mean that each cross-sectional film would be in the same state of oscillation after falling the same distance from the cup. In other words, initial phase of all the films would be identical.
So in the big picture, as you go down the flow, you are actually observing the different states of the above oscillations with respect to time.

When you plot the different time states of the above depicted 2-D oscillation in along a Z-axis, you get a pattern similar to the one we observe in reality (but less curvy).

Here we have not included any damping forces between adjacent cross-sectional films. If we had, we would have obtained a much smoother shape.
P.S. This was actually posted as an answer to another question which turned out to be a duplicate. Putting it here as it would be more appropriate for future readers.

Wavy stream of liquid


Wordpress Migration

Question: I'm a beginner in wordpress I've created my woocommerce website in a local server WAMP then I wanted to put it online so I used Duplicator plugin but I got the first version of wordpress .. without editions I got themes just downloaded and I didn't get any of my plugins , preferences or anything else I got a new created wordpress website in a default version .. Please can you help me !!!
Answer: WordPress has two 'parts': the code (WP core files, plus themes/plugin files), and the database. Both have to be placed in a new location for the 'parts' to work as they did on the source.
So one way to transfer the site to a new host is to copy those two 'parts' to the new host. Copying the files is easy, just FTP transfer the files from the source to the target location.
For the database, you need to do extra steps:

Create a new database on the target system. On most hosting sites, you can use the MySQL Wizard to make a new database. Set up credentials (user/pass) like the source (your local) system.
On your local system, export the database to a SQL file. You can use phpMyAdmin for this. Then on the target system, select your new database, and import (via phpMyAdmin) the SQL file you exported from your local system.

Then, one final step: change the site URL in the wp_options table (two locations) on the target system to match the URL of your domain. Again, using phpMyAdmin program to modify the database.
There are plugins that can 'clone' a system, but they aren't always successful, or require a premium ($) for the full transfer to work. The above procedure, although it will take a bit of time, will work. I've done it several times.
The googles can help you with the specifics of the above process. But it will work. And there is a sense of accomplishment when you finish.
added
Now, there may be some development URLs in your content, which will have to be adjusted to the URL for the target system. There are many googles that explain how to do that.
But I usually set up my development environment with the use of the (eventual) target domain by adding a hosts entry on my local machine to resolve the domain name to the local instance. This can be done several different ways, depending on your local development environment.
In a Windows environment, you would add an entry similar to this in the C:\windows\system32\drivers\etc\hosts file
127.0.0.1  www.example.com

...replacing the IP address with the IP of your development environment, and the domain name with the (eventual) target domain.
With this addition, any content you add to the development system will have the proper URL.
And, note that the above procedure of copying files/data will only work if your development system has a current copy of the target system data, because copying the databases will also copy the content from your local system.  But I have successfully used the above procedure to move a site from one hosting system to another.

Wordpress Migration


Export from Telerik RadGrid

Question: RadGrid can export its data to csv but default implementation doesnt fit terms of huge tables because it generates result export file in memory which doesnt work when you get like 5000k records.
I use RadGrid with LinqDataSource, and my tables contains millions of records. Im thinking on how to implement more smarty export. I have already had task subsystem running processes in threads etc, so what i really need is to get current RadGrid query with filters, sorting but without page limitation. This query i would put in my service which will «run» it and read record by record into file.
Does anybody know how to get current query, expression or whatever from RadGrid which would help to perfom the same query and read the data?
Answer: It seems that the single solution is to limit the number of the exported records:
Radgrid exporting large dataset

Export from Telerik RadGrid


Can cooking oil selection effect Maillard reaction?

Question: Ignoring flavor impartation. When pan-frying: Does picking a higher smoke point oil like avocado oil affect the speed of the Maillard reaction? Will it occur quicker if a lower smoke point oil like olive is used?
Answer: The Maillard reaction occurs at temperatures greater than 285°F (140°C). So, ignoring flavor, the oil you use (if any) has no influence over the reaction.  It needs a particular temperature to begin happening.  For what is happening, see the link. Now, in practice, flavor comes from both the Miallard reaction and caramelization (apart from other flavor ingredients), so the oil and the temperature can have significant impacts in that regard.


The film roll I bought said it was 24 exposures, but the camera let me take 27. If I develop it, will it become a blank roll?

Question: I use a non-disposable 35mm camera like kodak m38, and the film I used is kodak ultramax 400. This is my first time shooting films, I would really appreciate any help given. Thank you.
Comment: That's pretty normal. I always got 40-41 shots from a 36 film, although the first one is always at risk to be incomplete.
Answer: The only difference between the 24 exposures promised on the box and the 27 exposures you were able to take is the difference between how much of the roll was pulled out of the film cannister and exposed to light during loading your Kodak M38, and thus how much of the film was still inside the film cannister when the back of the camera was closed, versus how much film needs to be pulled out of the film cannister to load other cameras like older 35mm interchangeable lens SLR cameras.
Although roll film is marketed to take a certain number of shots, roll film has no frames until it is exposed. It's just one long continuous piece of unexposed film.
The frames are created by the width of the camera's film gate. The film gate is the hole just in front of the film that determines how much of the film is exposed each time you take a photo. Only the part of the film directly behind the hole will be exposed.
The gap between each frame is determined by how far the camera advances the film before it will let you take another photo. For most "35mm" cameras which actually use 135 format film, the film gate is 36mm wide, 24mm tall, and the film advances 38mm (which is equal to exactly eight sprocket holes on the edges) for the next photo, leaving a gap of 2mm between each frame. 135 format film is actually 35mm tall (that's where the nickname "35mm" comes from), but the extra 9mm, split between the top and bottom that are above and below the 24mm height in the middle that is actually exposed, are used for the sprocket holes and for printing film type, batch information, and frame numbers by exposing just the margins when the film is manufactured.

This piece of 135 format film has already been (over) exposed and developed, then five frames were cut from a longer strip. Prints from this film would be almost totally white. If it had been developed without first having been exposed, the entire 24mm tall middle would be the same light color as the unexposed 2mm gaps between each frame, and prints from such a negative would be almost totally black.
Older 35mm cameras required more of the film be pulled from the cannister when loading. One needed enough film to insert the leader into a slot in the skinny spindle of the takeup spool. Newer 35mm cameras made near the end of the 20th Century, especially those called "compact" or "point and shoot" 35mm cameras, which usually had a lens permanently attached, often required less of the film to be pulled from the film cannister to load the film and close the back of the camera. Often the film cannister sat closer to the edge of the film gate, as did the takeup spool or takeup roller on the other side of the film gate. Instead of a takeup spool with a skinny slotted spindle in the middle, many of these "compacts" have motorized rubber rollers that apply enough pressure to the sides of the film to insure it winds onto the takeup spool or roller. Even SLR cameras with interchangeable lenses that had a motor automatically wind and rewind the film also often wasted less of the film during loading. I often got 26 and sometimes 27 frames from a "24" roll of film with my Konica FS-1 and later almost always got 27 with my EOS Rebel SII. Both were interchangeable lens film SLR cameras with motorized film advance.
At one time some film brands began marketing their "24 exposure" rolls as "24+3" or "27" rolls. In Japan some still label them as "27 exposures".
The only difference between a 24 shot roll of 135 film and a 27 shot roll of 135 is the labeling. They're the same length. It was just that the newer self winding cameras that came along in the 1980s and 1990s could get more exposures from the same film length. During the transitional period when many users still used manually wound cameras but the newer self-winders were becoming widespread such rolls were sometimes marketed as "24+3" rolls. The older traditional cameras that required spooling the leader through a slit in the middle of the takeup spool could only get 24-25 shots out of the same roll that a self-winder could get 27.
Here is where the "extra shots' come from:
"24" rolls only need 910mm± of length to fit 24 frames that are each 36mm wide plus leave 23 2mm gaps between those 24 frames. But Kodak's 135 format "24" rolls are actually 1130mm± long. The extra 220mm± length allows for the amount exposed to light that is needed during loading the film into 135 format cameras that need the most pulled out of the cannister when loading the film. It also allows for the length left between the other end of the film that is attached to the spindle inside the film cartridge and the position of the final exposure.

If I develop it, will it become a blank roll?

Once the film is developed the development can not be undone. It is chemically "fixed" during the development process. "Fixed" in this case means no longer chemically reactive to additional light. It's more or less set in stone.
If the film was never loaded into your camera properly and never advanced out of the film cannister, then none of it was exposed. But once an unexposed roll has been developed, you can't then put it back in your camera and expose it because it has been "fixed" as a blank piece of film and will no longer chemically react to light.
The fact that you got 27 frames, which is about what one would expect from a "24 exposure" roll when using a compact 35mm camera like your Kodak M38, is a pretty good clue that you did load the film correctly and that you did actually expose 27 frames before the film ran out.
Have it developed and see what you captured!
Answer: A roll of film is one big long strip of photosensitive material. The frames are not marked out in advance. The 24 on the box is a (usually accurate) estimate of how many photos you will be able to take. Depending on your camera and how you load the film, it's not unusual for the strip to provide you with one or two (or more) exposures more than you were expecting. You can think of them as bonus free exposures. There's no problem here for you to worry about.
Enjoy film photography!
Answer: It might be that you did not link the leading edge of the film into the takeup spool properly, meaning the film may not have advanced for any of your exposures or the camera was never loaded.
You may have moved the film advance lever a little too hard and the end of the roll is still taped inside the canister but you have torn the sprocket holes in the side of the film.
Or you may have pulled too hard and tore the film from the canister and all of it is on the winder.
Sit inside a closet in a dark as possible room; at night is best. Sit for some time to allow your eyes to adjust to the darkness and if you can see ANY light, it will "fog" your film.
If you are in total darkness, open the back of the camera and feel if the film is still stretched across the shutter. If yes, close the camera and rewind the film. If you can feel all film is onto the takeup winder and not connected to the canister, shut the camera and arrange for the developing lab to remove the film using a black changing bag. It is like a sweater inside another sweater, with elastic on the sleeves and the waistline is double zippered. The lab technician puts the camera and a light-proof film container or reloadable film cassette inside the inner bag and double zips it closed. S/he puts their arms inside the sleeves and opens the camera and transfers the film to the container, seals it, and removes everything.
https://lensnotes.com/photography/film-changing-bag/


How does Terraforming work in Eminent Domain?

Question: Terraforming says you attach it to a planet, and if it would be enough to satisfy the printed colonization cost, settle the planet. How does this work? Does this count colonization reductions from settled planets or Fertile Ground? If not can it only settle starter planets?
Answer: The Terraforming action states:

Add this card to a planet as 2 colonies. If that fulfills the printed Colonize cost, Settle that planet.
  Note: Ignore Colonize discounts in your Empire.

As far as I understand, the following occurs:
Firstly, you can play it onto an unsettled planet to count as two colonies (much like playing a Colonize counts as one).
In addition, if once you've played it the planet has sufficient colonies to settle, you can settle it immediately (discarding the Terraforming and any other Colonizes and flipping the planet).
e.g. If you have an unsettled planet with a Colonize cost of 3 and one Colonize card already on it, you can play Terraforming to double-Colonize and then immediately settle that planet.
For Terraforming, all discounts are ignored, mostly for game-balance.
i.e. In the same example as above, if you had an unsettled planet with a Colonize cost of 3 and NO Colonize cards on it (but a discount to Colonize from, say, another planet) then you could double-Colonize, but you would NOT be able to immediately settle, since you do not reach the requirements while ignoring discounts. You COULD however settle it later without further Colonizes required, since the action remains on the planet and still counts as two colonies.
Comment: Hmm, I must have an older edition, my copy doesn't have the note.
Comment: Ah, you're quite right. It seems like there may not be a clarification on the card, but in this BGG thread (http://boardgamegeek.com/thread/708915/terraforming-questions), which is also where I got the description, the designer says: "In play testing I found that I did not like how Terraforming worked with that discount - too strong. Hence I decided on the restriction." So it may have been a late change, or only clarified in the rulebook somewhere (which I don't have in front of me to confirm).


get Original Attribute for Eloquent Model Laravel 5.1

Question: I have Foo Attribute that use getFooAttribute method to format it before display but in some places, I need original attribute for it. So how can I do it?
Comment: http://stackoverflow.com/help/how-to-ask
Comment: If you want to get it's original value you will have to remove your get mutator.
Comment: @Inurosen I need mutator in some places
Answer: Getting the original value of a particular attribute from v4.2 onwards:
$originalFoo = $model->getOriginal('foo');
Comment: getOriginal() method is intended to be used to get original value of an attribute loaded from the database. It will only work in scenarios where this value doesn't change. It won't work as the OP expected if this value gets modified. Quick example: 1) assume $model gets loaded from the DB and the value of $model->getOriginal('foo') is "foo". 2) Change value of the attribute: $model->foo = "bar"; 3) $model->getOriginal('foo') will return "foo" instead of "bar".
Comment: @jedrzej.kurylo That is why you should use the setter `$model->setFoo("bar")` instead. That preserves the `$original` array and is a good practice overall.
Answer: If you want to use mutator in the majority of the code but sometimes would like to access the original value, you can do it by fetching all attributes using getAttributes() method of your model and then fetching the value from there, e.g.:
$originalFoo = $model->getAttributes()['foo'];

Answer: If you want the raw field straight out of database skipping the mutator then
$mode->getRawOriginal('attribute')

is the way to go. $model->getOriginal() will give you the mutator value not the raw data you want.
see https://laravel.com/api/7.x/Illuminate/Database/Eloquent/Concerns/HasAttributes.html#method_getRawOriginal
Answer: for laravel 5 we can also use:
$model->getOriginal('foo')

credits to @bower
Answer: Laravel 7 and Symfony 5 respectively
$model->getRawOriginal()

The getOriginal Method
Likelihood Of Impact: Low
The $model->getOriginal() method will now respect any casts and mutators defined on the model. Previously, this method returned the uncast, raw attributes. If you would like to continue retrieving the raw, uncast values, you may use the getRawOriginal method instead.

Reference A: Upgrade Guide: Upgrading To Laravel 7.0 From 6.x
Reference B: Laravel 7.x Eloquent API
Answer: I am using 5.3 and for this I use $model->getOriginal()['foo']
Comment: It's worth noting that if you wish to obtain the original value of a particular attribute, you can just pass a key into `getOriginal`. e.g. `$model->getOriginal('foo')`
Answer: Worked for me
$newProduct = $product[0]->getRawOriginal();

Answer: Actually looks all above are correct, just see if this is in array key [0]
for example:
$originalFoo = $model[0]->getRawOriginal('foo');

Answer: Something that might be worth mentioning as well is that the Laravel model class overwrites the magic methods for __set and __get, so you can also retrieve the original attribute dynamically i.e. $model->original.
See https://github.com/laravel/framework/blob/5.1/src/Illuminate/Database/Eloquent/Model.php


Man marooned on a planet with blind telepathic animals

Question: Which SF short story had a man marooned on a planet with blind telepathic animals and he had to think his way out of trouble? For example, to escape predators he pretends to be a tree but then a woodpecker attacks him...
Answer: Which sf short story
"The Odo[u]r of Thought" by Robert Sheckley, first published in New Worlds Science Fiction #25, July 1954 which is available at the Internet Archive.
had a man marooned on a planet

Cleevy stared for a moment, turned, and sprinted to the radio."No more fuel," he said. "Catalytic actions, I think. I told you we needed new tanks. I'm putting down on the first oxygen planet I can find."

with blind telepathic animals

Neither animal had eyes or ears. How did they track each other? Smell? If so, why did the wolf have so much trouble finding the squirrel?He heard a low growl and turned. There, not fifty feet away, was something that looked like a panther. A yellow-brown, eyeless, earless panther.Damned menagerie, Cleevy thought, and crouched down in the tall grass. This planet was rushing him along too fast. He needed time to think. How did these animals operate? Instead of sight, did they have a sense of location?The panther began to move away.Cleevy breathed a little easier. Perhaps, if he stayed out of sight, the panther . . .As soon as he thought the word 'panther', the beast turned in his direction.What have I done? Cleevy asked himself, burrowing deeper into the grass. He can't smell me or see me or hear me. All I did was decide to stay out of his way . . .Head high, the panther began to pace towards him.That did it. Without eyes or ears, there was only one way the beast could have detected him.It had to be telepathic!

and he had to think his way out of trouble?

All he had to do, Cleevy thought, was not to think of—was to think of something else. In that way, perhaps the—well, perhaps it would lose the scent. He started to think about the girls he had ever known, in painstaking detail.The panther stopped and pawed the ground doubtfully.Cleevy went on thinking; about girls, and ships, and planets, and girls, and ships, and everything but panthers . . .The panther advanced another five feet.

For example, to escape predators he pretends to be a tree

Cheevy backed towards the wolves, wishing he had something to climb. What he needed was a cliff, or even a decent-sized tree . . .But there were shrubs! With inventiveness born of desperation, Cleevy became a six-foot shrub. He didn't really know how a shrub would think, but he did his best.He was blossoming now. And one of his roots felt a little wobbly—the result of that last storm. Still, he was a pretty good shrub, taking everything into consideration.

but then a woodpecker attacks him...

A little bird landed on his shoulder.Isn't that nice, Cleevy thought. He thinks I'm a shrub, too. He's going to build a nest in my branches. That's perfectly lovely. All the other shrubs will be jealous of me.The bird tapped lightly at Cleevy's neck.Easy, Cleevy thought. Wouldn't want to kill the tree that feeds you . . .The bird tapped again, experimentally. Then, setting its webbed feet firmly, proceeded to tap at Cleevy's neck with the speed of a pneumatic hammer.A damned woodpecker, Cleevy thought, trying to stay shrub-like.
Comment: Thanks very much for your answer! I don't need to check it, the title and author rang a bell immediately :-)


How is Chainlink decentralized?

Question: I believe one of the main criticisms of chainlink is that it is not decentralized enough, adding more nodes would be a big step in a positive direction. When I pull data through a node, that node could be corrupt and ruin my smart contract, so what gives?
Answer: Saying Chainlink is "not decentralized enough" is a lot like saying "a tree is not a forest enough".
Chainlink is a framework for connecting off-chain data to smart contracts in a decentralized manner. In the same sense that one Ethereum node is a part of the whole decentralized ecosystem, one Chainlink node is apart of the whole Chainlink ecosystem.
You can build an application using as many chainlink nodes as you like, right now there are over 100 listed on market.link, and you can build your system accordingly.
If you'd like an out-of-the-box solution, you can use reference contracts which are a solution for those who want a pre-packaged decentralized solution. You can of course, use this alone, or as a starting point for a more decentralized application. These have 7 - 21 nodes each, and are constantly being improved.

How is Chainlink decentralized?


How to open Mono GUI applications on OS X?

Question: I tried Fiddler and Keepass on Mono and both these applications start, their icons jump on the Dock, but no window is displayed.
Comment: For now this is not a good question. You need to give some more information. What is Mono, what version did you use? And except for OS X we need to know what version as well. Do you have checked the Console.app for some more information? Have you tried the stable Mono version 2.x as well?
Comment: Are there error messages appearing in **/Applications/Utilities/Console.app**?
Comment: Mono is an open source cross platform implementation of the .NET Framework. It's used to run some Windows applications on OS X for example.
Comment: I informed it was OS X Mavericks on the tags
Comment: I tried the stable version of mono.
Comment: Just a suggestion: have you tried launching the applications from X11/XQuartz? Try launching X11.app, opening xterm, and then launching the applications with `mono `
Comment: I still think this question is of low quality.
Answer: This might seem like a silly suggestion but are you giving the applications enough time to launch?
I tried installing and launching both applications. The first launch took a surprising amount of time; as you describe the icon appears in the Dock almost immediately but then no UI seems to appear. However if you leave it long enough the UI then does appear (about 4-5 minutes on a 2011 Macbook Pro).
Subsequent launches are a lot faster.
If you are curious to see what it is doing you can run this sudo opensnoop -v | grep mono-sgen in a Terminal when you launch the applications. On my system the delay on initial launch just seems to be Mono reading all the fonts on my system and caching them in ~/.cache/fontconfig. Luckily it just seems wants to do that once.
Answer: I think you need a UI Toolkit to interface with the Mono framework.
FAQ: Basics

What is Mono™ exactly?
The Mono Project is an open development initiative sponsored by Novell to develop an open source, UNIX version of the Microsoft .NET development platform. Its objective is to enable UNIX developers to build and deploy cross-platform .NET Applications. The project implements various technologies developed by Microsoft that have now been submitted to the ECMA for standardization.

FAQ: GUI applications

Will Mono enable GUI applications to be authored?
Yes, you will be able to build GUI applications.
Indeed, that was the main driver for the creation of Mono. Today you can use Gtk# to develop GUI applications on Windows, Linux and MacOS X.
We are also developing a complete Windows.Forms implementation.
A list of pros and cons on the various APIs is available in our Gui Toolkits page.

You can check Banshee (audio player) as a working example. If you mount the disk image and inspect the package contents (Banshe.app/Contents/Resources) you can see that it uses Gtk 2.0 for the UI.


Will an ETF increase in price if an underlying stock increases in price

Question: If there is an ETF that is made up of 5 stocks and let us say one day, one of these stocks shoot up by 10%, will the underlying ETF also shoot up, even if there was no additional buying activity for the ETF itself?
Answer: The ETF supply management policy is arcane.  ETFs are not allowed to directly arbitrage their holdings against the market.  Other firms must handle redemptions & deposits.  This makes ETFs slightly costlier than the assets held.
For ETFs with liquid holdings, its price will rarely vary relative to the holdings, slippage of the ETF's holdings management notwithstanding.  This is because the firms responsible for depositing & redeeming will arbitrage their equivalent holdings of the ETF assets' prices with the ETF price.
For ETFs with illiquid holdings, such as emerging markets, the ETF can vary between trades of the holdings.  This will present sometimes large variations between the last price of the ETF vs the last prices of its holdings.
If an ETF is shunned, its supply of holdings will simply drop and vice versa.
Answer: The creation mechanism for ETF's ensures that the value of the underlying stocks do not diverge significantly from the Fund's value.
Authorized participants have a strong incentive to arbitrage any pricing differences and create/redeem blocks of stock/etf until the prices are back inline.
Contrary to what was stated in a previous answer, this mechanism lowers the cost of management of ETF's when compared to mutual funds that must access the market on a regular basis when any investors enter/exit the fund. The ETF only needs to create/redeem in a wholesale basis, this allows them to operate with management fees that are much lower than those of a mutual fund.

Expenses Due to the passive nature of indexed strategies, the internal
  expenses of most ETFs are considerably lower than those of many mutual
  funds. Of the more than 900 available ETFs listed on Morningstar in
  2010, those with the lowest expense ratios charged about .10%, while
  those with the highest expenses ran about 1.25%. By comparison, the
  lowest fund fees range from .01% to more than 10% per year for other
  funds. (For more on mutual fund feeds, read Stop Paying High Fees.)
Answer: Since the market is in general rather efficient, the price of the ETF will most of the time reflects the prices of the underlying securities. However, there are times when ETF price deviates from its fundamental value. This is called trading at a premium/discount. This creates arbitrage opportunity, which is actually being studied in finance literature.
Comment: You will have to understand the ETF creation/redemption mechanism to understand this. Try to read this article here http://www.indexuniverse.com/etf-education-center/7540-what-is-the-etf-creationredemption-mechanism.html
Comment: The "nobody wants to buy" is the part that you're missing since the arbitrage opportunity is what various firms will take advantage and move the trading price of the ETF and thus there will be those seeking to exploit these differences if possible.
Comment: Thanks, but the ETF is a stock of its own. SO if nobody wants to buy the ETF, why will it shoot up just because the underlying shot up? It is a bit unintuitive since the way i understand, there needs to be a demand for the ETF itself for its price to increase.
Comment: @zsljulius that article was great! I now want to know more details about these authorized participants (AP)
Answer: An ETF consists of two componenets : stocks and weightage of each stock.
Assuming the ETF tracks the average of the 5 stock prices you bought and equal weightage was given to each stock  , an increase in 20% in any one of the five stocks will cause the price of the ETF to increase by 4% also
This does not take into consideration tracking error && tracking difference , fund expense ratio which may affect the returns of the ETF also
Comment: You do know the value of the stocks in the ETF can have a different value than the trading price of the ETF yes?
Comment: @JBKing The difference is due to the weightage given for each stock and the tracking error
Comment: So then the fund company sets the price that the ETF trades? That seems more than a little nutty to me. http://sg.ishares.com/understand_etfs/basics/liquidity.htm covers a creation/redemption mechanism that is supposed to keep the share price near the Net Asset Value of the fund as ETFs aren't quite like open-end funds in this regard to my understanding.
Comment: No the fund company does not set the price that the ETF trades. It normally tracks the underlying which is normally the share price of the stock , any difference is caused by tracking error
Comment: While an ETF may accumulate tracking error relative to its index, it's *also* possible for a buyer and seller to exchange shares of the ETF on an exchange at a price that implies a market cap which is different than the sum of all the ETF assets (regardless of any index). That is the situation being analyzed here.


Added a 128GB SSD to 27" iMac

Question: I've added a 128GB SSD to my mid 2011 27" iMac and replaced the defective original HDD with a new one (1TB). Used Time Machine as back-up.
How do I transfer ALL my data (about 620GB) to the two new drives (from TM)
 using the SSD for the OS (Sierra) and the HDD for everything else.
What´s the simplest way to do this?
Comment: Create a 3rd-party Fusion drive with the 128 GB SSD and the 1 TB HDD and restore your backup. Then you don't have to mess around with a 1:n file system split. TM just isn't made for this if OS and data (e.g. your main user) wasn't separated previously. It is possible though by restoring the backup to the HDD and then rsyncing all folders except your user (=data?) folder to the ssd, probably blessing the ssd system, linking your hdd user folder to the ssd and deleting the rsync'd source files and folders in a second step.
Comment: Thanks for the help klanomath; next big Problem for me is how to create a 3rd-party Fusion drive? I am no mac expert. Is it safe?
Comment: [Can I make a DIY Fusion Drive?](https://apple.stackexchange.com/a/70113/93229)
Comment: Thanks a lot. Awesome information.I´ll try my best (keeping fingers crossed)
Answer: You can use a HDD enclosure to connect it via USB.
Comment: I Just want to transfer myTime Machine image back-up to the "new" machine, using the SSD for the OS (Sierra) and the HDD for everything else...

Added a 128GB SSD to 27" iMac


How to change PostgreSQL IP address for streaming replication

Question: I have Postgres replication (master & slave).
The slave server has 2 local IP addresses (192.168.1.17 & 192.168.2.12). As far as I know the streaming replication worked fine with slave using 192.168.2.12. But somehow the slave could not connect to master because it required another IP:

2017-01-30 23:53:13.510 WIB >FATAL:  no pg_hba.conf entry for replication connection from host "192.168.1.17", user "user1", SSL off

I can put 192.168.1.17 in pg_hba.conf to work around this problem. I want to know if I did anything wrong to make the slave Postgres IP change? It was working just fine.
Comment: How is the connection specified in `recovery.conf`?
Answer: This is not the question about PostgreSQL - this is about routing. Just route from 192.168.1.17 became as better than from 192.168.2.12


Getting the sale amount at a store from last period, given that there are many stores (pandas)

Question: Given that I have 3 columns of data as such, where 1st column is date of sale record, 2nd column is store address, and 3rd is column sale amount as following dataframe :
df = pd.DataFrame({'Date' : ['01-01-2011','01-01-2011','01-01-2011','01-07-2011','01-07-2011','01-08-2011'],
                   'Store_Address' : ['1000E, Chicago IL','1000E 67th, Chicago IL','1000 N Central Park Chicago IL',
                                      '1000 A Central Park Chicago IL','1000 B Central Park Chicago IL',
                                      '1000 C Central Park Chicago IL'],
                   'Sales': [1000, 2000, 1500, 3000, 2000, 2500]})

>>> df

         Date                   Store_Address  Sales
0  01-01-2011               1000E, Chicago IL   1000
1  01-01-2011          1000E 67th, Chicago IL   2000
2  01-01-2011  1000 N Central Park Chicago IL   1500
3  01-07-2011  1000 A Central Park Chicago IL   3000
4  01-07-2011  1000 B Central Park Chicago IL   2000
5  01-08-2011  1000 C Central Park Chicago IL   2500

I am interested in creating a column of data that indicates the sale from each store from the last time the sale was recorded. How would you go about doing it?
note: not all sale records are recorded on the same day. some stores do not operate on some months/years.
I was thinking to create a temporary dataframe of each address with the sale, get the previous sale value, combine it back to the main dataframe. repeat the process for all address, then combine these columns to a single column.
Do you have a better way of doing it? Thanks for sharing.
Answer: Try:
df.groupby('Store_Address')[Sales].last()


Webots - Copy Paste a Robot

Question: In Webots: I want to do a Predator/Prey simulation and need to spawn the exact same robot when an event occurs. How do I copy/paste a robot I have in my world scene tree. I build it my self therefore I can not use a Webots PROTO. When I use the "Import EXTERNPROTO" function only my TexturedBackground and my Arena node are visible in my world file. They appear purple and the other nodes in the scene tree are green.
Answer: You should probably turn your robot into a PROTO file, store it into your local protos folder and add it to the list of Importable EXTERNPROTO. This way, your supervisor process will be able to spawn it dynamically in the simulation by using the wb_supervisor_field_import_mf_node_from_string function. This tutorial explains in details how to proceed.
Disclaimer: I am a Webots developer working at Cyberbotics.

Webots - Copy Paste a Robot


Can the Lebesgue integral be defined so that it can be applied to non-Lebesgue measurable subsets of $\mathbb{R}^d$?

Question: We can define the integral of a function $f$ on any $M \subseteq \mathbb{R}^d$ as $\int_{\mathbb{R}^d} f \cdot \chi_M$, irrespective of whether $M$ is Lebesgue-measurable or not. It works fine for the zero function on the Vitali set $V$, so that $\int_V 0=0$. However, if we follow the measure theory approach, $\int_V 0$ is simply not defined. Is this not a shortcoming of the measure theory approach to the Lebesgue integral? Could there not be some non-trivial function $f$ with $f \cdot \chi_M$ integrable over $\mathbb{R}^d$, even if $M$ is non-measurable?
Answer: Of course you can use an "upper integral" or a "lower integral".  But if you do this, then linearity can fail.  That is, the property $\int_M f + \int_N f = \int_{M \cup N} f$  for disjoint sets $M,N$ could fail.

Your case of the $0$ function on the Vitali set $V$, though, is not a problem.
We define $\int_V 0$ to be $\int_{\mathbb R} 0\cdot \chi_V$.  But since $0 \cdot \chi_V$ is $0$ on all of $\mathbb R$, this integral is computed as the integral of the measurable function $0$.
Comment: Yes $\chi_{M \cup N}=\chi_M + \chi_N$, but linearity of the integral is proved for measurable functions only.  This is why the upper integral and lower integral (defined even for non-measurable functions) are not very useful.
Comment: Could there be a non-trivial function $f$ for which $f \cdot \chi_V$ is measurable?
Comment: @user1975053 You could pick a measurable set $E$ containing $V$ and set $f : = \chi_{E \setminus V}$.
Comment: But would $E \setminus V$ be measurable?
Comment: @GEdgar How could linearity fail? Wouldn't always be $\chi_{M \cup N}=\chi_M + \chi_N$?


Where do I find standard tissue and cell names?

Question: I am developing specialized database on some desease microarray experiments. The initial data is retreived from NCBI and ArrayExpress databases. The problem is that sample attributes sometimes specify similar or same things but in different manners: as cell and tissue names, desease names, age, ethnicity of donor, ect. Where do I find conventions for naming experiment sample attributes?
Comment: I doubt there are many. There are *some* conventions regarding naming cell types corresponding to what surface and internal markers are expressed (or not), but to my knowledge those are in early stages. In papers, authors generally define their own naming conventions, which may or may not match up to others. The problem is there's a lot of argument about how to name things, with each lab or institution having their own preferences. As a simple example, tuberculosis is also known as Koch or Koch's Disease. You'll probably need to pull from a lot of individual databases, and just use synonyms.
Comment: Also there can be conventions without controlled vocabulary ( http://www.ncbi.nlm.nih.gov/geo/info/MIAME.html )
Answer: It turns out that ArrayExpress itself uses various ontologies (dictionaries structured as trees) available at Ontology Lookup Service when it processes users' search queries. Experimental Factor Ontology is the precisely one I was searching for.
Medical Subject Headings (MeSH) dictionary turned out to be handy as well.


How do I remove the port number from Tomcat urls?

Question: I have Groovy on Grails app deployed on Tomcat/Apache (CentOS). Currently, it is accessed via a URL like http://www.domain.com:8080/AppName. I would like to access it via http://www.domain.com.
How do I go about this?
Answer: Setup your server to listen on port 80.
http://www.klawitter.de/tomcat80.html
Answer: I assume that you are trying to move http://www.domain.com:8080/AppName to http://www.domain.com/ without the trailing AppName. In that case, you may want to consider running a reverse proxy in front of Tomcat. Merely switching the port from port 8080 to 80 would still require you to access your app via http://www.domain.com/AppName.
Apache can be configured to do this. You will just need to set up mod_proxy with the following config:
ProxyPass / http://localhost:8080/AppName/
ProxyPassReverse / http://localhost:8080/AppName/

You can also do this with other web-servers such as lighttpd or nginx and what nots, basically most reverse proxies can do it in one form or another.
Comment: Removing the trailing `AppName` without a proxy is as simple as naming the application `ROOT`. If Tomcat runs multiple applications each with their own domain, a `Host` can be configured for each of them (like an Apache `VirtualHost`)
Comment: how to setup mod proxy? is this is available for apache2?
Answer: The specification is that if there is no port number on a URI, then the default is port 80.
I had a Tomcat application that was running as port 80, and I was concerned as the Tomcat would run as root (due to port 80).  Furthermore, I could not really be sure of the security of the application.  So I decided to make the changes necessary to run this as another un-privd port.  My problem as yours is keep the URI simple.  I found on the web a few steps that I needed to do, and I was on a Linux sytem.
First, redirect port 80 to port 8080 (my designated alternative).  You can easily do this by activating iptables, and using the following simple directives:
iptables -t nat -A OUTPUT -d localhost -p tcp --dport 80 -j REDIRECT --to-ports 8080
iptables -t nat -A OUTPUT -d your_hostname -p tcp --dport 80 -j REDIRECT --to-ports 8080
iptables -t nat -A PREROUTING -d your_hostname -p tcp --dport 80 -j REDIRECT --to-ports 8080

I believe that I substituted my IP number for both localhost and your_hostname when I configured this.
Then, you need to make some changes in the Tomcat configuration file: (1) change the connector port to 8080 (for this example) and the proxy port to 80.  You can then run tomcat as a non-root user, still have the simple URI, and everybody is happy.  Sorry that I cannot remember the specific XML file to change here.
Answer: I tried too solutions for that:

First one, i rund 2 tomcats servers behind a nginx web server as revers proxy, but i had problem with shared session, and i'm working on this solution.
Second one, that i kept is a kernel space port forwarding.
Answer: The default http port is 80, and unless you specify a port other than 80 in the URL your browser will attempt to connect to port 80.  This is just the way that http works.
The solution is to reconfigure your web server to run on port 80 instead of port 8080.  You'll need to check that there isn't already a site on port 80 first of course, and if there is your options are going to be limited.
Answer: If your clients are accessing the site from outside of your subnet and going through a router/firewall type device you can configure that to forward the external port 80 to internal port 8080.
That way you can provide what looks like a normal app to external clients, and internally you can see reality.
This is also useful for something like:
app1.domain.com
app2.domain.com
Forwarding to the same server internally on different ports.


How to retrieve object by entityKey with endpoints-proto-datastore?

Question: I have a model
class MyModel(EndpointsModel):
    _message_fields_schema = ('entityKey', 'prop')
    prop = ndb.StringProperty()

and an API method:
@MyModel.method(request_fields=('entityKey',),
                  path='mymodel/{entityKey}', http_method='GET', name='mymodel.get')
def mymodel_get(self, mymodel):
    if not mymodel.from_datastore:
      raise endpoints.NotFoundException('mymodel not found.')
    return mymodel

But when I try a query like
http://localhost:8080/_ah/api/myapi/v1/mymodel/adsfasf-cm9jay1zdG9wchELEgRBcmVhGICAgICAgIAJDA

I get a 404. I know the object exists, and I know that's the correct urlsafe key. What's going on? The same code works when using 'id' instead of 'entityKey' and query with the integer key.
Answer: The entityKey you mention is the urlsafe combination of the object's type and id.
To create a key from that string use this code:

rev_key = ndb.Key(urlsafe=urlString)

For more information see this section in the NDB Datastore API docs.
Answer: The code you have written is correct, your model and method are fine.
Which leads me to believe your problem is actually in the app.yaml file.
Make sure one of your handlers looks like this:
handlers:
- url: /_ah/spi/.*
  script: MyApi.APPLICATION

Note that although the handler points to /_ah/spi/.* the actual path is /_ah/api/
Good luck


How is the dichromate anion generated from potassium dichromate?

Question: How does $\ce{K2Cr2O7}$ become $\ce{Cr2O7^2-}$ when dissolved in water?
Comment: Questions based on related concept: [How to determine which ions will pair to form a compound in an aqueous solution?](//chemistry.stackexchange.com/q/96387) and [Acid-base reaction vs. salt dissolving reaction](//chemistry.stackexchange.com/q/92379)
Answer: You don't seem to be overly familiar with the concepts of salts (made of cations and anions), ionic bonds and solvation of salts in water.
Lets's walk through some examples in which a solid material made from cations and anions is dissolved in water in such a way that the anions and cations are each surrounded and stabilized by water molecules (i.e. they are in an aqueous state, denoted as aq):
$$\begin{align}
\ce{NaCl (s) &->[H2O] Na+ (aq) + Cl- (aq)} \\
\ce{MgSO4 (s) &->[H2O] Mg^2+ (aq) + SO4^2- (aq)} \\
\ce{Na2SO4 (s) &->[H2O] 2Na+ (aq) + SO4^2- (aq)} \\
\ce{K3PO4 (s) &->[H2O] 3K+ (aq) + PO4^3- (aq)} \\
\ce{Mg3(PO4)2 (s) &->[H2O] 3Mg^2+ (aq) + 2PO4^3- (aq)}
\end{align}$$
As a general rule for the solvation of the salts, we can derive:
$$\ce{M_mX_n (s) ->[H2O] mM^n+ (aq) + nX^m- (aq)}$$
Applying this to potassium dichromate, we recognise that the cation is $\ce{K+}$ and the anion is $\ce{Cr2O7^2-}$. Therefore, it is the dissolution of potassium dichromate in water which generates the dichromate anion:
$$\ce{K2Cr2O7 (s) ->[H2O] 2K+ (aq) + Cr2O7^2- (aq)}$$
As for the physical reason behind why the salts dissolve, you may find a more in-depth discussion here: Why do salts such as NaCl dissolve?


How to transfer files from remote server to local machine when ssh'd in to remote server

Question: I am trying to transfer files from a remote server to my local machine using FTP. I am ssh'd on to the remote server and want to connect to my local machine. The remote server runs on a Linux operating system whereas my local machine runs on a Windows operating system. I know how to transfer files to and from the remote server from my local machine but I am confused as to how to transfer files to and from the local machine from the remote server. How do I do this?
Comment: Are you saying you want to make it look like the remote server pushed/pulled the files? https://stackoverflow.com/a/24140396
Comment: I don't need it to look like anything. I was just curious how you would transfer files to your local machine when ssh'd in to the remote server (as opposed to transferring files from the remote server to my local machine when ssh'd in to my local machine).
Answer: If you know how to transfer the files when initiating the transfer from your local machine, then just open another window and do it.
I should point out that using FTP for file transfers is insecure.
FTP also doesn't work well with NAT routers.
If your need to initiate the transfer from the remote side, create a reverse tcp tunnel with SSH and use the to connect to your local machine and transfer the files.


How can solve fogs,lights problem with Cycles?

Question: I'm learning some tutorials that is industrial background.
I know this tutorial is focused on Eevee system. but I want to get a better quality of scene. that's why I want to use Cycles, but there are some problems such as lights, fogs
those pictures are including lights,fogs that I learned from the tutorials. yes it's very worked in Eevee, the lights has blur, the fog is staying at the background obviously, but the Cycles version doesn't work, How can I solve this problems? I want to have blur lights, fogs in my scene
Answer: In eevee, there is a feature called bloom you are using. But unfortunatley cycles doesn't have such an option , unless you use compositing. I recommend you watch some compositing tutorials on making lights glow in cycles. Here is the short summary of the process: select the objects you are using as a light, and then go to object properties: pass index to 2 on all of them (Remeber to set it to two on all the objects that have emmision shaders or are covering a lamp underneathe.). Then in the render layers tab enable object index (Make sure you are in cycles to find this option.). Then render your image, switch to the compositing tab, and follow the compositing setup in the image below.
Comment: Thank you for your answer, plus Do you have an information about fogs?, I'd like to know in cycles like Eevee picture
Comment: I mean, as you can see the first picture, you can see foggy feelings. I want to get this feelings and adjust in Cycles
Comment: @HyeonJEONG If you want to use volumetrics, you can but in the eevee picture it is the effect of bloom, so I say you go to the render layers tab and then enable emit. After that render your image again and in the compositor instead of using the ID Mask as the image input for the blur node, use emit. Then play with the blur and mix node settings a bit. This way also might not work.
Comment: @HyeonJEONG You can see compositing tutorials about how to add mist in blender, or maybe watch some tutorials on volumetrics rendering in cycles.
Comment: Thank you so much!!! I will try it, and thank you!
Comment: You're Welcome (!


How does MPEG4 compression work?

Question: Can anyone explain in a simple clear way how MPEG4 works to compress data.  I'm mostly interested in video.  I know there are different standards or parts to it.  I'm just looking for the predominant overall compression method, if there is one with MPEG4.
Answer: MPEG-4 is a huge standard, and employs many techniques to achieve the high compression rates that it is capable of.
In general, video compression is concerned with throwing away as much information as possible whilst having a minimal effect on the viewing experience for an end user. For example, using subsampled YUV instead of RGB cuts the video size in half straight away. This is possible as the human eye is less sensitive to colour than it is to brightness. In YUV, the Y value is brightness, and the U and V values represent colour. Therefore, you can throw away some of the colour information which reduces the file size, without the viewer noticing any difference.
After that, most compression techniques take advantage of 2 redundancies in particular. The first is temporal redundancy and the second is spatial redundancy.
Temporal redundancy notes that successive frames in a video sequence are very similar. Typically a video would be in the order of 20-30 frames per second, and nothing much changes in 1/30 of a second. Take any DVD and pause it, then move it on one frame and note how similar the 2 images are. So, instead of encoding each frame independently, MPEG-4 (and other compression standards) only encode the difference between successive frames (using motion estimation to find the difference between frames)
Spatial redundancy takes advantage of the fact that in general the colour spread across images tends to be quite low frequency. By this I mean that neighbouring pixels tend to have similar colours. For example, in an image of you wearing a red jumper, all of the pixels that represent your jumper would have very similar colour. It is possible to use the DCT to transform the pixel values into the frequency space, where some high frequency information can be thrown away. Then, when the reverse DCT is performed (during decoding), the image is now without the thrown away high-frequency information.
To view the effects of throwing away high frequency information, open MS paint and draw a series of overlapping horizontal and vertical black lines. Save the image as a JPEG (which also uses DCT for compression). Now zoom in on the pattern, notice how the edges of the lines are not as sharp anymore and are kinda blurry. This is because some high frequency information (the transition from black to white) has been thrown away during compression. Read this for an explanation with nice pictures
For further reading, this book is quite good, if a little heavy on the maths.
Comment: Sharp edges aren't high-frequency, because they don't repeat. They're actually a sum of every frequency at once, which is why DCT compression and some image resizers will add noise around lines instead of blurring them.
Comment: It should be added that DCT (Discrete Cosine Transform) is not performed on the image as a whole. The image is broken up into 8x8 or 16x16 pixel blocks, and the DCT is performed on each block. This is because the DCT performance decreases rapidly for larger images. Since MPEG must be streamed, the decoding must be very fast.
Answer: Like any other popular video codec, MPEG4 uses a variation of discrete cosine transform and a variety of motion-compensation techniques (which you can think of as motion-prediction if that helps) that reduce the amount of data needed for subsequent frames. This page has an overview of what is done by plain MPEG4.
It's not totally dissimilar to the techniques used by JPEG.
Answer: MPEG4 uses a variety of techniques to compress video.
If you haven't already looked at wikipedia, this would be a good starting point.
There is also this article from the IEEE which explains these techniques in more detail.
Answer: Sharp edges certainly DO contain high frequencies. Reducing or eliminating high frequencies reduces the sharpness of edges. Fine detail including sharp edges is removed with high frequency removal - bility to resolve 2 small objects is removed with high frequencies - then you see just one.

How does MPEG4 compression work?


Finitely generated free group has finite rank

Question: Initially I was trying to prove that the commutator subgroup of $F_2$ (=free group of rank $2$) is not finitely generated. It seems possible to prove that it is indeed free of infinite rank. To get to a contradiction I have to prove that if a free group is finitely generated then it has finite rank but I can't find a way, despite it seems trivial.
Comment: If it is generated by $n$ elements then it has at most $2^n$ homomorphisms to the group of order $2$, so its rank must be at most $n$ (since a free group of rank $m$ has exactly $2^m$ such homomorphisms).
Comment: By the way it very unclear what you are asking, and you should probably define what you mean by rank, since it is one of the most overused words in mathematics.
Comment: @DerekHolt I will try to clarify your arguments to get to an answer. The homomorphisms from a finitely generated group on $n$ generators to $\mathbb{Z}_2$ are defined by their values on the generators. Since there are two choices for each generator, there are (at most) $2^n$ homomorphisms. If the rank was greater than $n$ (possible infinite) then I would have more than $2^n$ options, a contradiction. That seems correct and elegant.
Answer: If we would have a free group $F$ with rank $|X|$ where $|X|$ is infinite, then we can see $F$ as the group of all words over $X\cup X^{-1}$ with the usual concatenation (the 'standard' free group). Suppose we would have a finite generating set $\{g_1,\dots,g_k  \}$. Then every $g_i$ is a word $x_{i_1}^{\pm}\dots x_{i_{n_i}}^{\pm}$ which uses only finitely many letters of $X$, so there will always be an element $x \in X$ not appearing in any of the generators. This implies that $x$ is not in the subgroup generated by $\{g_1,\dots,g_k\}$ so no such generating set can exist.
Alternatively, you could prove that the abelianization of the free group $F$ of rank $|X|$ is the abelian free group of rank $|X|$, i.e. $$\bigoplus_{x\in X} \mathbb{Z} $$
using the universal property. Tensoring with $\mathbb{Q}$ gives you a vector space of dimension $|X|$, which has clearly no finitely generating set (because such a set should contain a basis).
Answer: The commutator group is the kernel of the canonical surjection $F_2\to Z^2$ given by abelianization. It is therefore isomorphic to the Cayley graph of $Z^2$ endowed with a standard set of generators. From this, drawing a picture of this Cayley graph in the plane, one sees that it is freely generated by the elements $a^nb^m[a,b](a^nb^m)^{-1}$, corresponding to all squares in the plane. Note that these elements are commutators $=[a^nb^ma(a^nb^m)^{-1},a^nb^mb(a^nb^m)^{-1}]$. Geometrically, if an element belongs to the commutator group, it defines a closed curve in the graph, and this curve decomposes into squares of size 1. One can translate this into an algebraic proof that these elemnts is a free basis.
Comment: Thanks for your answer but my question was not if the commutator subgroup is finitely generated. As the title says, I want to prove that a finitely generated free group is of finite rank...
Answer: The commutators $[x,y^n]=xy^nx^{-1}y^{-n}$ for $n=1,2,3,\ldots$
generate freely an infinite
rank subgroup of the free group with generators $x$ and $y$.
Comment: So what ? A free group of finite rank contains infinite rank free subgroups.
Comment: @Thomas which is what the OP wants to prove.
Comment: No he wants to prove that the commutator subgroup is not f.g.
Comment: Seems that my question is not clear... I only want to prove that a finitely generated free group is of finite rank. I know how to prove that the commutator subgroup is of infinite rank.
Comment: @user128787 What does *finite rank* mean if not "finitely generated"?
Comment: @LordSharktheUnknown finite rank implies finitely generated. I want to prove the opposite


Command line code to pin program to taskbar Windows 10?

Question: I'm trying to reimage several computers, and am making a batch file to run the basic commands. Is there a command line code that will allow me to pin programs to the task bar? For instance, Internet Explorer.
Answer: Opinion - Microsoft explicity does not want to provide a method for anyone to add/remove pin items for the user. They are worried about third party applications arbitrarily pinning and unpinning items as a way to influence which programs a user will run. Therefore they have made this very difficult on the latest versions of Windows 10.
Method 1 - There WAS a method for scripting this using VBScript which involved enumerating through FolderItem.Verbs and activating the one called "pin to taskbar". However Microsoft removed this item from the Verbs collection while leaving it available on the UI for manual selection with a mouse. There are many websites that explain exactly how to do this with a VB script but this method does not work on the latest versions of Windows 10.
Method 2 - Probably due to backlash from the enterprise community, Microsoft now provides a method through the use of Group Policy to create a default set of items to unpin or pin for a new user account but this does not appear to be useful for one-off customized pinning. An internet search for the following terms will lead to the info: group policy taskbar pin.
Method 3 - The other answer provided here, simply copying a link file to the User Pinned\Taskbar folder, WILL NOT WORK in current versions of Windows 10. It may have worked at some point but this does not work any longer.
Method 4 - There is a third party utility called SYSPIN. This is a standalone EXE that apparently works. The company or website is called TECHNOSYS.
Answer: You need to create a shortcut and then move that shortcut into the user pinned folder.
UserPinned folder is here: %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
Here, we will create a notepad shortcut (notepad.lnk) and move it to the user pinned folder.
The only things that need to be changed for your applications are:
sLinkFile=Name of your shortcut (application_Name.lnk usually)
oLink.TargetPath= Path of your root application (c:\program files\program\program.exe)
@echo off
echo Set oWS = WScript.CreateObject("WScript.Shell") > C:\temp8\CreateShortcut.vbs
echo sLinkFile = "C:\temp8\notepad.lnk" >> C:\temp8\CreateShortcut.vbs
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> C:\temp8\CreateShortcut.vbs
echo oLink.TargetPath = "C:\Windows\notepad.exe" >> C:\temp8\CreateShortcut.vbs
echo oLink.Save >> C:\temp8\CreateShortcut.vbs
cscript C:\temp8\CreateShortcut.vbs
del C:\temp8\CreateShortcut.vbs
copy "C:\temp8\notepad.lnk" "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\notepad.lnk"
pause

You can remove pause, I just had it for error checking.
Copy the code above into your bat file.
Edit: In depth explanation:
Essentially the > and the >> symbols append data to a document. In this case, we are creating a separate .vbs file called CreateShortcut.vbs and each command before the > or >> is getting put into that file, line by line. At the end of the batch, we run cscript CreateShort.vbs which executes the file that we just built.
@echo off

REM Create a new obj for shell script and write as line 1 in new file call createshortcut.vbs
    echo Set oWS = WScript.CreateObject("WScript.Shell") > C:\temp8\CreateShortcut.vbs

REM Name the shortcut whatever you want. It will end in .lnk and then write that command as the second line in the createshortcut.vbs file
    echo sLinkFile = "C:\temp8\notepad.lnk" >> C:\temp8\CreateShortcut.vbs

REM takes the shortcut file and runs the builtin script "create Shortcut to generate the .lnk file and adds as the third line in the createshortcut.vbs file
    echo Set oLink = oWS.CreateShortcut(sLinkFile) >> C:\temp8\CreateShortcut.vbs

REM this is physical path of the EXE or application you are making a shortcut for, then adds that path as the 4th line in the createshortcut.vbs file
    echo oLink.TargetPath = "C:\Windows\notepad.exe" >> C:\temp8\CreateShortcut.vbs

REM saves everything and writes as the 5th line in the vbs file
    echo oLink.Save >> C:\temp8\CreateShortcut.vbs

REM executes the createshortcut.vbs file that we built line by line above
    cscript C:\temp8\CreateShortcut.vbs

REM Deletes the createshortcut.vbs script that we made after it ran so you can use this block of code in the same batch more than once
    del C:\temp8\CreateShortcut.vbs

REM Copies the newly created shortcut file notepad.lnk to the directory that windows looks at to generate what icons/applications appear on the taskbar
    copy "C:\temp8\notepad.lnk" "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\notepad.lnk"

Comment: Terminal Server 2016: In the ...\User Pinned\TaskBar folder I see the short cuts which are also displayed in the taskbar. But adding or removing shortcuts from that folder does not affect the icons in the taskbar (even after a logon / logoff user session)
Answer: I just found a very simple solution here.
Just create the shortcut to the script file, then go to its properties, and change target from "C:\path-to-your-batch" to cmd.exe /C "path-to-your-batch".
After that, the icon of the shortcut changes and you can drop it on the taskbar to pin it.
Answer: You don't say if using an external program is acceptable for you. You can use pttb, here https://github.com/0x546F6D/pttb_-_Pin_To_TaskBar
Example:
pttb c:\Windows\system32\notepad.exe
Answer: You can pin programs with the Taskbar folder but you have to change a registry key as well.
What I did was on one computer, I pinned the programs I need for the local admin account. I then ran the following commands:
robocopy "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" C:\Temp\Taskbar
reg export HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband C:\Temp\Taskbar.reg
Since the computers are on a domain I was able to run these commands from another computer with domain admin rights:
robocopy \\SourcePC\C$\Temp\Taskbar \\DestinationPC\C$\Temp\Taskbar
robocopy \\SourcePC\C$\Temp \\DestinationPC\C$\Temp Taskbar.reg
From the destination PC make sure you back up the current registry key just in case!!!
reg export HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband C:\Temp\Taskbar-Backup.reg
robocopy C:\Temp\Taskbar "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"
reg import C:\Temp\Taskbar.reg
Log off and log back in and the icons should be pinned to your taskbar.
Answer: Refer to this answer that i tweaked for my aim, you can try this vbscript in order to pin a program to taskbar using Vbscript in Windows 10.
Vbscript : TaskBarPin.vbs
Option Explicit
REM Question Asked here ==>
REM https://stackoverflow.com/questions/31720595/pin-program-to-taskbar-using-ps-in-windows-10/34182076#34182076
Dim Title,objFSO,ws,objFile,sKey1,sKey2,KeyValue
Title = "Pin a program to taskbar using Vbscript in Windows 10"
'----------------------------------------------------------------------
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Ws     = CreateObject("WScript.Shell")
objFile    = DeQuote(InputBox("Type the whole path of the program to be pinned or unpinned !",Title,_
"%ProgramFiles%\windows nt\accessories\wordpad.exe"))
REM Examples
REM "%ProgramFiles%\Mozilla Firefox\firefox.exe"
REM "%ProgramFiles%\Google\Chrome\Application\chrome.exe"
REM "%ProgramFiles%\windows nt\accessories\wordpad.exe"
REM "%Windir%\Notepad.exe"
ObjFile = ws.ExpandEnvironmentStrings(ObjFile)
If ObjFile = "" Then Wscript.Quit()
sKey1      = "HKCU\Software\Classes\*\shell\{:}\\"
sKey2      = Replace(sKey1, "\\", "\ExplorerCommandHandler")
'----------------------------------------------------------------------
With CreateObject("WScript.Shell")
    KeyValue = .RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" & _
    "\CommandStore\shell\Windows.taskbarpin\ExplorerCommandHandler")
    .RegWrite sKey2, KeyValue, "REG_SZ"

    With CreateObject("Shell.Application")
        With .Namespace(objFSO.GetParentFolderName(objFile))
            With .ParseName(objFSO.GetFileName(objFile))
                .InvokeVerb("{:}")
            End With

        End With
    End With
    .Run("Reg.exe delete """ & Replace(sKey1, "\\", "") & """ /F"), 0, True
End With
'----------------------------------------------------------------------
Function DeQuote(S)
    If Left(S,1) = """" And Right(S, 1) = """" Then
        DeQuote = Trim(Mid(S, 2, Len(S) - 2))
    Else
        DeQuote = Trim(S)
    End If
End Function
'----------------------------------------------------------------------


Mark products out of stock

Question: Is it possible to mark products out of stock once certain number of orders have been placed for a product. Eg. A product has 1000 qty but I want to make that product out of stock immediately when orders have been placed for 100 products in a week, basically I dont want customers to order more than 100 pieces in a week. I know I can set this manually but I want to keep the site on automation. I am not quite sure where to start from programming point of view.
Answer: You can customize cart view file , and check for Number for orders in past week if it exceed 100 then show out of stock and disable add to cart

Mark products out of stock