Why won't my flat-screen TV work with Ubuntu?

Question: Why will the same graphics card that allowed me to use the flat screen TV when running Windows not display with Ubuntu? Keep it simple please. I am new to Linux, still feeling my way around.
Comment: A lot more information is need in order to help you, what graphics card do you have, what connection (DVI?). The more the merrier, if you want you can start by describing how was your windows connection.
Answer: If you're running the Unity desktop: Click on the top left Ubuntu Logo and search for monitors. Click detect monitors.
If you're running Gnome: Click on the appearance menu under system and find monitor. Click detect monitors.
If this doesn't work more details would help to alleviate the problem.
Comment: Standard monitor cable, windows xp just accepted it as a screen; The machine is a Packard Bell imedia with integrated graphics card GEforce 5200


How does mean and median play an important role in data mining?

Question: Can anyone explain me in simple english why does mean and median play a important role on Data mining. Actually finding a mean and median is of what use?
And many people say's median is better at times than mean, why so? And I'm a novice in data mining so it will be really good if the answer is in simple terms.
Answer: Often you want to reduce multiple measurements of something to one value, because thats easier to handle and understand than the complete distribution, and you are o.k. with the information loss. So you take some "average" that should be representative of the distribution of the values. This "average" should be in the "middle" of the distribution.
There are many ways to calculate the "middle", and Wikipedia lists some of them.
The median is exactly that: 50% of the values are smaller, 50% are larger, so the values of the actual measurements don't matter (only their rank) which makes it robust against skews in the distribution.
The arithmetic mean is the sum of all the values divided by their number. The numbers matter, it shifts with the distribution.
Which one is "better" depends on your application. Most people prefer a "robust" estimator, because they don't know the underlying distribution and want to be on the safe side.
Comment: (+1) Welcome to our community, Ido!
Answer: wrt median <-> mean: The mean is known to be sensitive to outliers. That means: take a dataset of a thousand ones and 1 time 1 million (an obvious outlier). If you calculate the mean from this, you get 1000: the one exceptional value 1000000 has drawn the mean towards itself.
On the other hand, if you 'calculate' the median for this data, you still get 1, which may also not be the perfect representative for the 'middle' of this data, but is much closer to what most people's gut feeling of that concept signifies (somewhere very close to the 'bunch' of ones in your data).
However, as @Ido Tamir correctly states: this depends heavily on the application (maybe your goal is to account for the occasional exceptional value, extreme as it may be).


Biasing using constant current source

Question:
guys i was going through this diagram in my book when these lines came along(i am a student):
Here RG(usually in M-ohm range) establishes a dc ground at the gate and presents a large resistance to input signal..... I want to ask why resistor is used? can't we directly ground it?
Comment: Where are the input and output ports in your circuit? If input is applied to the gate, you can't short circuit it to ground because that would short out the input and result in no signal transmission.
Answer: You can directly ground the Gate, sort of.
The Gate is where the input signal is applied. If you have a direct short from Gate to ground, the signal is shorted to ground and there isn't anything to amplify.
BUT
If your signal source has DC continuity, you can connect it between Gate and ground without any problems.
This signal source might be a transformer or inductor or similar. The DC continuity provides the bias path that the FET requires.
Comment: Reid, please tell me where can i learn mosfets in a simple and interesting way. Pls! i wish to become good at it. your reputation says you did.

Biasing using constant current source


Wagmi React hooks - caching

Question: I wonder if someone use Wagmi hooks for Ethereum and it's caching mechanism. Since docs doesn't say much about it (Wagmi docs) can somebody explain me how it acutualy works?
If i use useContractRead with scopeKey: 'myScope' and caching cacheTime: 1000*60*10 // 10 minutes then every time my component mounts it should first read the cache and return a cached value instead of using RPC to get value from blockchain, right? Well if it should, then it doesn't work, because every time I switch page I can see that my local hardhat is being asked for values. This means it can drain out RPC query limit very fast. How should I use cacheTime? Maybe I should also use staleTime?
Answer: Both have almost similar but not same functionality, stalTime can serve your purpose but still it fetches the data on mount and dismount.
You can have a look here to get more insights

https://wagmi.sh/react/hooks/useTransaction

Wagmi React hooks - caching


Do I need to repair this PVC drain pipe elbow?

Question: I was trying to mount a shelf and while drilling holes for the screws, felt some resistance against the drill. Tried to push the drill a bit further, but stopped as I was not sure what the resistance was. Removed some more drywall to see that I had scraped a 45 degree elbow joint on the PVC drain pipe. The scrape looks like its right at the end of the elbow (bell-end?). This looks like a drain pipe draining from the 2nd floor. There is no leak. Can I just put some epoxy on this or am I going to need to do a bigger repair?
Comment: Drain pipes aren't under pressure. It just looks dinged, if it's not leaking I wouldn't sweat it.
Comment: New pipe/fittings come from the store with worse dings than that. Looks like ABS DWV pipe, not PVC. The solvent cement used to "glue" pipe/fittings together is a better patcher than epoxy.
Comment: Thank you, these comments make me less anxious. Never tried working with plumbing, so this had me worried. I want to patch it just to be extra careful.
Comment: @kreemoweet isn't ABS usually black not grey/white? I've not purchased/used/seen in the field ABS pipe, so I'm not 100% certain...
Comment: I had pictures from before the drywall went up. The pipe is labelled as "Cellular Core PVC pipe". The pipe itself is white, but the elbow is a slightly different shade of white. Maybe the flash from the phone makes it look darker. Adding a photo without the flash.
Answer: It's probably fine as it is.
The stuff to use to fix this is a PVC solvent cement that contains a lot of filler, eg: "Marley MCS® Solvent Cement"
or you could mix in some ground PVC to regular PVC pipe
cement to make a paste.
To ensure a good weld, prime the surface first with PVC pipe primer.
There's going to be lots of yucky volatile chemicals so crank up the ventilation.


REST questions: advantages of REST over XML-RPC

Question: What is the advantage of using the REST verbs GET, POST, PUT, DELETE
instead of just using POST and embedding an XML-RPC operation description
in the POST body describing what we want to insert, update, or delete.
Plus, what if we wanted to do more than one of these operations in one
go, wouldn't the rest design be useless in this case, as REST does not
seem to support transactions or multiple operations in one go.
Thanks.
Comment: possible duplicate of [XML-RPC vs REST](http://stackoverflow.com/questions/11710507/xml-rpc-vs-rest)
Answer: Below are my thoughts on why i prefer REST services over others.
REST uses the HTTP verbs GET, POST, PUT, DELETE to convey the intention of the service.
A majority of the HTTP framework is used as is.
In my opinion, there is no need to circumvent the HTTP to build a new protocol. Only an understanding of HTTP is required to build and use RESTful services. I think a carefully designed service acting on any resource will fit into the RESTful model.
In a RESTful service, the operation on the resource is intuitive. So, when a GET operation is made on a resource, it is imperative that the operation is idempotent.
REST enables to use lighter payload. It so easy and light to make an ajax call to a RESTful service.
It provides the ability to service different request/response formats like json, xml etc by the same service.
Event though there is no ws transaction type support in REST, a RESTful service can be built to achieve the same consistent state.
There can be cases where REST is not appropriate, that depends on the architecture and the contract required for the solution.


For the 4/20 Launch of Starship does anyone know what was inside starship?

Question: I was curious to know if they built rooms or had dummies inside, or what they put in it to simulate weight.
Comment: Since it was launched on 4/20 I suppose it was filled with weed
Comment: It was not planned to have any payload, but just after launch, it decided to take several chunks of the concrete below the OLM aboard as souvenirs.
Comment: No red Tesla this time in a new rocket.
Comment: @ThisIsNicola We'll know when all the fast food places downwind of the explosion post a sudden spike in sales...
Answer: There was no indication of any payload aboard Ship 24.  Definitely no rooms or dummies.  I haven't seen any documentation of a mass simulator, either, and much of the construction has been observed in detail, see e.g. this fandom.com wiki entry on Notable Differences between S24 and prior Starships.
In the past SpaceX has publicly acknowledged mass simulators / boilerplate payloads on test launches, so unless they release some statement contradicting this, I think "no mass simulator was observed" is the best answer we'll have.
Supplementary quote from Musk's post-flight Twitter Space (25m16s)

Elon Musk:
The goal of these early missions is just information.
Like we don't have any payload or anything.
It's let's try to learn as much as possible.
Comment: The payload door was welded shut so the only thing that could potentially be in there is something that fits through the tiny service hatches.
Comment: Given their (stated) main goal was to just get it off the launch pad, having any unnecessary weight is counter-productive.
Answer: They had originally planned on putting Starlink v2 satellites inside but decided not to so the rack that holds and releases them was inside but no satellites. There was nothing else inside.
Comment: do you have any sources for that info?
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).


'Remember Me' Login in CodeIgniter

Question: How do you implement this in CodeIgniter?
Answer: (This answer was a response to the original question)

How would you do this ? Or, how would
  you create a session with a longer
  expiration date than the others ?
All created sessions would use the
  same $config['sess_expiration'] in the
  config file (default: 7200 seconds),
  is there a way to pass a custom value
  ?

Extending the expiration of a session cookie isn't going to work for a "remember me" feature, since the user will lose their session cookie when they close the browser. If Code Igniter doesn't have a native "remember feature", then you'll need to write something to drop a long-life cookie which contains information which will allow an automatic login when the server sees it again.
There's a good article on Persistent Login Cookie Best Practice, which can be summarized as:

When the user successfully logs in with Remember Me checked, a login
  cookie is issued in addition to the
  standard session management cookie.2
The login cookie contains the user's username and a random number
  (the "token" from here on) from a
  suitably large space. The username and
  token are stored as a pair in a
  database table.
When a non-logged-in user visits the site and presents a login cookie,
  the username and token are looked up
  in the database.
       1. If the pair is present, the user is considered authenticated.
  The used token is removed from the
  database. A new token is generated,
  stored in database with the username,
  and issued to the user via a new login
  cookie.
       2. If the pair is not present, the login cookie is ignored.
Users that are only authenticated via this mechanism are
  not permitted to access certain
  protected information or functions
  such as changing a password, viewing
  personally identifying information, or
  spending money. To perform those
  operations, the user must first
  successfully submit a normal
  username/password login form.
Since this approach allows the user to have multiple remembered
  logins from different browsers or
  computers, a mechanism is provided for
  the user to erase all remembered
  logins in a single operation.

Another article which builds more security onto those ideas in Improved Persistent Login Cookie Best Practice
If you follow the practices in those articles, you won't go far wrong!
Comment: yup, good article but not exactly what I'm looking for. What I want to know is a way to do that particular task (setting up a longer session than the other ones) in CI :D
Comment: Extending the expiration of a session cookie isn't going to work for a "remember me" feature, since the user will lose their session cookie when they close the browser. If Code Igniter doesn't have a native "remember feature", then the ideas presented above will help you implement one.
Comment: okay, now I see the flaw in the question. It should be "How do you implement this in CI?". Silly me. I'll wait a bit before going with your suggestion. Thanks Paul.
Comment: CodeIgniter now has a `sess_expire_on_close` setting. Theoretically, if sessions are being stored to database via `sess_use_database`, it would be possible to set `sess_expire_on_close = FALSE` and use a large value for `sess_expiration` to keep a session active even after the browser window is closed. Is this doable and secure in practice though?
Answer: You might want to reconsider the suggestion from 'Improved Persistent Login Cookie Best Practice'. I've posted my analysis of the problem on the site, but the gist of it is this:

You can not prevent cookie stealing without a secure line, no matter what

(*By 'secure line', I mean SSL / VPN tunneling / public-key encryption - or a robust challenge-response scheme *)
I'm all for persistent login best practices, but there's a point where no amount of trickery is going to help, and where the only way up is SSL.
Comment: SSL doesn't really solve anything. Background info: http://fishbowl.pastiche.org/2003/10/20/whats_your_threat_model/

The majority of attacks against cookies are either XSS, browser bugs or compromising the client. Setting httpOnly fixes XSS (no SSL Required), and SSL does nothing to fix the others.
Comment: You're just paraphrasing what I quoted in the aforelinked post: "Well, in a nutshell, we won't protect against the end system attack, because its really difficult. And we'll ignore DOS because that's too difficult too. But we'll cover the entire on-the-wire threats… because… we can!"
Comment: Interesting. Which one is your analysis ?
Comment: The last one, posted in the name 'Jens Roland'. It should be on the second page of comments (http://jaspan.com/improved_persistent_login_cookie_best_practice?page=1)
Comment: Even if it is in no way foolproof, SSL still has a better-than-average chance of thwarting the #1 attack mode (interception over the wire). #2 and #3 are just plain game over and beyond the scope of an authentication measure, and as you said, httpOnly fixes #4.
Comment: Yes, but only to address the statement that SSL doesn't solve *any*thing, which isn't entirely the case. But maybe I should have qualified my original statement better: You can not prevent cookie stealing _over the wire_ without a secure line, no matter what.
Answer: Thanks for the solution.
I have implemented this into my CI project.
DEV Note: the cookie should have a secured-hash as the remember-me key.
- do not just store a user-id)
- do not store a password,
- and do not store hash of password.
That way people can't automatically log into any account.
Worst case scenario: As soon as a hacker discovers the hash method, you can adjust the key producer function in one place and you are set up again with security. I would just adjust the salt and pepper strings.
Hope that helps.
Chris D. - from Australia :)
Answer: For these things, the CI variables in all classes can be accessed by its own library:
For example:
<code>$this->session->sess_expiration = 500000;
</code>
Hope that resolve your problem.
Answer: there is library on github for remember me download it.
Using this library's setCookie() function, the following occurs:
1.A cookie is generated containing a unique number
This number is recorded into a database table, called ci_cookies along with the netid/username passed on to setCookie()
2.When the verifyCookie() function is called the browser's cookie hash must match the hash recorded to the database. If it does, verifyCookie() returns true forward it on home page
Comment: Please link to the library in question.
Answer: U need set conf before load session
<code>$do_not_remember = (boolean) $this->input->post('do_not_remember');
if ($do_not_remember) {
   $this->config->set_item('sess_expiration', 0);
   $this->config->set_item('sess_expire_on_close', true);
}
$this->load->library('session');
</code>

‘Remember Me’ Login in CodeIgniter


If I receive a LN payment from an anon sender... is there a way to send back to this individual?

Question: I see the preimage, hash, and payment request but all of those are transaction specific and unrepeatable. Any idea how it would be possible to send back the other way without knowing the individual?
Answer: No, there is no definitive way to detect the source of a payment on the Lightning Network.
However, there exists techniques (either active or passive, such as probing or some heuristics) which may be used to try to deanonymize parties involved in a payment.
So, while you can't reliably identify a party, you cannot assume it's totally anonymous either.
Comment: Appreciate the quick response. I ask because i'm in the late stages of building this www.satoshie.com ... and I cannot figure out a frictionless way to do payouts ... am I down the creek w/o a paddle?
Comment: Looks like we are starting a back-and-forth conversation, you may want to join #lightning-dev on Freenode :-) To answer with another question: why do you need refund informations to be based on the Lightning Network ? EDIT: if you come at freenode feel free to ping me, same pseudo there
Comment: thanks, will join there. The site is based on micropayments (being able to place a bet of say 1 cents, on chain that would not be possible). Do you have an alternate in mind?
Comment: (Not a web dev, it might be a bad idea). Can't you just use session ids / cookies stuff to identify who's owned a refund ? And have a page asking them for an invoice in order to get refunded ? As you go, might be worth adding a basic accounting system too.


Using slashes in academic research papers

Question: Is it ok to use a slash to separate alternatives, as in "If 1st_method/2nd_method is used and 3rd_method exists....", in academic paper writing?
Comment: That is a forward slash. But I would reword the sentence to be clear what you mean.
Answer: Strictly speaking yes it's "ok" but it does not mean it's the best.
Most style books (I'm looking at AMA Handbook at the moment) would list that using forward slash (also called virgule or solidus) to represent "or" is acceptable. But the same symbol can also represent "and" as well as "per." So, there is some chance that misunderstanding can arise.
If it's not under strict word limitation, you may consider using the word "or" in between the two named methods.
Answer: What is wrong with something like :
If either the first method or the second method is used...


In how many ways can I put 1 to 5 mirrors in 8 rooms?

Question: A queen has 8 rooms and 12 indistinguishable mirrors, how many ways are there to hang these mirrors in 8 rooms such that every room has at least 1 mirror?
Comment: Are the mirrors distinguishable?
Comment: I don't know, this is the problem statement as is. The answer is 330, I'm trying to understand the logic.
Comment: Ok, it's indistinguishable if 330 is the answer.
Answer: We have 12 mirrors, but 8 of them must be allocated so each room has at least 1. So all we care about is placing the remaining 4 mirrors in 8 rooms.
This is a perfect place to use stars and bars, since we have 4 mirrors to spread across 8 rooms. This leads us to find the total number of combinations as $${8+4-1\choose4} ={11\choose4} =\color{red}{330}$$
If you are confused as why $8+4-1\choose4$ is what we desire, imagine that the * are mirrors, and | dividers, which determine which room the mirrors fall into.  Since there are 8 rooms, we have 7 dividers, i.e., we seek the number of distinct combinations of
****|||||||

Comment: It is even easier if you use the basic stars and bars.  You put the $12$ mirrors in a row and can place four dividers between them.  You can only place one divider between any pair of mirrors, so each room gets at least one.  There are $11$ spaces for the four dividers, giving $11 \choose 4$
Answer: Let the numbers of mirror in a room be $x_i$, where $x_i$ is a positive integer.
We need to find solutions for,
$$x_1+x_2+x_3+x_4+x_5+x_6+x_7+x_8=12$$
This can be seen as 12 stars and 7 bars.
************   ||||||||

Now there are 11 gaps between 12 stars and you have 7 bars to place, where each bar separates number of mirrors in a room.
So the answer will be?
Comment: I do not understand why this answer received so many downvotes.  $\binom{11}{7}=\binom{11}{4}$ and following this answer gives the same result as the other answer.
Comment: Can I know the reason for the downvotes please? Is there something wrong with my answer ?


Classical liberalism and libertarianism

Question: What is the distinction between classical liberalism and libertarianism?
Comment: See [Libertarianism](https://en.wikipedia.org/wiki/Libertarianism) : "Traditionally, libertarianism was a term for a form of left-wing politics; such left-libertarian ideologies seek to abolish capitalism and private ownership of the means of production."
Comment: Are you American? You don't have to answer, but you should know that those two terms mean something very, very different in American politics than they do in the rest of the world. In America, classical liberalism means what libertarianism means in the rest of the world. And in America, libertarianism is almost synonymous with anarcho capitalism. The context that you are using them or hearing them makes a big different in what they mean.
Comment: What @Not_Here said. I'd add... That while Ron Paul et al may seem 'liberal' (even sensible) is some opinions.. they arrive at those opinions from very different starting points than a traditional liberal would. This is one of the great tragedies of politics.. Nazi's and Communists may agree on various low level policies regarding infrastructure or education etc. But a communist will suddenly find to their horror that Nazis only extend their 'socialism' to particular people. Thus it is with 'liberals' and 'libertarians'. Liberals have a broader church than libertarians.
Comment: Essentially liberalism is about genuine freedom.. from fear.. oppression... Domination... Libertarianism is about a kind of freedom in which the 'strong' thrive at the expense of the weak. The problem is that rich people are only 'strong' in a world where the police prevent the poor from taking from the rich. Libertarianism is hubris. It advocates a kind of anarchy which requires unjust law.
Answer: Neither classical liberalism nor libertarianism can be defined in ways everybody agrees on. The components of each position vary between different theorists. But some illuminating contrasts can be drawn.
Classical liberalism - 1

Philosophical liberalism maintains that, first, there is a plurality of intrinsic goods, and
   that no single way of life can encompass them all. There are then different ways of living worth affirming for their own sake. Second, whatever intrinsic goods are appropriate for individuals, their having the
   freedom to determine and pursue their conceptions of the good is
   essential to their living a good life. Finally, necessary to individuals'
   good is that their freely adopted conceptions of the good be consistent
   with justice. All have an interest in exercising their freedom so as to
   respect others' basic rights and other requirements of justice. While
   this does not mean that justice is necessarily an intrinsic good (although it can be), it does mean that observing justice's demands is a
   normal precondition of living a good life. (Samuel Freeman, 'Illiberal Libertarians: Why Libertarianism Is Not a Liberal View',  Philosophy & Public Affairs, Vol. 30, No. 2 (Spring, 2001), pp. 105-151: 105.)

I'd make only three comments on this. In the first place, 'intrinsic goods' can be but conceptually need not be objective goods; they can be intrinsic valuations. That is, they can encompass what is intrinsically valued rather than what is (if anything is) intrinsically good. Secondly, democracy is widely regarded as a proper medium for the political expression of freedom. Thirdly, since no single way of life can encompass the full plurality of goods, it is not the role of the state to promote social ideals which privilege a single way of life.
Classical liberalism - 2

I use the term
   'classical liberalism' in the Continental sense to refer to a liberalism
   that endorses the doctrine of laissez-faire and accepts the justice of
   (efficient) market distributions, but that allows for redistribution to
   preserve the institutions of market society. (Samuel Freeman: 106.)

An appropriate addition here is that classical liberalism assumes a background of private property. It endorses the institution of private property but in allowing for redistribution does not regard private property as totally 'hands off' to the state.
Libertarianism

By 'libertarianism' I primarily mean the doctrine argued for by Robert Nozick, and also in differing accounts by Jan Narveson, Ayn Rand, Murray Rothbard, John
  Hospers, Eric Mack... (Samuel Freeman: 107.)
  ...

Initially it appears that libertarians assign liberty or freedom as the central political value:
Liberty?

Libertarians
   commonly announce their view with such claims as, "The only relevant consideration in political matters is individual liberty" (Narveson,
   p. 7); or "Libertarians agree that liberty should be prized above all
   other political values" (Machan, p. vii); or "The idea of libertarianism is
   to maximize individual freedom" (Narveson, p. 175). Nozick, more cautiously, makes no such general claim. But he does contend that "liberty upsets patterns" of distribution (ASU, p. 160), and argues as if
   anyone with a proper regard for liberty should see that patterned theories of distributive justice violate a commitment to freedom. (Samuel Freeman: 126.)

A patterned theory of distributive justice is committed to the distribution of assets, including property, in the interests of a social ideal such as 'to each according to their needs'. No, says Nozick : the rule should be 'to each according to their just acquisitions and transfers' (my phrasing), which results in a completely unpredictable distribution of property embodied no pre-set pattern, such as distribution according to need. You can't recognise people's liberty justly to acquire and transfer and also expect any particular pattern to emerge or not to be disturbed.
Or property ?

Libertarianism is grounded in a certain conception of people's individual rights; and in particular their property rights, that is,
   the kinds of rights and powers that individuals may exercise in the
   possession, use, transfer, and disposal of things. The centrality of the
   concept of property is evident in Rothbard's and Narveson's views.
   Both conflate all specific liberties into a general right to liberty. Then
   they argue that the right to liberty, along with all other rights, are in
   the end property rights, bolstered by an ultimate right, property in
   oneself. Narveson says: "Liberty is Property ... the libertarian thesis is
   really the thesis that a right to our persons as our property is the sole
   fundamental right there is." And Rothbard writes:

In the profoundest sense there are no rights but property rights....
    Each individual, as a natural fact, is the owner of himself, the ruler
    of his own person. Then, "human" rights of the person ... are, in
    effect, each man's property right in his own being, and from this
    property right stems his right to the material goods that he has
     produced.

Nozick again is more cautious, avoiding such broad generalizations.
   Still he relies on what he calls the "classical liberal notion of self-ownership" The problem with all nonlibertarian principles of distributive justice, Nozick argues, is that they involve "(partial) property rights
   in other people" (ASU, p. 172; see also 281-83). As for democracy, it too
   violates the absolute ownership rights each person has in himself, for
   it is nothing but "ownership of the people, by the people, for the people" (ASU, p. 290). (Samuel Freedom: 127-8.)
Such claims and arguments as these confirm the suspicion that libertarianism is not so much about liberty as property. Libertarianism's
   regulative institutional principle is that individuals ought to have absolute rights to accumulate, use, control, and transfer rights in things. To
   ground these controversial institutions, libertarians extend the concept
   of property, via the notion of self-ownership, to each person's own person and powers. The fundamental libertarian claim is then that each
   person is absolute owner of herself, body and powers. Because we
   each have absolute property in our persons, it is supposed to follow
   that each has absolute powers over what she owns or acquires consistent with others' ownership rights. On this conception a person's liberties are among the things owned by that person; in this sense, "liberty
   is property." (Samuel Freedom: 128.)

Classical liberalism, while it recognises property rights as legitimate and important, does not place them at the absolute, non-negotiable centre of ethical and political theory as libertarianism does. This is the principal and I should say crucial difference between them.
References
Samuel Freeman, 'Illiberal Libertarians: Why Libertarianism Is Not a Liberal View',  Philosophy & Public Affairs, Vol. 30, No. 2 (Spring, 2001), pp. 105-151.
R. Nozick, Anarchy, State, and Utopia ('ASU'), NY: Basic Books, 1974.
J. Narveson, The Libertarian Idea, Broadview Press, 2001.
Murray Rothbard, Power and Market (Kansas City: Sheed Andrews and McMeel, 1977.

Classical liberalism and libertarianism


How to run 5v relay on 9v?

Question: I have a 5v(coil) dpdt relay. Running it with 9v is safe or not? How can i reduce the voltage from 9v to 5v ? How much resistor i need ?(i do no want to use voltage regulator pls)
Comment: This is difficult to answer properly without having proper specs of your relay. Please enhance your question accordingly
Answer: Place a ~4 V zener diode in series to drop the voltage.

simulate this circuit – Schematic created using CircuitLab
Answer: You will put a resistor in series with the relay coil. The resistor value is selected in conjunction with knowing the DC resistance of the relay coil. The idea to select the resistor value so that the coil drops 5V and the resistor drops about 4V.
For example if the coil resistance is 50Ω then the series resistor has to be about 40Ω.
Here is the general formula:
$$\frac{5V}{R_{COIL}} = \frac{4V}{R_{RESISTOR}}$$
Comment: You have two options. (a) Look in the relay data sheet. (b) Measure the coil resistance with your multimeter in ohms mode.
Comment: I dnt knw the coil resistance. It is not written in the relay
Comment: Yes good idea i can measure the resistance using my multimeter
Answer: You should take a look to the relay datasheet, but usually 9V into a 5V relay will fry the coil.
I'll advice against using just a resistor. At least add a 5.1 volt zener diode (1N4733A, for example) as follows:

simulate this circuit – Schematic created using CircuitLab
Choose a value of R1 that simultaneously protects the zener diode and allows enough current into the relay coil. For a low sensitivity coil with 55 Ohm +/-10% DC resistance operating at 5.1V +/-5%, a R1 of 33 Ohm +/5% would do the trick.
For R1 = 33 Ohm, worst case zener current through D1 would be about 53 mA and 0.25W dissipation so it should be OK. Worst case dissipation in R1 would be about 0.55W, so you should use a 1W resistor.
You may like to choose an even lower value of R1 if you foresee that the 9V supply may have some tolerance and deliver less than 9V. It's up to you, you should make the calculations and decide.
Comment: You will also need a flyback diode (1N4148) if you plan to switch the 9V into the coil using a transistor, in order to avoid damaging it.
Comment: There's no reason to use the zener, you are just wasting even more power.

How to run 5v relay on 9v?


Reverse the order of encryption and decryption in CBC mode. Does this work?

Question: To encrypt a message, one uses the algorithm for doing a CBC decryption. To decrypt a message, one uses the algorithm for doing a CBC encryption. Does this work?
Comment: Welcome to Cryptography. Is this homework?
Answer: Welcome randomjsmash!
Reversing encryption and decryption would give you a very weak encryption scheme.
First, it would make the initialization vector effectively useless. An attacker could simply unmask the first encrypted block and subsequent blocks do not depend on the initialization vector.
Second, guessing a single block correctly (e.g. assuming it contains only space characters used for indentation) would allow an attacker to unmask the following block. If the attacker were able to do this repeatedly, she would immediately see if blocks of plaintext repeat.
Being able to see repeating patterns will enable an attacker to perform statistical analyses and can quickly lead to a complete loss of confidentiality.


Can I sue a car garage for only offering cash payment?

Question: I rent a parking spot in a garage in NYC for my car. Rent payment is made only in cash. When I joined 2 years ago, owner told me he would set up electronic payments or will accept Zelle payments, in the event it is still not available. Now he refuses to take payment by Zelle and asks me to pay in advance the rent before I travel, or pay a late fee at my return.
What can I do in that case? Is there a legal option I can seek to remedy this situation?
Comment: Sue them for what?  What wrong or damage have you suffered?  It seems that you simply prefer to pay by a different method.
Comment: no but you can park your car somewhere else, which is certain if you choose to sue them.
Answer:
Can I sue a car garage for only offering cash payment?

Probably not.
A statement that new payment will be offered at some indefinite time in the future isn't specific enough to create a binding obligation to provide that service.
Even if there was a promise to provide, e.g., Zelle payment by January 1, 2024, your remedy would probably be limited to a declaration that you are allowed to terminate the rental arrangement going forward. You haven't suffered any economic damages from the policy.
Comment: @Lou Get a trusted buddy to give the guy a sealed envelope full of cash in the correct amount in the five day period while you are gone. You'll owe your buddy a beer or coffee when you get back and regale your friend with the glories of your trip. Old school problems have old school solutions. If you have no one you trust to do that, that is a different kind of problem.
Comment: haha. Yeah, I guess I will do that.
I am just so upset with the garage owner. Can't stand NY scumbags! lol
Comment: Got it. I haven't suffered any economic damages so far. I signed up however under the illusion I could pay the rent electronically while I am traveling. I can't always organize my travels around the first 5 of the days and his refusal to accept my Zelle payment looks to me a simple attempt to extort more money from me (with his late fee).
Answer: This is no different than a garage having a credit card only payment system.  Technically you can try to sue anyone or anything for any reason but this would be a waste of time as it would likely be thrown out before it gets anywhere


Kruskal-Wallis?

Question: I have three sets of data (1 set before treatment, second during treatment and the third after), each of which consists of hundreds of trials on a specific task that involves choosing 1 from 7 possible choices, the answer for which may be correct or not (binary categorization). I'd like to determine whether the proportion of correct choices is significantly different as a result of treatment. Which statistical test could potentially help?
Comment: It's not clear from your question what your situation is. Please be more explicit about what your data consist of and what your hypotheses of interest are. If (as it sounds like may be the case) your response is binary, Kruskal Wallis would be unsuitable (but then you might look at logistic regression to achieve something similar).
Comment: I've made some changes to the question. Thank you.
Comment: Done. Now do you think I have to still use logistic regression? I did some reading and was wondering if chi square is useful.
Comment: I never said you '*had to*' do anything. What an odd way to read what I wrote. Logistic regression may be relevant to your question, since the response is a proportion, but it should also be possible to cast it as a chi-square test or even as a straight proportions test.
Comment: I apologize if I sounded rude - English is not my first language. I appreciate your reply and also your advice.
Comment: @sjoh2574: I don't think you did; Glen_b was probably just trying to clarify that logistic regression was only a suggestion, not a statement of statistical law :)
Comment: Nick's interpretation is correct; I had no sense that you were rude, only that you had misunderstood. I should have made more allowances for English not being a first language for you, so if anything, it's me who should apologize, not you.
Answer: So you have data from two subjects who completed hundreds of trials at three assesment phases (before/during/after treatment), right? Sounds like you're looking to falsify the null hypothesis that both subjects achieved equal success before and during treatment (and maybe after too?), but your data would permit more tests than this.
A mixed-effects model could test the effect of assessment phase (effectively a test of your treatment), test for differences between your two subjects, and test for a treatment × subjects interaction. If you know the order of the trials within assessment phases, you could also test for effects of practice, fatigue, or whatever else might change subjects' performance over a long series of consecutive trials. It seems desirable to statistically control any such effects of trials nested within phases, as well as to control differences between your two subjects, as this would leave less variance for your treatment to explain. You might also find evidence of an interaction interesting, as it would suggest individual differences in the effect of the treatment.
The fixed vs. random effects distinction is somewhat ambiguous (Gelman, 2005; see also "What is the difference between fixed effect, random effect and mixed effect models?"), so I should admit that I'm not sure which effect(s?) you'd want to treat as random according some definitions. I'm mainly suggesting a mixture of between-subjects and within-subjects factors in your model:
$$Y_{ij}=\mu+\beta_1{\rm Subject}_i+\beta_2{\rm Time}_j+\beta_3{\rm Subject}_i{\rm Time}_j+U_i+W_j+\varepsilon_{ij}$$

$Y_{ij}$ is the response variable, as usual. If this is a count of successful trials for subject $i$ at time $j$, and both subjects had an equal number of trials at each time, then you could assume a negative binomial distribution (or maybe Poisson, though this involves a dispersion assumption). If your subjects had a different number of trials or you prefer to model proportions of successful trials for some other reason, you could assume a beta distribution instead. If you prefer not to worry about the distribution, you could also try a nonparametric model (e.g., Gu & Ma, 2005).
$\mu$ is the grand mean of the response variable across all trials/subjects/times.
$\beta_1$ is the mean difference between subjects across all trials/times.
$\beta_2$ is the average slope of changes across your three times for all trials/subjects.
$\beta_3$ represents the difference in slopes across times for all of your two subjects' trials.
$U_i$ represents subject-specific error – could be useful to control if they have different variances.
$W_j$ represents time-specific error. E.g., a gradual effect of the treatment could increase variance over trials during the treatment only. You might be able to estimate this as a hierarchical model since you have hundreds of trials nested within assessment times, but since they're binary trials, I'm not sure this is possible. I'm not sure this applies, but consider Hudecová (2013). See also "Autocorrelation of discrete time series".
It might help if you could get another subject too, as this would give you three proportions per assessment phase. That's at least enough to begin separating subject-specific error from time-specific error within a single time period, I think. I may be stretching what I know about latent variable modeling a little too far here.
$\varepsilon_{ij}$ would be the remaining error that can't be attributed to subject-specific error (e.g., inattentiveness) or time-specific error. If you can separate out the other two kinds of error at all, this could help isolate the effect of the treatment.

If your two subjects aren't very different, including terms for differentiating them in your model might not be worth the degrees of freedom, but that's an empirical question worth testing IMO. Then again, I seem to have taken this in a somewhat different direction than @Glen_b and @Adrian indicate. Hopefully someone will speak up if I'm suggesting something incorrect or unfeasible, or if the random effects idea can be clarified.

References
· Gelman, A. (2005, January 25). Why I don't use the term "fixed and random effects". Statistical Modeling, Causal Inference, and Social Science. Retrieved from http://andrewgelman.com/2005/01/25/why_i_dont_use/.
· Gu, C., & Ma, P. (2005). Generalized nonparametric mixed-effect models: Computation and smoothing parameter selection. Journal of Computational and Graphical Statistics, 14(2), 485–504. Retrieved from http://www.stat.purdue.edu/~chong/ps/guma.pdf.
· Hudecová, Š. (2013). Structural changes in autoregressive models for binary time series. Journal of Statistical Planning and Inference, 143(10), 1744–1752.
Comment: This is a great answer, but try the simple analysis first!  If all you care about is whether there are significant differences between the performance these three(!) times, I don't think it's necessary to do all this work.  If there are a lot of repeated measurements of the same individuals (not clear from above), or a lot more timepoints, or some biological/psychological hypothesis you're testing, then sure, go crazy..
Comment: Frankly Adrian, that's bad advice. What if the simple method doesn't achieve significance? *Then* change the test? That's an unfair way to test a hypothesis. Neither of us know how much work the OP cares to do (that's less clear from the OP than the existence of repeated measures, which seems pretty plain to me), so the existence of two alternatives is good, but let's not discourage the more difficult approach just because it's complex. IMO, that instinct is one of the primary problems with statistics as practiced by people who are less than serious about it.
Comment: Trying both is safer (arguably even good) advice for the purpose of parameter (e.g., effect size) estimation though! I'd prefer to point in that direction rather than emphasize hypothesis testing in general anyway, if only a simple message is to be retained. Hypothesis testing is not for the statistically faint of heart (though it's commonly practiced by that population anyway). P.S. While I'm commenting, I should admit I'm even less certain $W_j$ can be estimated in retrospect...
Comment: Thank you for your expanded reply. This is a lot of thought. I'm going to try to implement this with some help. Thank you.
Answer: It sounds like you just want to do a hypothesis test on whether there is a difference between proportions (of correct vs. incorrect), over your three groups.  This is a chi-squared test.
To test which individual differences are significant, a simple approach would be just use pairwise z-tests to compare the proportions, and adjust for multiple testing.  In the case here, there are only three comparisons, so it's not a big deal at all; you can use the bonferroni correction and multiply your resulting p-values by three.
Comment: Thank you for your advice. I'm inclined to do this first, as I know how to do it. Not to suggest that the above reply is any less relevant. I truly appreciate the effort that went into analyzing this situation.

Kruskal-Wallis?


Count data time series with multiple seasonality

Question: I am analyzing a time series (hospital admittance) registered by date - time at hourly frequency, collected all days during 2010 - 2014 (5 years). The time series exhibits seasonality at multiple level (hour, weekday, month). The conditional distribution could be reasonably modeled using a count distribution (Poisson, NegBin). I wonder what could be the best approach for modeling this. I was thinking about a Poisson loglinear model, say $$E\left[admittance_t\right]= \alpha * hour * weekday * month,$$
but I do not know how to account for autocorrelation. I s there an approach to perform this in R? Are there possible alternatives in R?
Comment: I don't know that I would expect autocorrelation to be a big problem here.  Will your model be regularized?
Answer: Collect your data into hourly time buckets and build 24 hourly models and a daily model . Allow top-down and bottom up reconcilliation. Make sure that your daily model includes daily/weekly/monthly/holiday/long-weekend effects etc along with appropriate level shifts/time trends and possible changes in daily patterns along with specific days-of-the-month effects. For example a daily model might encompass  and possibly specific weeks within a month  or weeks within a quarter and effects like a Monday after a Friday holiday or a Friday before a Monday holiday. If you post your data with some info regarding country source and start date,I will try to be more explicit.


Mach-Zehnder probabilities

Question: Where can I find the computations of probabilities for Mach-Zehnder experiments, say at the undergraduate level? For example I'm thinking of the type of experiments described at the beginning of David Albert's book?
Answer: Robert Griffiths is quite fond of Mach-Zehnder experiments as useful windows into interpreting quantum foundations, and he presents calculations for some toy models of M-Z interferometers in Chapter 13 of his book, Consistent Quantum Theory.
As a caution, most of this book is written to parallel the consistent quantum histories formulation of quantum mechanics. The part of MZ interferometers should be intuitive to anyone who knows basic quantum mechanics, but there are some unusual tensor product notations and terminology about families of quantum histories which are unfamiliar to most readers. (This can be resolved by reading the introductory chapters; the entire book is provided online by the author.) The book is intended for the undergraduate level.

Mach-Zehnder probabilities


How can I display a price in Google search results?

Question: How can I display a price in Google search results like in the following screenshot?
Answer: You can set a price range using this parameter:
<code>  "priceRange" : "$100 - $200",
</code>
Example:
<code><script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type" : "LocalBusiness",
  "@id" : "WEBSITE URL",
  "name" : "BUSINESS NAME",
  "logo" : "LOGO URL",
  "telephone" : "PHONE NUMBER",
  "email" : "EMAIL ADDRESS",
  "sameAs" : [ "URL #1", "URL #2" ],
  "url" : "WEBSITE URL",
  "image" : "IMAGE URL",
  "priceRange" : "$000 - $000",
  "description" : "BUSINESS DESCRIPTION",
  "address" : {
    "@type" : "PostalAddress",
    "streetAddress" : "STREET ADDRESS",
    "addressLocality" : "CITY",
    "addressRegion" : "STATE ABBREVIATION",
    "postalCode" : "ZIP CODE"
  },
  "geo" : {
    "@type" : "GeoCoordinates",
    "latitude" : "LATITUDE COORDINATES",
    "longitude" : "LONGITUDE COORDINATES"
  }
        }
    }
  ]
}
</script>
</code>
Try it out with Structured Data testing tool:
https://search.google.com/structured-data/testing-tool/u/0/

Link to official scheme priceRange: http://schema.org/priceRange

Link to schema price: http://schema.org/price
Answer: Markup your product/service with the schema guidelines. Google may pick up your data and display the price point as it does in your example.
Keep in mind, this does not guarantee that it will display.
Answer: I think it is part of Google snippet. You can make some good condition for snippet but you can not influence from 100%.
Comment: Such a short answer is not high quality.   Can you expand this?   Can you link to documentation from Google about the snippet?


Teens concerned about impregnation through clothes

Question: Dry Humping, is:

dry humping is the process of two people repeatedly moving up and down and back and forth on top of each other fully clothed( or missing various pieces, but the penis must not come in contact with the vagina with out some sort of fabric separating them ex: boxers,panties, or even sheets!!)

We all know that the basic rule for impregnation is that the sperm must come in contact with the egg, and even be able to fertilize it. While sperm can get through clothes, semen (but this is yet been proven or disproved) gets stuck, thus the sperm dies.
What is your opinion about this? If two people are on top of each other, fully clothed, and the male comes to ejaculation, is there any chance that pregnancy can happen, in the realistic and biological look at it (and not some probability or statistical way)? What advice should be given to teens on the matter?
I am a computer scientist with no biology knowledge, and am very interested in getting the opinion of biologists.
But since I know that the stackexchange community likes to see work done before asking questions, I did my own research (I am used to googling code and algorithms):
Very few research has been done on the subject. There is one shining research that  concluded, as I recall, that:

If the underwear is completely saturated with semen, and is in direct contact with the woman's vagina, pregnancy is possible statistically, but highly unlikely.
Answer: If there has been an ejaculation by the male, and semen is present, there is a chance of getting pregnant. Period. Teens really need to know that.
I think you may have your terms confused - semen is the overall fluid released during an ejaculation, sperm are the cells with tails that are produced in the testes and fertilize the egg. At any rate, according to the WHO, a normal sperm count is over 15 million per milliliter, with some counts much higher (>50e6/ml ), and an average between 20 and 40 million. The volume of the ejeculate tends to be anywhere from 1-6 ml. If you take a healthy young male at the peak of his reproductive capabilities, this equates to a very large number of sperm being released during a sexual encounter. All it takes is for one to reach an egg and fertilize it. Sperm are very very small, much smaller than the pore size of average fabric, so clothing will do very little to stop them. The female is likely sexually aroused during this activity as well, and produces additional fluids and lubricants that promote the survival and motility of sperm, among other things.
So, it depends on many factors. If both parties are fully clothed (at least 4 layers of clothing between their respective reproductive organs) and there is a minumum of soaking through, the chances of pregnancy are correspondingly quite low. On the other hand, if only one partner is wearing just their underwear, it's essentially like there is no clothing present at all, and the relative chances go up significantly.
Safe sex practices can't be emphasized enough to young people, as education and awareness is so much better than ignorance and myths. Even aside from pregnancy, if condoms are not utilized properly to contain all the semen there is the chance of sexually-transmitted diseases, ranging from herpes and gonorrhea to AIDS. None of these require penetration to be passed along, and one might argue that the additional presence of potentially irritating fabrics could open up raw areas or cuts and enhance their transmittal.

Take home message
Now, all this being said, the chances of impregnation through clothing without direct penetration of the penis into the vagina is quite low compared to "typical" unprotected fully-penetrating intercourse, especially depending on where the female is in her fertility cycle. According to this study, a woman's most fertile day is two days before ovulation (as had been postulated before), and the chances of pregnancy on that day are about 25% (assuming penetrating intercourse). Overall, the chance of pregnancy throughout the month is about 5%.
I don't have any hard numbers on the pregnancy chances when one or both partners have at least some clothing on, as obviously it will vary greatly depending on who is wearing what, the volume of ejaculate, contact time after ejaculation, etc. Just for fun, let's assume it's 100 times lower. That means the chances of impregnation two days pre-ovulation would be 0.25%, or 1 in 400. While rather low, this is still a non-zero chance.
Condoms are about 98% effective if used properly during penetrative vaginal intercourse. Various other birth control methods such as contraceptive pills, intrauterine devices, implants and injections are quoted as being 99% effective on their own, although they do not protect against sexually transmitted diseases. I'm certainly not one for preaching abstinence, but done properly it should be 100% effective. Ultimately, it is up to both partners to decide what their risk tolerances are, together. It is much better to seriously talk about it beforehand than to be panicked and unsure afterwards.

Hopefully this addresses your concerns, please leave comments if you have additional questions.
Comment: Matt, It likely is a bad answer. Take a look at this WebMD blog post. http://blogs.webmd.com/womens-health/2010/01/urban-or-suburban-legends-about-sex.html from a factual perspective about pregnancy risk.
Comment: @caseyr547 could you at least explain *why* this is a bad answer? Comparing an answer based on scientific and medical facts to a TV show is not an answer.
Comment: Meh it's bad science wrapped in a lot of excuses...winning the lottery is also realistic by your math
Comment: I've edited the answer to add some more information as well as some verified and off-the-cuff numbers, as well as discussed family planning in greater detail.
Comment: P.S.: I am gathering all this information in order to write a few articles, to make more teens aware of the risks. Now we know that it is certainly possible by statistics and probabilities. But realistically, considering you know all the technical information about semen and sperm. Is it realistically possible? What kind of advice would you give teens whom this way of sexual interaction is their only option?
Comment: Matt this is a bad answer
Comment: House did a much better job www.imdb.com/title/tt1273714/synopsis
Comment: @TheNotMe after washing clothes with detergent they are generally rinsed in clean water, so the amount of "chemicals" left over should be relatively minimal. Some sperm may die, but how much of a chance do you want to take? Your best option is to wear a condom, which, when worn properly, retains the semen in the tip. It'll prevent your pants from getting soaked, make clean-up a lot easier, and give you much greater peace of mind.
Comment: @TheNotMe in regards to your second comment, yes, I think getting pregnant via "dry humping" is realistically possible. It's not very likely, as compared to unprotected vaginal intercourse, but it is definitely possible. However, like I said in my previous comment, condom use will significantly reduce the risk.
Comment: There is only a real chance of getting pregnant if you have sex secondary transfer isn't realistic
Comment: @caseyr547 The point of my answer is that it **is** realistic. The overall likelihood is low, just as the chances of getting pregnant during any one typical vaginal sex session are, but there is a nonzero chance that it could happen, and there are several factors that affect that, as I described. I'm trying to stress that if you are going to engage in this behavior, then you need to protect yourself as much as possible. I'm also trying to dispel myths. The fewer unwanted teen pregnancies in this world, the better, and the fewer STDs the better. Calling this a bad answer is counterproductive.
Comment: the my answers are so good it's counterproductive to question me is also silly
Comment: It seems like it would be simple experiment to put sperm one side of a cloth barrier of a petri dish and count sperm that appeared on the other side. I'm not familiar enough with the spermology literature to know if it's been done.
Comment: I do not think it is a bad answer from the perspective of always practicing safer sex and for people to use barrier protection at all times, to know their STD status, and only to not use protection when he purpose is to conceive and both partners have been cleared by their doctors as health, or are informed of the risks they are taking.
Answer: It is effectively impossible to get pregnant by dry-humping because the conditions that would have to be met for sperm to pass through multiple layers of clothes, survive on skin, find the vaginal opening, survive in the vaginal environment and finally impregnate an egg are simply unrealistic.
The barrier of clothing that we can assume present during 'dry humping' is significant. Semen begins to die as soon as it begins to dry out and any clothes you're wearing are likely to draw water away from the sperm cells through adhesion of water to the fabric. One layer is absolutely not "like there is no clothing present at all".
Assuming some sperm cells made it through all that and onto skin, their motion isn't directed towards the vaginal opening, so a sizable fraction will be literally lost at that step. Skin is also a toxic environment on its own, so these improbable sperm have a very limited time to find their way.
That last battle buddy team of sperm has very little chance of surviving the vaginal environment. A lot of sperm need to enter the vaginal environment together to ensure that just a few survive.
As far as dry humping is concerned, there's no realistic reason to worry about pregnancy.


Splitting variety for bicyclic algebras

Question: Let $F$ be a field contains a primitive root of unity of order $p$, where $p$ is a prime number. Let $a,b \in F^\times$, then one can look at the cyclic algebra $(a,b)_p \in {_p}Br(F)$ where ${_p}Br(F)$ is the $p$-torsion part of the Brauer group of $F$. It is a well known fact that $(a,b)_p$ splits iff there exist $X \in F[\sqrt[p]{a}]$ such that $N_{F[\sqrt[p]{a}]/F}(X)=b$. This condition can be written as a simple polynomial equation with coefficients in $F$, so the question about $(a,b)_p$ being split is reduced to whether this equation has a solution.
Now for $a,b,c,d \in F^{\times}$ one may define $(a,b)_p \otimes (c,d)_p$ which is a bicyclic algebra over $F$. It is known that there exists a system of polynomial equations which determines whether it splits or not. Is there a description of this system? I would be glad to have a detailed reference about this material.
Thank you!
Answer: For any central simple algebra $A$ you can form the (projective) Severi-Brauer variety $SB(A)$ such that $A$ splits if and only if $SB(A)$ has a rational point, that amounts to a system of homogeneous equations that can be written explicitly, if needed. If you prefer affine varieties you can apply Jouanolou's trick then.

Splitting variety for bicyclic algebras


Missing Decals After Purchasing

Question: Good day,
I just bought a brand new Lego Speed Champion Toyota GR Supra 7690. After reaching home and unboxing it, I realized that my set was missing the decals. Is there any way that I can get the decals for my Lego set?
Comment: Contact the store, or try customer support.
Answer: I had a similar problem with my McLaren Elva, the printing of the stickers was severely misaligned with the cutting.
I used the Lego Customer Service Missing Bricks form to report the problem and they sent me a replacement free of charge, not even shipping.
Side note: It did take about two months to arrive, likely due to the pandemic and the fact that I'm out of the way in New Zealand. But I hope you get yours sooner.
Comment: Missing bricks service often takes several weeks at the best of times even if you live close to one of their distributing warehouses.
Comment: @Tonny That is a little disappointing to hear
Comment: I've used missing bricks twice, and in both cases, the turnaround has been < 2 weeks.

Missing Decals After Purchasing


How can I switch my already installed project to drupal-project?

Question: I am trying to make my already installed drupal site to use drupal-project.
Answer: Drupal project just helps you setup a project. But you can just take a look at the project on Github and copy/paste files/folders to your project.
Or you could initiate a new drupal-project and move over your custom modules/themes and make your new project use the database of the old one.


How Do You Apply Microdisplacements For Exporting

Question: I've learned how to use microdisplacements and I think that they are very handy. However, I would like to use them in Unity Game Engine, so I would like to the microdisplacements to actually add new vertices and change the shape so that I can export it as a .fbx. If you can't, please tell me!
Comment: That is not possible as far as I know, Microdisplacement is internally generated dynamically at render time by the Cycles Render Engine and cannot, for the most part be exported. You can however use the same displacement map (if it is image based) on a regular *Displacement* modifier and achieve a similar effect, albeit at the expense of very high poly count
Answer: The displacement input in the materials is for rendering inside of blender only. In order to get the effect in a game engine, you need to create the geometry by using a displacement modifier on the mesh.


How to search through a list of coordinates and display, depending on the distance between it and current location? (Windows Phone 7)

Question: I have gathered about 60 or so geo coordinates of cinema locations around Ireland and I want to use them in my WP7 app to show nearest cinemas to your current location.
I thought I would save them in an XML file but I don't think that will work for what I'm trying to achieve, which is to be able to search the entire list of coordinates and display whichever cinemas appear within (for example) 25kms of their location.
I have found a few links to helping find the distance between two points so that part shouldn't be too bad.
Any ideas on how I might go about achieving this?
Thanks in advance
Comment: How are you currently storing the geo coordinates? List? Can you not iterate through this collection?
Answer: I created a similar service.
First of all, as Shedal also pointed out, consider hosting the locations in an external service. This will make your life a lot easier when you need to add more locations. (The update application service in App Hub can take up to 10 days which is a long time if you need to quickly fix a wrong location)
Secondly, once you have loaded the list of locations, it is simple to loop through them and find the nearest cinemas. You can use the Haversine formula to calculate the distance between two geo locations (this formula takes into account that the earth is round, and not flat - unlike the Pythagorean theorem). Luckily for your the WP GeoLocation class comes with a built in function called GetDistanceTo that you can use.
The problem is now nothing but a simple Linq query:
List<GeoCoordinate> cinemaLocations = new List<GeoCoordinate>();
GeoCoordinate myLocation = new GeoCoordinate();
var closestCinemas = cinemaLocations.OrderBy(s => s.GetDistanceTo(myLocation));
var closestCinema = closestCinemas.FirstOrDefault();

Answer: Shouldn't the list of cinemas be updated from time to time? If so, I would host a web service somewhere and call it from your app to obtain the up-to-date list of cinemas.
In regards to calculation of the distance, it's simply the Pythagorean theorem.
D = sqrt(abs(x2 - x1) + abs(y2 - y1))

Comment: Actually this is not the right formula. One should use Haversine formula
Comment: I torally agree. But just as a side note - would it make a big difference for the purpose of finding the closest cinema in Ireland?
Answer: I would store them in a SQL server (SQL lite can run inside a WP7 app).  Then I would query with lat and lon using a +/- of some value based on your current location. Now you will need to be sure to compensate for being near the 0 degrees axis, but this will give you a square area to reduce your results down to.  Once you have this you can iterate over the result set looking for the distance to each point and just drop the results that sit in the corners of this square creating a result set that looks in all directions with a defined maximum tolerance. Of course I haven't had to solve this exact problem (I tend to rely on projects like Neo4J Spacial which handles stuff like this automatically (and really well)


What are Windows ACLs?

Question: What are Windows ACLs and why are they important?
Comment: Main page for [Windows ACL](http://msdn.microsoft.com/en-us/library/aa374872%28v=vs.85%29.aspx). You might want to add some additional qualifications to your question, otherwise people will close it and you'll be given links to the MSDN documentation and Wikipedia.
Answer: I found the following at this wiki page.

An access control list (ACL), with
  respect to a computer file system, is
  a list of permissions attached to an
  object. An ACL specifies which users
  or system processes are granted access
  to objects, as well as what operations
  are allowed on given objects. Each
  entry in a typical ACL specifies a
  subject and an operation. For
  instance, if a file has an ACL that
  contains (Alice, delete), this would
  give Alice permission to delete the
  file.

To answer your question about "why are they important?" if you do not yet understand, if you do not have them, permissions wouldn't exist. This is how Windows understands who has certain privileges.
Answer: An Access Control List (ACL) has zero or more Access Control Entries (ACEs).  Many different objects in Windows can have ACLs, such as files, devices, printers, registry entries, and other things.  (Check out SysInternal's WinObj if you want to get an overview on all the different types of objects in the Windows "namespace" - many are internal to Windows and not directly exposed to the user)
An ACE consists of

A principal.  Usually this is either a user or a group.  It could be a user, group, or computer in an Active Directory database on a domain controller, or a local user.  There are "virtual" groups such as "Everyone" and "Authenticated Users."

and

One or more capabilites, each capability can be set to Allow or
Deny.  Some example of capabilites are "Read", "Write", "List Contents", etc.  Deny takes precendence over Allow.  Most objects such as files, etc. won't allow access or changes unless there's a specific "Allow" ACL available; thus Deny should only be used in special circumstances.

ACLs can be inherited, i.e. files in lower-level directories can inherit ACLs from upper-level directories.
They are important because this is how Windows gives and enforces privileges to processes.  Each process runs as a user, and if that user "falls under" one or more ACEs then Windows resolves all of them to figure out whether a specific action is allowed or not.
Answer: You can look at it like this.
Every object on NTFS has a serialized number (including user accounts, user groups, processes, devices, etc.).  The Access Control List keeps track of which serialized number can access another serialized number, and what permissions are set.  Just think of everything having a serialized number, with permissions attached to them.
If you delete a user named FRED, his serialized number is deleted, and it removed from the ACL.  Effectively, FRED's serialized number is no longer associated with other devices and the permissions he had with those devices are also removed.
If you re-create a user name FRED, he will be assigned a new serialized number.  The ACL will recognize this as a new number.  Therefore, it will not re-establish any permissions which the deleted FRED account had.
Hope this helps conceptualize what the ACL is, how it works, and why it is important.

What are Windows ACLs?


correlation between % white ink (only) and % opacity

Question: I'm trying to find a simple yet accurate way to figure out how a certain percentage of white ink (only white ink) printed to a clear substrate correlates to the percentage opacity that white ink layer has.
Comment: Can you be specific about what you mean by ink? Are you talking about Photoshop layers. An empty layer with a white background is completely opaque (unless you make it less than 100%). That is, it will block anything below it. BTW, white isn't usually thought of as "ink," it's usually the background paper color for printed work.
Comment: This is *far* more complex than it may seem. Ink destiny, dot gain, viscosity, and substrate all may *naturally* alter an ink's opacity. You would need to contact a production provider to get some data from them. The ink may naturally only have an 90% density/opacity on a given substrate. So, that natural limitation would have to factored into any formula.
Comment: White is often (more often than not in fact) an ink colour that is used when printing on transparent substrates.
Comment: And for what it's worth, you can adjust the `Solidity` of spot color channels in Photoshop to mimic natural ink densities on screen (but it will not alter output).
Answer: The layer in your artwork will naturally range from 0%-100% opacity. 100% in your artwork will correlate to the maximum opacity achievable for the given print method and the ink used. This maximum opacity varies a lot, but for most processes is probably lower than you'd expect.
E.G. Flexo white is normally only something like 70-80% opaque. There are ways to increase this such as applying two hits of white ink or mixing an extra opaque 'super white' ink, but these methods incur extra cost for diminishing returns. For instance, two hits of white might only increase your opacity from 75% to 85% while costing more than adding an extra colour to the design. Again, surprising but true. White ink costs more than any normal colour because it contains a high amount of titanium dioxide which is expensive stuff.
All that said. Once you know the maximum opacity that your printer can achieve, the relationship between artwork and print opacity is pretty linear. So if your max opacity is 70% then 100% in your artwork will be 70% when printed and 50% in your artwork will be roughly 35% and so on. Zero is obviously always zero, but if it is flexo printing you will be restricted by the minimum printable dot.
Most printers will know what opacity they can get or will be able to run a trial on the right substrate and supply samples for reference.


Tracking an anonymous comment back to my work computer

Question: I used a work computer to post a comment that someone is trying to track with the help of a lawyer.
Under subpoena, the site gave up the IP address that was active during the time I made the post. The ISP can now trace the IP to my employer. I used a computer that is wired to the network. Will the IP lead directly to that terminal? Or would it be inconclusive because there are hundreds of wired terminals on the network and my employer also offers public wifi? I'm wondering if the IP address can be traced all the way back to the specific terminal I used to post the comment, or if the trail will only go as far as the building the computer was in.
Answer: The public IP will lead them to your company's network.  Your company's network administrator may then be able to look at their logs to determine which computer inside the network initiated that outbound traffic.  In general, you should always assume your employer knows everything you are doing on their network.
There are also additional ways to identify you other than by IP.  Depending on how ill-advised of an action you took, these may or may not come into play (posting an abusive comment, probably not; accessing child porn, certainly).
Comment: Thankyou. Does the fact that it was a hospital network affect privacy at all?
Comment: I don't think so, but I'm not familiar with the IT procedures unique to medical facilities.


Why K and V are not the same in Transformer attention?

Question: My understanding is for translation task K should be the same with V, but in Transformer K and V are generated by two different(randomly initialized) matrix $W^K, W^V$, therefore not the same. Can any one tell me why?
Comment: why do you think k should be the same as v?
Comment: We compute similarity of Q and K and use its result as weight to pass K information into the new value of Q,  V and K should be the same so that Q know how much K's information should be added to Q
Comment: does this answer help? https://stats.stackexchange.com/a/424127/95569
Comment: [This article](https://medium.com/@london-lowmanstone/a-simpler-description-of-the-attention-mechanism-573e9e7f42b0) goes into more depth (and [this other answer of mine](https://stats.stackexchange.com/a/639045/143283) goes into less depth), but the general idea is that the key weights determine how to represent an item in a good way to figure out *how much it should impact the query item*. Then, once we've determined how big of an impact it should have (the attention score), we also need to figure out *what that impact should look like*, which is the job of the value weights.
Answer: I guess the reason why the specific terms "query", "key" and "value" were chosen is that this attention mechanism resembles a memory access mechanism. The query is the specific element for which we seek a representation. The role of the keys is to respond more or less to the query and the values are here to compose an answer. Keys and values are necessarily related but do not play the same roles.
For example, given the word query "network", you might want the key words "neural" and "social" to generate high weights since "neural network" and "social network" are common terms. It means that the dot products between the query and these two keys are high and thus the two key vectors are similar. Nevertheless, the values for "neural" and "social" should be dissimilar since they don't deal with the same topic. Using the same representation for keys and values doesn't allow this.
Somehow, using the same transformation for keys and values might still work, but you'll lose a lot of expressiveness and might need much more parameters to achieve similar performances.
EDIT: I just found a better explanation of the query, key and value terms in this post.
Comment: @eric2323223 Keys and values are different since it allows the network to separate unidirectional relationship between input tokens from bi-directional relationships. For example Robin's example in his answer: The token "Network" can be related to "neural" and "social" in some very similar ways, but the "answer" from the respective relationships is not neccessary equally similar. So both "neural" and "social" tokens can respond to the same Query coming from the "Network"-token, i.e. the keys for "neural" and "social" is very similar, but the values is returned is not the same for both tokens.
Comment: @eric2323223 I try re-phrase my comment: The Query->Key connection answers the question "How is this token (Network) related to this token (Social)?" and then the returned result (partly based on the Value) represents "What is the result of this relationship?". So the keys is like meta-labels, listeners that is triggered and responsive to the queries while values is used when responding to the query - it's not sending the pure meta-labels, the triggers, to the next attention-layer.
Comment: Could you please explain more about "you'll lose a lot of expressiveness and might need much more parameters to achieve similar performances" ?
Comment: 1) It would mean that you use the same matrix for K and V, therefore you lose 1/3 of the parameters which will decrease the capacity of the model to learn. 2) As I explain in the second paragraph, by forcing K and V to play the same role, you lose the capacity of the model to distinguish between key interaction and value composition.
Comment: I am still confused why use K, Q, V instead of just K, Q, it make no sense to me K, V are different in language translation context.


How to create Web Application with custom MMS application association

Question: I have found Powershell script to create Web Application, But I don't find how to associate it with custom Managed Metadata Service application. I Need help to write Powershell script how to associate custom MMS to Web Application?
Answer: 1)Replace the Name of the service with Managed Metadata service
$serviceAppProxy = Get-SPServiceApplicationProxy | where { $_.Name -eq "Name of the service" }

2)Get the Proxy group e.g. Default . If you have a different one replace the name proxygroup default with your custom proxy group.
In the step 2  Get-SPServiceApplicationProxyGroup gives you the list of the all the proxy groups.
 $proxygroup = Get-SPServiceApplicationProxyGroup | where { $_.FriendlyName -eq "[default]" }

The web applications are associated to the  proxy group. The proxy group in turn contain the list of the service applications that are associated to it.
3) Add the service application
Add-SPServiceApplicationProxyGroupMember -Identity $proxygroup -Member $serviceAppProxy

4) If you need to associated a particular web application
$web= Get-SPWebApplication |?{$_.DisplayName -like"*Web application Name*" }

$web.ServiceApplicationProxyGroup=Get-SPServiceApplicationProxyGroup | where { $_.FriendlyName -like "*default*" }

If you need to create a New Proxy group
New-SPServiceApplicationProxyGroup -Name RemoteProxyGroup

Comment: Thats fine, but on step 3: How i associate/add service application to the Web Application? need powershellscript here:
Comment: At step 4: script successfully associated my web application with new ServiceApplicationProxyGroup. but when i go to central admin, i see web application is still associated with default group. why is that?


What Linux software can I use to explore entropy of a file?

Question: I've heard of tools that could be used to graph entropy of a file. Is there a graphical Linux program that I could use for this job that would let me conveniently explore which blocks of a file have certain entropy patterns that could suggest compressed or encrypted data?
Comment: What do you mean by 'entropy'? Have you heard of REMnux? It's a Linux distro tailored for Malware analysis. It allows you to look at how files are made up, but I'm not sure if that's exactly what you're after?

http://zeltser.com/remnux/
Answer: There is no such thing as "entropy" of a file. The entropy is a characteristic of a process -- for instance, of a process that generates a file. The entropy does not describe what the file contents are; it describes what the file contents could have been. As such, any tool which purports to identify "entropy patterns" is, at best, loosing extremely poor terminology.
That being said, one can still do some heuristics. It so happens that most "real-life data" exhibits a lot of redundancy in its structure; this is what data compression is about. So you may work on the following assumption: data which can be compressed by a non-trivial amount is not data which has already been compressed or encrypted. Indeed:

Compression algorithms strive at identifying and removing redundancies. The result should not be susceptible to further compression; otherwise, this means that the compression algorithm does a poor job.
Encrypted data is supposed to be indistinguishable from randomness (if the encryption algorithm is any good); thus, it has extremely low probability of being compressible.

So you could extract chunks from your file, and compress them (e.g. with gzip), to see if they can be substantially reduced. For instance, this command extracts a 2000-byte chunk from file data.bin (at offset 15000), compresses it, and reports the resulting length:
dd if=data.bin bs=1 skip=15000 count=2000 2>/dev/null | gzip | wc -c

If the resulting value is substantially smaller than 2000, then the chunk, most probably, contains data which is not encrypted or already compressed. For instance, if I use as data file the /usr/bin/gcc-4.8 file (an executable full of code, but not compressed) from my Linux laptop, I get an output length of 1491 bytes for that chunk, which is indeed quite smaller than 2000. If I try on /dev/urandom, I get 2023 bytes.
(These figures get printed on my screen as sequences of characters, that I process with my eyes and brain. This, in my view, qualifies as "graphical".)
Running the command in a loop which extracts various file chunks and compresses them all is left as an exercise to the reader (it is not hard, and if you cannot do that, then chances are that you won't be able to do much with the files anyway; practical data processing requires some programming skills).
Caveat: gzip, like most general-purpose compressors, works on a per-byte basis, and tries to find repeated patterns and biases in usage of byte values. This is known to work poorly on analog data which has been digitized, e.g. audio samples. Compression ratio offered by gzip on WAV files is thus often poor, while the WAV file is still "not compressed" (this page claims to have measured a compressed length of about 92% of the original, though it will depend on the WAV file characteristics).
So don't imagine that the "compress by gzip" test is the ultimate detection method for compressed/encrypted data. Still, that can give good results, provided that the compressed/encrypted chunks you are trying to locate are long enough (you won't find 50-byte chunks that way).
Comment: I didn't mention that I consider compressing with gzip as a good way to detect if the file is already compressed. Still, thanks for the writeup, though it doesn't really answer my question.


Inserting tokens into a text field, such as body

Question: For many years I've used the excellent token filter module. However, viewing development activity on the module, (Seeking co-maintainers, Maintenance fixes only, and last updates are over a year ago) suggests that this module's future may not so bright. Which, in turn, suggests that there is another or better way of achieving similar functionality? For example, I commonly use token filter to construct the current year for the copyright mark. Other examples include referencing the site email or slogan.
What's the best "future-proof" method for inserting token-like content into text fields?
Answer: I think you are looking for Advanced Text Formatter module which allows you to enable token replace on fields you choose. The mantainer says it would have a Drupal 8 version too.


Troubleshooting arc fault breaker

Question: My arc fault has tripped the circuit affects two bed rooms I unplugged everything in both bed rooms the arc fault will not reset. I pulled all receptical and switches in both rooms checking for loose wires and any bare wires. Breakers still does not reset I replace with a new arc fault breaker the problem still exists I also Putin a standard breaker and both the bedrooms are powered I,m still trying find out what and where the problem is any recommendations
Comment: What make/model of AFCI is this?
Comment: Did you replace it with a GFCI, or a normal breaker? It may be an earth fault - earth and neutral shorted somewhere, or a load connected to earth rather than neutral.
Comment: The arc fault breaker is a Eaton 15 amp arcing
Comment: Can you put the arc fault breaker back in and extract the diagnostic codes from it?
Answer: Since you have removed the loads and replaced the breaker there could be a pinched or skined wire in this circuit causing the fault. A megger to verify the insulation is good is the quickest way I know. The wires are removed from the breaker and all switches off. If there is a low resistance at less than 500v there is usually a staple or nail through the insulation. If the test is good start turning on switches, lamps/ bulbs out when one circuit shows a low value this is the one to check. With all this said if you have recently added flouresent lighting, a large computer / UPS or a large dimmer on any kind of lighting circuit arc fault breakers can't tell the difference from an arc and a electronic load and will trip.

Troubleshooting arc fault breaker


Passport information compromised

Question: I still have my passport in hand but my purse was stolen with all my passport information and passwords with security questions and answers in it. Should I get a new passport or since I still have my passport am I safe
Answer: I would report the theft to the police and highlight the point that your passport information was written down in it. Unsure of the laws where you are but in the UK if your passport has been stolen then you must report it. Obviously you still have your passport but with me not being a hardened criminal i am unsure if a passport can be recreated from the details you had written down.
Or ring the passport office, they will be able to advise.
Comment: reports have all been filed .. I have tried the passport office. They keep giving the different people who do not seem to know. Yes here in the US if it is stolen we must report it too. I just dont know about the other info. Thanks for your help . I'll keep trying to find out.
Answer: If your passport is replaced, the only thing that will change is the passport number.  All the rest of the identifying information will necessarily be the same.  I've never seen a passport number, by itself and without the physical passport, used as identification.  (My experience is somewhat limited; I hope others will correct me if I'm wrong.)  So, even if the U.S. is willing to issue a new passport, I do not really see what it will accomplish.  The thieves already have everything that's given in your passport.
Instead of, or at least before, fretting about the passport, change all those passwords.  Use a password manager to generate random passwords.  (I like Password Safe because it does not have any kind of cloud sync capability.  Depending on how you run your life, that could be a drawback for you.)  If you must carry passwords with you, reduce the number to the bare minimum, or carry your password manager data on a flash drive.  (Be sure you have a backup.)  Even if the flash drive is stolen, it will (should) be protected by a strong password that you have memorized.
Consider a security freeze with each of the major credit bureaus.  Given a police report, you can probably do this without a fee.  No one else will be able to apply for credit in your name while the freeze is in effect.  (The downside is that you can't apply for credit, either.)

Passport information compromised


A question about definition of Fermi energy

Question: Wikipedia states the definition of Fermi energy as for "a system of non-interacting fermions". If we have to assume free electrons in a solid behave this way before we are able to calculate Fermi energy, how can Pauli exclusion be justified (because electrons are non-interacting)? Can Fermi energy be similarly defined for electrons confined to a single atom?
Comment: Nuclear physicists have no trouble defining a Fermi energy for interacting nucleons, it's just more complicated than the non-interacting case. See the first chapter of Walecka's book among others.
Comment: I assume you mean "because electrons are interacting" in your parenthetical. This is justified by Landau Fermi-liquid theory, and it applies to crystal quasi-particles. There is a similar qualitative idea in atoms, but it isn't used much (as far as I know).
Comment: The definition "a system of non-interaction fermions", i.e. a Fermi gas exists in a metallic solid after the Pauli principle has been taken into account. So roughly: 'free' electrons in a metal + Pauli = Fermi gas. For this Fermi gas you can define a Fermi energy.
Comment: I am seeking for an answer to the less emphasized question too : Can Fermi energy be defined for electrons confined to a single atom?
Answer: You might say, of course, that in some sense the fermions do interact (and it is even called exchange interaction). However, it is physical forces, like Coulomb ones, that are understood to be absent. A relevant discussion has taken place here: Degeneracy Pressure, What is it?
Concerning the second question about single atoms, the answer is no. Firstly, Fermi statistics, as any statistics, can only be applied to macroscopic objects. Secondly, even if you were able to create a giant nucleus of a large charge and cover it with a macrosopic number of electrons, the electrons would be interacting with each other through Coulomb forces, hence will not represent a degenerate gas and hence will neither follow the statistical distribution of degenerate gases nor possess Fermi energy.


When was Birkat haTorah composed and added to the liturgy?

Question: Do we know when Birkat haTorah was composed and added as an obligatory blessing to be said before learning Torah? Is it just something done by Anshei Knesset haGedolah or do we have any other information relating to its authorship, the period in time when it was adopted, etc?
Comment: It's mentioned in the Talmud. It's exceedingly rare to have any other provenance information beyond that for old parts of the liturgy
Comment: My understanding of the sugya is that, in the days of the Talmud, birchas hatorah was generally not said, and people would instead have only said the beracha of ahava raba before shema. This is not how tosafos understands things. A full answer would take a long time to type out.
Answer: The Ramban holds that Birchas Hatorah is biblically mandated. Accordingly, some form of Birchas HaTorah would have existed from Matan Torah. (However, this doesn't necessarily mean that the Nussach is d'Oiraysa.)
The exact classification of the three Berachos of Birchas HaTorah are subject to much debate among the achronim. If any of them are Birchas HaMitzvos or Birchas HaNehenin, they would not have been around until the Anshei Kneses Hagedola instituted them. [The Ramban is referring only to whichever part of Birchas Hatorah is derived from the verse כי שם ה׳ אקרא הבו גודל לאלקינו.]


CakePHP Validation errors are not appearing

Question: If I'm not mistaken, CakePHP's validation errors are supposed to be rendered automatically below the input field that they correspond to.  Mine aren't doing this.  The validation errors are in the Model->validationErrors array, but they are not being printed.  I don't have a beforeValidate method for this model (I do have a beforeSave method, which return true whatever).
In other news, Cake's SQL log isn't showing for me either, with debug on 2.
I'm using Cake version 1.3.
Can anyone help me?
Thanks.
Answer: Usually this is a problem in the $validate array in your model. More code pls?


Is it possible to use DirectX in pure C program?

Question: I want to try something simple with Direct Sound. Just want to know if it's possible.
Or maybe I need some other API?
Comment: Possible, yes. Practical, no.
Answer: It's not only possible, it's actually been done.
More than once.
OK, I wouldn't go so far as to call out early id Software code as the epitome of good coding standards, but it does demonstrate that using DirectX in pure C isn't something that exists on a theoretical level, but rather something that has shipped in popular working commercial products.
Despite that you may have problems.
In the DirectInput example, typing out all of the wrapper macros can be a total pain-in-the-ass.  In the DirectSound example, earlier versions of MSVC didn't have autocomplete on the lpVtbl member, which can also be a total pain-in-the-ass (I haven't bothered checking with more recent versions).
There are other places in other DirectX APIs where some C++ isms have crept in, notably in the D3DX math stuff, and which can be awkward (but not impossible) if you wish to use them from C.
Nonetheless, fundamentally DirectX is a COM-based API, and while COM may look on the surface as if it is C++ based, it's actually not - a COM interface isn't a class, it's a struct, and full C compatibility exists (COM as-designed is intended to be language-neutral).  I suggest checking out the Wikipedia article on COM for further info.
Answer: If you are for some reason dead set on C, OpenAL may be the audio API to choose as it is a pure C API.  OpenAL is a very low-level API.  I'm unsure how it compares to DirectSound as I'm used to working with more complete frameworks/engines/games which tend to use something like FMOD or Wwise rather than trying to roll their own high-level audio manipulation library.  Depending on what you're trying to do, a library like one of those might be a better option for you, too.
There are ways to bind DirectSound to C, and there at one point was even an official C binding for many DX components (no idea if it's still maintained), but in general this is not the way to go.
Short version: use C++ or use OpenAL.
Comment: DirectSound is a COM based API, which can be perfectly used from C. In fact, it is most likely implemented in C. The fact that COM functions are called in a similar way as you call C++ methods does not mean that COM interfaces are C++ classes.
Answer: Ofcourse. DirectX is written in plain C. Sure, there are some C++ extension libraries for help on math-related stuff (matrices, vectors etc), but those are typically not long-lived (early deprecated), and rightfully so. Hence you shouldn't even be using those C++ libraries; at least not if you want your code to become deprecated over time.


Is it safe to view infected word documents in office online?

Question: Can viewing and editing a potentially infected microsoft word document (with images inside) on a web-based platform like office online (OneDrive) infect my pc? How does the browser running on my machine display the content of the remotely uploaded document?
Answer: As always, it depends, but viewing it online is much safer than viewing it in Microsoft Office installed on your machine.
There are two main ways a malicious office document can infect you: macros and exploits.
1. Macros
A macro is a program written in VBA that is embedded in an office document. This is the most common way of infection through office documents. Macros are not supported in office online, so they are not a cause for concern. Even if they are supported at some point in the future, the macros cannot directly do any harm since they will be operating inside the browser sandbox.
2. Exploits
An exploit targets a bug in a particular piece of software to perform some undesirable action that should not have been possible. Generally, the exploit only works against the software which it was designed to target, since only that software contains the corresponding bug/vulnerability. Which means that if the office document contains an exploit that targets MS Office, it will be completely ineffective when the document is opened in a browser.
While relatively unlikely, it is also possible that the document contains an exploit targeting the browser. In that aspect, opening the document is pretty much the same as clicking on a potentially malicious link. In other words, if you keep your browser updated and are not likely to be targeted by any sophisticated attackers or APTs, it is highly unlikely that opening the document in your browser will result in your machine being infected.
Comment: Thanks for an elaborate answer! So, in that case for an attack to be successful, a DOCX document would need to target a specific vulnerability in office online server software and then make it communicate with my browser in some malicious way in order to get to my pc an do something nasty?
Comment: @amaramzi While it is possible that someone goes the route of first exploiting a flaw in the server and then your browser, it is also possible for the document to contain an exploit directly targeting your browser, without having to compromise the server first. In either case, it will need to exploit a vulnerability in your browser or OS, so keeping them updated will keep the risk of your PC getting infected very low.
Answer: Viruses targetting local Office installation should not cause harm to your system when you use Office Online because your browser only displays the image for an application running remotely.
That being said Office Online is now a rather common thing, and malware could start to target it directly. As usually, they would require a still unpatched flaw either on the remote system running the application, or or your local browser. I have no real world example of such a malware, but I would not blindly believe that nobody will ever create one...
And the mitagation is as usual to make sure to only use up to date software both on your local system and on the remote (if you have any control on that part...). And to have an up to date antivirus running on both systems.