Variable Frequency on AVR Chip?

Question: I am looking at programming an AVR chip as a possible avenue due to some problems I'm having with 555 circuitry, but I need to be able to adjust the frequency on the fly with a pot.  Is it possible to setup an AVR chip with variable frequency so that the program execution speed can be adjusted right on the board with a simple pot and without having to go back and reprogram the chip?:
Answer: It's not clear, but it seems from your question that you want to have a variable frequency waveform that responds to a Pot value for adjustment.
Just staying in the AVR mode (there are many different ways to do this) you could also do this without changing the operating frequency of the device.  You would just need to read the POT value with the ADC input and use that value to adjust the PWM output accordingly.
Answer: As others have already stated, nearly every AVR developer picks some fixed frequency for each application, and runs the AVR chip at that one fixed frequency.
Just this week I wrote some code that runs on an AVR that runs at fixed 16 MHz (which is pretty common),
but it generates two variable-frequency outputs independently controlled by two pots.
(The pots are actually connected to another microcontroller, which reads the pots, and sends their position up a 400 ft RS485 serial cable to the AVR UART).
However, there are a few AVR developers who vary the frequency of their AVR chip at run time, such as
Spritesmods (a) (b); cloudscapes (a);
K0LR (a); etc.
Using an external RC oscillator
A few AVRs support an "external RC oscillator" option, which is extremely similar to a 555 RC oscillator -- you hook a resistor (such as a pot) and a capacitor directly to the AVR.
Just like the 555 RC oscillator, when you turn the pot,
it changes the resistance R of the pot, which changes the frequency.
"Application Note AVR051: Setup and use the external rc oscillator" (a), (b)
Alas, many popular AVR chips do not support an "external RC oscillator" option.
Even those that do, the frequency is limited to the range 100 kHz - 12 MHz.
(The ADC doesn't work right at low frequencies,
and the UART is going to be difficult to use if the frequency keeps changing).
driving the AVR at some frequency generated elsewhere
If you have some clock source that already generates the frequency you want,
you can connect its output to the AVR and program the AVR to use "External Clock" option.
This approach works with any AVR and any frequency from zero Hz (0 Hz) to 8 MHz.
(i.e., you can go much slower than the "external RC oscillator" approach).
(The ADC doesn't work right at low frequencies,
and the UART is going to be difficult to use if the frequency keeps changing).
You program the AVR fuse bits to use "External Clock" option if some external source (that oscillates by itself) is driving a squared-off signal into the AVR clock input pin.
(Even if technically that external clock is an RC oscillator).
This external oscillator could, for example, be a 74HC132 Schmitt NAND and a capacitor and a pot, or a 555 oscillator with a capacitor and a pot, or a huge variety of other oscillators.
Comment: Yes. Like most processors, the AVR does a little bit of work after each clock edge. As long as the clock edges are far enough apart that its work is done before the next clock edge, it works fine. The time between edges can be different every time -- that is what makes [dynamic frequency change](http://en.wikipedia.org/wiki/Dynamic_frequency_change) possible.
Comment: Thanks David.  Superb answer!  I wish I could mark everyone's answer as the accepted answer. LOL All these are great!
Comment: So if I understand correctly, the AVR  fuse bits could be programmed to use External clock and then the clock input pin could be connected to a square signal from a 555 or other RC oscillator that I adjust on the fly with a pot.  And the result would be that the AVR program would then run at given frequency of the square wave going into the clock input.  It could be adjusted while the AVR is running without problem?
Answer: While in principle I don't see a problem you're limited to a range of 100KHz to 12MHz when using an external RC oscillator. You'd need to use an additional resistor to make sure those constraints are met so you don't get erratic operation and possible damage to the AVR. The long wires and the pot itself will probably also radiate quite a bit of RF interference.
The usual way would be to use the pot as a voltage divider and read the value using an analog input. Then use that value to vary the frequency of your timing loop while the CPU keeps running at the same clock frequency.

Variable Frequency on AVR Chip?


Magento shopping cart alert

Question: If somebody buy something from my magento website, how can I know this? Is magento sending information e-mail about orders to admin? or we have to check from backend?
Comment: you will hear the sound: cha-ching!!
Comment: http://stackoverflow.com/a/17866358/1823573
Answer: Magento has this built in as a default behaviour. To enable this navigate in the admin to System > Configuration > Sales > Sales Emails. In this section you will find options for all states of the order. In each section you can find the option "Send [State] Email Copy To". You can add your email address to this field to receive the notification.

Magento shopping cart alert


BYOD and Google SSL

Question: I run a school network with a BYOD program in place. I have a linux proxy (squid) with content filtering by Mind (fork of dansguardian). Everything works fine over HTTP, the problem is of corse when kids start using HTTPS. My biggest issue is that Apple has switched to using HTTPS when doing a google search in safari. This allows kids to do searches without MinD forcing safe search. I would like to know what I could possibly do about this. Is there anyway to stop this? Thanks in advance for any help!
Comment: Your first step will almost certainly need to be blocking all direct HTTPS, and setting up WPAD to deliver the proxy server settings so people will be forced through the proxy.
Comment: @Zoredache That would take the proxy out of transparent mode, correct? So the users would be given a gateway by way of DHCP, wouldn't they? Wouldn't the users to able to just turn off the proxy settings? Or am I completely wrong?
Comment: Yes, that would take it out of transparent mode.  You cannot transparently intercept HTTPS.  So the idea is to completely block all outgoing https except when the proxy is in use.  Then setup WPAD, so clients can get the  proxy config.   Once you do that you could simply block SSL connections to google.com.
Comment: @Zoredache You can transparently intercept HTTPS. It's not perfect due to certificates but it's possible. OP is going to have the certificate issue anyway if they want squid to filter proxied HTTPS connections
Answer: Squid supports a feature called SslBump using Bump-Server-First. This basically means browsers will attempt to establish a secure connection between them and the host. The Squid cache gets the intercepted connection and Squid establishes the external connection. Then completes the secure connection to the user. Squid is essentially the certificate authority for user/squid portion so it can decrpyt the traffic and cache/filter it.
As this is something the people who designed SSL thought could be an attack vector there's some bumps to get over. Squid does support dynamic cert generation so cert domains match on the client end and have some of the original cert information go through to the client. All this can go fairly seamlessly if your client devices can trust your CA certificate. That bits a little harder if people are using their own devices.

iOS can add CA certs with the iPhone Configuration utility
Doesn't look like it's possible on the droids
Recent droids can add CA certs
Windows/OSX of course can.
Linux is a bit more fiddly depending on the apps you use and what they use as a key store.

The thing to note is your cache is now in control of third party trust for these devices. The information that is mimicked in the dynamic certs goes some way to mitigating this but it's possible to configure squid to blindly trust things which could be bad for the users, if someone were to do a real man in the middle attack further out from your proxy, for instance.
Answer: It is now possible to ask google to redirect secure searches to http - https://support.google.com/websearch/answer/186669?hl=en is the google help page on the subject. They suggest using DNS trickery, this can be hard in Windows 2008r2 - I personally perefer a connect-header rewrite to achieve the same goal, which can be done in all good web filters (and some bad ones).
I work for Smoothwall who provide a filter with just such a capability, and the ability to do some other SSL filtering too. I'm biased, but I suggest you take a look. When it comes to the tough stuff, it's a lot easier than rolling your own. In the interests of impartiality, there are other web filters out there :)
Answer: There's not a lot you can do..  You could generate a self-signed SSL certificate for google.com, and MITM the traffic, and then you'd be able to inspect it and block as needed, except it depends how wiley the kids are, and whether they'd fall for the process of accepting your self-signed certificate.
It's also probably illegal.  You could block HTTPS traffic entirely, but that'd probably break all sorts of things.
Comment: The only way to redirect an HTTPS connection would be to get the user to accept the SSL certificate you presented.
Comment: Would it be possible to redirect `https://www.google.com` to http?
Comment: Not sure about illegal, if these are in terms of use for the network that the users have willingly accepted. I've worked for companies that do it, they had the benefit of including their own CA certs in the desktop/laptop builds and it 'just works'.
Comment: Illegal? That's exceedingly unlikely in the US, where schools have "in loco parentis".
Comment: The US I can't speak for, and you can't include your own CA Certs, as it's a BYOD environment.. so a bit of a grey area, IMO, IANAL, etc.

BYOD and Google SSL


Pitching/aerating stacked batches

Question: I have been "stacking" batches and have attenuation issues.  I will brew 5 G today and pitch the yeast.  I repeat these steps tomorrow and add it to the top of the first batch, although I do not pitch more yeast.  I also do not aerate either batch.  I believe I need to aerate, but am unsure when to do it; 1st batch, 2nd batch, both batches.  Also, should I pitch on the 2nd batch as well as the 1st?
Any help would be great....Thanks
Answer: Aeration/oxygenation is key. Without it yeast cannot grow successfully, which is basically the whole idea of batch fermentation (read: brewing). So, as you suspect, you really do need to do it.
The best answer to this question depends on some missing information, specifically: what kind of yeast (liquid, dry, from a starter or previous batch) you're using; how much yeast you're pitching; and how you're aerating (oxygen injection, shaking, vigorous pouring). However, in general it should be fine to pitch and aerate just the first batch. You can aerate the second one too, depending on how much you oxygenate the first one, how long your lag phase is, what shape your yeast is in, and probably some other factors. If you're aerating by shaking, it probably couldn't hurt to do both. If you're directly injecting pure oxygen, I'd stick to just the first one, giving it a bit more than you would for a single batch. Don't wait until the second batch to aerate. If you're not seeing any/much fermentation activity by the time you add the second batch, it may be a good idea to aerate more.
If you were to pitch more on the second day, what you're essentially doing is introducing less healthy/ready-to-ferment yeast into a medium that already has yeast that's adapted and fermenting (hopefully) vigorously. Meaning, the newly pitched yeast is going to have trouble competing for nutrients.
Answer: I don't think there's any need to aerate the subsequent batches.  Think about the purpose of aeration...the yeast use the oxygen to synthesize sterols which keep cell walls flexible for budding.  But the more yeast you pitch, the less need there is for aeration since you have adequate amounts of yeast already.  In your case, by the time you add the second batch you've had a lot of cell growth so further aeration shouldn't be necessary.  You may have more of a wort issue than a yeast issue.

Pitching/aerating stacked batches


Texture paint paints some pattern

Question: Heres the model with UV map, i unpacked it again and created a new inage for it, so UV would me clean, but no result. U can see the red markings on UV from my brush.I was trying to paint on my model, and this happened for some reason. I didnt want to paint like this, i was painting with the casual brush. Looks like the pattern is the actual UV map.. *Its dull from inside
Comment: Have you tried removing doubles in edit mode? That kind of pattern can often be cause by having lots of duplicate geometry.
Comment: Tried it now - removed 0 vertices
Comment: Interesting... Can you add a screenshot of the object in edit mode with the UV map?
Comment: It looks like you are using the texture you are trying to paint as the brush texture. Have you set up a material with the texture you are trying to paint? Are you trying to use a textured brush or a default brush?
Comment: Im trying to use a normal brush I dont know that i set texture as the brush. how can I reverse it?
Comment: Check out the answer below.
Answer: I see that the pattern looks like an UV unwrap painted image, so look to see if you have also loaded your unwrapped texture as your texture brush - because if you do, you will see this pattern continue to tile across your painted object. Simple method is to look under your brush for the Texture panel and press the X to disconnect any texture from the brush.

Texture paint paints some pattern


LibreOffice version

Question: Now, I use LibreOffice Writer 126.96.36.199 . According to http://ask.libreoffice.org/en/question/34088/selecting-copying-pasting-text/ and further things I need LibreOffice Writer 4.0 or higher. When it may be in the Ubuntu Software Center for my Ubuntu 12.04? If it is there, is it offered by my Upgrade Manager without my  request? Thanks.
Comment: you have to add `libreoffice-4-2` PPA.
Answer: Use the following steps to upgrade to the latest stable LibreOffice 4.2 version on Ubuntu Precise.
sudo add-apt-repository ppa:libreoffice/libreoffice-4-2
sudo apt-get update
sudo apt-get sudo apt-get dist-upgrade
The repository ppa:libreoffice/ppa no longer supports packages for 12.04. As the other posts point out (see the link in the above comments to an earlier post), this ppa will not work for versions later than 4.2.

LibreOffice version


Problem with the solution to a logic puzzle

Question: The Puzzle
A village has $N$ people, and each of them has one dog. One day, certain number of dogs, say $K$, contract rabies. Every morning, all people take their dogs out for a walk, and they can tell which dogs, except their own, have contracted the disease. But they do not tell each other of what they see, but they all agree to shoot their own dog during the night if they can conclude that their dogs have contracted the disease.
Some extra premises include:

They do not shoot other people's dogs.
The disease isn't contagious. ($K =$ const.)
The number of rabid dogs is at least 1.

There's nothing on the first night,
There's nothing on the second night,
There's nothing on the third night,
There are several gunshots on the fourth night.
How many dogs were killed that night?
The (Supposed) Solution
Case with $N =2$, and $K = 1$
So let's say there are 2 people in the village. Premise 3 shows that there's at least 1 dog with rabies. Then during the first morning, the owner of the rabid dog will see the other dog without the disease. Therefore, the owner of the rabid dog will be able to conclude that his dog is rabid, and therefore will shoot the dog first night.
Case with $N = 3$, and $K = 2$
During the first morning, the owner of one rabid dog, say A, will see that one other dog with rabies, say B, and one healthy dog. A will conclude that if his dog is healthy, then by premise 3, B will be able to conclude that his dog has rabies and therefore will shoot the dog that night. However, because B does not shoot the dog that night, A will conclude that his dog has rabies. Therefore both A and B will shoot the dog during the second night.
Case with $N = 4$ and $K = 3$
The owner of one rabid dog, say A, will see that two other dogs with rabies. If his dog was indeed healthy, then from the previous case, the other two owners would shoot their dogs on the second night. However, the shots don't come. Therefore A can conclude that his dog is rabid, and therefore all rabid dog owners shoot their dogs on the third night.
So on and so forth, the answer to this puzzle would be 4 dogs were killed that night.
Some additional remarks

This strongly resembles the three logicians walking into the bar joke.
The total number of villagers actually don't matter.

The (Supposed) Problem with the Solution
Apparently there's a problem with this solution. When $K=4$, one rabid dog owner will see three other rabid dogs. From this observation, it is impossible to expect other three rabid dog owners to behave accordingly to predicate cases of $K=1,2,3$ because they ALL see three other dogs with rabies. Therefore, the problem is flawed and the shots will never come due to there being zero conclusive evidence to convince any owner of his dog's rabidity.
My Take
I actually don't really agree with the proposed problem to the solution because even if A sees that three other dogs to have rabies, if A were to assume that if his dog were healthy he can fully expect three other people to behave accordingly with the cases of fewer $K$s. But obviously, their behaviors will be different from those of expectation, so does he not have the basis to conclude that his dog is indeed rabid? I don't think the person who brought up the supposed problem with the solution realizes that the basis of this puzzle is from the presumption that each owner assumes that his own dog is healthy, and the contradictions that arise thenceforth.
Comment: The arguments of your fist case (N=2, K=1) are valid for arbitrary N
Answer: Your take is correct, an owner seeing $r$ dogs with rabies has to conclude $K\in\{r,r+1\}$ and if he had a healthy dog he would be watching events unfold as if $K=r$ and $r$ dogs would be shot on the $r$th night.


What percentage of data should I separate for validation?

Question: If I want to separate my data into training, validation and forecast, should the number of forecast and validation data be the same length?
Answer: In general, no. In the specific applications that I have in mind, the number of data points to forecast is often not more than a handful. Trying to discriminate between different models or tuning parameters on the basis of a few data points only will likely work very badly, so the validation period that I use is typically much larger than the one for "actual" forecasting. In your specific application, things may of course look a bit different, but there is at least no strong a priori argument why the validation and forecast period lengths should be the same.
An interesting related question is how to choose the split between training and validation sample. The soundest way to perform that split in a time series context is to compute the pseudo-out-of-sample performance of your methods for a range of split points and choose the one that performs best overall, see this paper and that paper.


user model password field default password field in django

Question: I've created a custom user model in my application. This user model is working fine, but there
are a couple of problems I have with it.

The change password link in the my register.html page doesn't work?
The default password box on the add/edit page for a user is a
little unfriendly.

Ideally, what I'd like is the two password fields
from the change password form on the add/edit user form in the admin,
which will automatically turn convert the entered password into a
valid encrypted password in Django.
This would make the admin system MUCH friendlier and much more suited
to my needs, as a fair number of user accounts will be created and
maintained manually in this app, and the person responsible for doing
so will likely be scared off at the sight of that admin field, or just
type a clear text password and wonder why it doesn't work.
Is this possible / How do I do this?
Answer: You can write your own view for editing user, or try to customize admin template for user.


cmos inverter basic

Question: I was reading from start the cmos inverter. I read inbetween the text that " load driving capability of cmos inverter is high.... as in when input is high(vdd) , the nmos can sink a relatively large load current"......how did they get to the intuition that it can sink relatively large load current? Is it because there is a low resistance path to ground at that time? how do you explain this intuition?
Comment: Erm, yes. NMOS has a lower Rdson than PMOS.
Comment: To be more precise: when comparing **similar size** transistors in the **same manufacturing technology**, the NMOS will have a lower Rdson than the equivalent PMOS. This is caused by the difference in mobility between electrons (NMOS) and holes (PMOS).
Comment: CMOS is complementary with N & P ch switches on all outputs. The RdsOn is fairly symmetrical so sourcing and syncing currents tend to be same on most chips. The RdsOn has migrated from each genration of logic families from >15V logic at ~300 Ohms, 5V HC logic near 50Ohms and ALC 3V logic near 25 Ohms
Comment: And these complementary outputs are made by making the PMOS transistors about 2 - 3 times larger (Wider) than the complementary NMOS transistor.
Comment: i was not trying to differenciate between pmos and nmos in my question.....all I am asking is how in BOTH nmos and pmos(whichever is on, based on input) can it souce/sink ( ya both) LARGE amount of current. How did this Large thing come into picture?
Comment: @Michael Chawla: are you talking about NMOS/PMOS **technolgy** or about NMOS/PMOS **transistors** in CMOS technology?
Answer: The inverter is the topology with the highest driving capability.
The current a transistor can sink or source depends on its gate-source voltage. In the case of an inverter the gate-source voltage is maximized. If the input is high, the gate voltage is Vdd, and the maximum gate-source voltage of  Vdd-Vss is obtained.
At the same time the gate-source voltage of the PMOS is zero because gate and source are at Vdd. Therefore the PMOS is completely turned off and the NMOS does not need to sink any additional current.
Making the PMOS about three times larger than the NMOS results in a sourcing capability that is about the same as the sinking capability. Again this is the most efficient configuration for the PMOS as well.
Class-D amplifiers for example make use of this fact and use a structure that is basically an inverter to drive the load to achieve a very high efficiency. In such applications, however, sometimes different topologies (e.g. two NMOS transistors) are used to achieve even higher performance. Of course this a very simplified view.

cmos inverter basic


smart contract token & 18 decimals

Question: When I'm working with 18 decimals. I have to convert the token inside of a function, for instance, one user want to transfer 20 token... I must operate that amount inside transfer function: amount*10^18? because I'm performing also transaction fees... And I don't know how to express the amount of fees: 1 or 1*10^18. The wallets always convert the amounts automatically when they see a global public variable decimals? Because I am doing tests on truffle, and when I´m working out transactions... the contract only send 50 tokens (not 50*10^18), so I have to perform web3.toWei in the entrance parameter.....
Answer: Try formating the user input (example 1 ETH) to WEI (1000000000000000000)
<code>var amount = $("#amounnttobuy").val();

var amount = new BigNumber(amount);
//convert from ETH/18 DECIMAL TOKEN to WEI
var amount = web3.toWei(amount, "ether")
</code>
Take time to read the web3.js documentation dear
https://github.com/ethereum/wiki/wiki/JavaScript-API
https://etherconverter.online/
Answer: Normally your contract will only handle tokens with full precision (with 18 decimals in your case). This simplifies the programming as you can assume all parameters are in the same units and you do not need to convert.
The conversion and formatting is done the frontend-ui, where the use can select to express the value in different units. For example same wallets allow to express amounts in miliethers instead of ethers.
The same has to be done when you require input parameters. The frontend allows the user to enter the amount of tokens, 0.1 for example, and it will convert to 0.1 * 10^18 when sending the transaction to the contract.

smart contract token & 18 decimals


Can ごめん, like English 'sorry,' be used to express condolences?

Question: The literal meaning of ごめん is, I know, approximately "forgiveness" in English. However, the vast majority of its usage (that I've seen) is more accurately translated as "I'm sorry," or "please forgive me."While I am aware of its literal usage and thus am pretty sure I already know the answer to this question, I wanted to ask to be certain: as 'sorry' can be used in English to express condolences as opposed to ask for forgiveness, can Japanese ごめん be used in the same way? For example, if one were to say in English "My house was broken into last night," "I'm sorry," would be considered a reasonable and appropriate response. "I'm sorry" in this case does not imply the speaker is responsible for the crime or feels guilt over it, simply that they regret the circumstances of the person to whom they are speaking. Thus, if someone were to say in Japanese "昨夜家に泥棒がはいった。" would "ごめんね。" be considered an appropriate response?
Comment: I'll leave it to others to post a fuller reply, but I did want to say that your 「昨夜家に泥棒がはいった。」→「ごめんね。」 dialog made me chuckle.  In short, ごめんね here makes it sound like the second person is directly apologizing for being the thief.
Comment: Related/duplicate: https://japanese.stackexchange.com/q/53037/9831
Answer: This question is very close to being a duplicate of the one that Chocolate posted in the comments, but that question is written by someone who already knows the answer to the specific question you are posing here.

I wanted to ask to be certain: as 'sorry' can be used in English to express condolences as opposed to ask for forgiveness, can Japanese ごめん be used in the same way?

No, it cannot. As a native English speaker I still have to stop myself from using it that way anyway despite knowing better, but ごめん along with other apologies (すまない、申し訳ない, etc.) simply don't take on that meaning in Japanese. Additionally, if you try and stick ごめん in places it clearly doesn't belong you may end up conveying something entirely different, as it's also used to describe situations you find highly undesirable or are sick of.
Appropriate ways to express this type of sympathy are covered here, in the answers to the question Chocolate linked to.
Answer: this is not a direct reply for your question, but to express condoleances, I think you use
ご愁傷さま
source
ご愁傷さま


What are the main contributions of Apple Inc. in the advancement of user interfaces in the last 10 years?

Question: I often hear people saying "apple has pushed forward the development of usable interfaces", "apple products are examples for great usability" and so on. My question is: is this a proven fact? And if so, can you tell me at least one distinguishing design concept used in iOS or OS X that justifies such statements?
Comment: @AnnaPrenzel what Apple has leveraged is a tight correlation between hardware and software interfaces. They go hand-in-hand.
Comment: ask Tog ;-) http://asktog.com/atc/the-third-user/
Comment: Why the restriction "in the last 10 years"?
Comment: I didn't want to hear something about the invention of the computer mouse but rather about the features of the software interfaces (iOS, OS X).
Answer: Historically, Apple (or rather, Jobs) has pushed the company towards selling user experience as a whole, rather than piecemeal as separate hardware and software. This has been especially true over the past decade or so where Jobs gave Jonathan Ive considerable power within the company to push their industrial design forward.
It's not always been a perfect marriage of hardware, software and users but if you judge the company based on success, I guess they've done OK.
Broadly speaking, things that Apple has pushed into the mainstream from a 'usable interface' point of view:

the GUI
the mouse
WYSIWYG print layout
laptops
handheld computing
touch UIs

And the list could go on. None of these are necessarily things Apple invented, but rather these are things Apple polished, packaged, and made appealing to a (relatively) broad audience.
In the end, is that Apple's doing or Steve Jobs? I don't know. It is known that Steve Jobs was a rather picky CEO who had veto power over nearly every decision within the organization. Jeff Bezos has a similar reputation. Based solely on the success of each of those companies, maybe that's a good strategy (that being having a strong leader who is focused strongly on user experience).
Comment: "In the end, is that Apple's doing or Steve Jobs?"  What is a company if not the people in it?
Comment: @GollyJer in the case of Apple, the debate was long about the 'person' in Apple rather than 'the people'. The jury is still out, but it does appear that Apple is going just fine sans Jobs, so you are likely correct.
Comment: What I mean is, in my opinion, it was definitely Steve Jobs and Jonathan Ive, and anyone else making design decisions at the company.  The output of any company is the people inside doing the work.


3D printers for ceramic clay?

Question: Are there any extruders and printers that do a good job with ceramic clay?
I assume the clay has to be fine grained and with enough water added to be able to be pushed out through the extruder's nozzle. I also assume the print speed would have to be arther low for the already printed layers to gain stability before printing the next layer. Perhaps some extra equipment on the printer to spped up this drying process?
At the same time, the print speed can't be too low: if the bottom starts to dry enough to start shrinking, the object will crack.
Also, some solutions I've seen tend to result in rather low resolution/thick layers, which is negative.
So, what equipment is "out there"?
Answer: What you are looking for is the Frostruder style extruders.
Here is a link to a thingiverse file for it.
You honestly cannot expect fantastic results but it will get the job done! There are many other types. Quality will depend on the size of the point. However with something as high viscosity as clay I would not expect you to be able to push the quality very high.
Comment: The Froststruder! lol This was one of my favorite attachments along with "The Unicorn"! Old-school MakerBot was pretty awesome...
Answer: Here is an open source clay extruder from standard parts, that i designed
https://www.stoneflower3d.com/projects/clay-extruder-prototype/
Different designs of 3D printers, pumps, extruders etc. for clay are posted and discussed in the Google Community "Make Your Own Ceramic 3D Printer", driven by Jonathan Keep (https://plus.google.com/u/0/communities/109375785524125994679).
Comment: That's a really cool design
Answer: I cant speak for the quality or type of clay, but there are several designs out there that print in clay. Here is the first one that popped up on my google search.
http://www.wasproject.it/w/en/wasp-launches-the-new-professional-clay-extruder/

3D printers for ceramic clay?


Oracle's Merge v. Select->Update/Insert

Question: What is the faster statement? A MERGE or Select->Update/Insert depending on if it returns a value?
I'm trying to optimize a database, but I haven't found any speed tests comparing the two.
I found the MERGE command through a StackOverflow answer
Answer: A MERGE would be more efficient since you're only executing the query once.  Even better would be to do a set-based MERGE rather than doing a bunch of single-row MERGE statements which is what I'm assuming you'd be implementing given the alternative of doing a SELECT to see if the row exists.
Rather than doing a SELECT and then determining whether to do an INSERT or an UPDATE, you would be better off doing the UPDATE, checking to see if you updated 0 rows or not, and then doing the INSERT if your UPDATE didn't affect any rows.  That way, source rows that require an UPDATE would be a bit more efficient and rows that require an INSERT would be essentially just as fast as if you had done a SELECT and INSERT.  This approach is still going to be slower than a MERGE, but it's better than doing the extra SELECT.
Answer: Merge is not working for CLOB. it is working only for small string values.
In the below sql : eai_msg, msg_req_text, msg_req_rply are all CLOB.
If I pass data like "something", it works.
It is not working for input of 1200+ char:
"merge into some_table  msg using (select 1 from DUAL) d "
      + "on (msg.corr_id= :correlationId) "
      + "when matched then "
      + "update set  msg.rptg_id = :rptgId, "
      + "eai_rcvd_date = :receivedDate, "
      + "msg.eai_msg_text = :msgText, "
      + "msg.msg_req_text = :request, "
      + "msg.msg_rply_text = :reply, "
      + "msg.eai_svc_name = :serviceName, "
      + "msg.eqmt_cnt = :eqmtCount "
      + "when not matched then "
      + "insert (RPTG_ID, EAI_RCVD_DATE, EAI_MSG_TEXT, MSG_REQ_TEXT, MSG_RPLY_TEXT, EAI_SVC_NAME, EQMT_CNT, CORR_ID,MSG_KEY) "
      + "values (:rptgId, :receivedDate, :msgText, :request,:reply,:serviceName, :eqmtCount, :correlationId,:msgKey)"

here is my save method in dao
  public int saveEaiData(final SaveOriginalEAIRequestDto saveOriginalEaiDto) {
    NCDateTime eaiReceivedDateTime = saveOriginalEaiDto.getEaiReceivedDateTime();
    MapSqlParameterSource paramMap = new MapSqlParameterSource();
    paramMap.addValue("msgKey", sequence.nextLongValue());
    paramMap.addValue("rptgId", saveOriginalEaiDto.getReportingId());
    if (eaiReceivedDateTime != null) {
      paramMap.addValue("receivedDate", eaiReceivedDateTime.getCalendarUTC());
    } else {
      paramMap.addValue("receivedDate", null);
    }
    paramMap.addValue("msgText", saveOriginalEaiDto.getEaiText(), Types.CLOB);
    paramMap.addValue("request", saveOriginalEaiDto.getRequestText(), Types.CLOB);
    paramMap.addValue("reply", saveOriginalEaiDto.getReplyText(), Types.CLOB);
    paramMap.addValue("serviceName", saveOriginalEaiDto.getEaiServiceName());
    paramMap.addValue("eqmtCount", saveOriginalEaiDto.getEquipmentCount());
    paramMap.addValue("correlationId", saveOriginalEaiDto.getCorrelationId());
    try {
      return getSimpleJdbcTemplate().update(MERGE_ORIGINAL_EAI_MSG_RECEIVED, paramMap);
    } catch (Exception e) {
      throw new IllegalStateException("Exception occured in saveEaiData" + e);
    }
  }

Oracle's Merge v. Select->Update/Insert


Which model should be chosen using AICc/BIC and P-value?

Question: I am using GLM for modeling the binary data. For the predictive variables I am using different number of Zernike Basis functions. To test how many Zernike basis functions I need, I am using AICc/BIC to choose the best model. For example, I use k={1,2,3,...,20} basis functions and AICc chooses the model which has k=5 basis functions, say X1,X2,X3,X4,X5. However, using GLM shows me that not all these 5 basis functions are significant, i.e., the p-value>0.05. For example the coefficients of X2 and X4 are not significant. What should I do now? In the end when I want to find one model for my data should I use the model which only has X1,X3,X5? or Should I not care about the p-value of the coefficients and include X1,X2,X3,X4,X5?
Comment: I am not familiar with Zernike Basis functions, but... Are the different numbers of the Zernike Basis functions your different explanatory variables (i.e. this is a multiple regression)? Or is the number of Zernike Basis functions your single explanatory variable, and the numbers are just the levels (values) of this single variable? If they are different levels, then it makes sense that not all levels are significantly different from the baseline (but the variable itself should be kept in the model, as suggested by AIC).
Comment: Each Zernike Basis function can be considered as one explanatory variable.
Answer: The AIC, the BIC and the $p$-values all address different questions. For feature selection (variable selection, model selection), only the former two are relevant. See e.g. Rob J. Hyndman's blog posts "Statistical tests for variable selection" and "Facts and fallacies of the AIC".
AIC is best suited for forecasting purposes as it targets maximization of the likelihood of a new observation from the same data generating process (under normality of errors, maximization of likelihood is equivalent to minimization of square loss). BIC is a consistent model selector and as such may be useful in finding which model among a given set is the true model (if the true model is in the set). So depending on your goal (prediction or identification of the data generating process), AIC or BIC may be relevant for you.
In this particular application I suspect that AIC is more relevant as the models you are considering probably are not thought to contain any true model among them.
Furthermore, model averaging as suggested by @Björn might be a good (better) alternative solution.
Comment: Thanks for your answer. Could you please tell me when I should use the p-value then?
Comment: $p$-values are used for hypotheses testing. However, model selection is a different task. The 5% significance level typically used in hypothesis tests is not a relevant level when forecasting; AIC-based selection kicks out variables at around 15% level (so you may notice that your variables are significant at 15% level but not necessarily 5% level). You may check older posts on model selection to find a more detailed explanation.
Comment: For the downvoter: I would appreciate some explanation what appears to be the problem.
Comment: @RichardHardy I saw the problem in the unquestioning acceptance of the OP's thinking that he actually should select a single model, if he is going to do prediction. Very rarely is that a sensible thing to do.
Comment: @Björn, that's fine, I agree model averaging can be better (edited the post to include this). +1 to you.
Answer: For a prediction situation AIC is more relevant than BIC or p-values. However, to pick a single model on the basis of any of these and then to analyze the data as if no model selection had been done, is likely inappropriate (unless one candidate model is so vastly better than the others as to remove all model uncertainty). Model averaging is usually more appropriate, if the goal is prediction.
Comment: I actually don't want to do prediction. My goal is mostly explanation of my data. In that case I guess BIC is better, though I cannot claim that the model is definitely among the models that I am using. In other words, because I am modeling the neural activities, the chance that the model is among those models that I have chosen is almost zero.
Comment: Also one more thing. When I am plotting the AIC or BIC as a function of different models the changes in the value of both of them are not much.  They are in the range of 600-650 and its in the favor of less complicated model. But since I'm using the surrogate data I know that the more complicated model gives me the correct one. Then how can I explain that with the higher AIC and BIC?
Comment: @Mina, BIC and AIC have their nice properties asymptotically. A particular finite sample might not be large enough for BIC to pick the true model.
Comment: @Richard, I have more than 1 million samples. Wouldn't that be enough?
Comment: @Mina, Oh, then it must be something else...
Comment: @Richard, The  models that I am using are nested models. Basically, each time I am adding one degree more to the Zernike basis function. Would that be still ok to use AIC/BIC for model selection of  nested models?
Comment: @Mina, nestedness is not a problem.


What is the probability distribution for the squared distance between random points in an $n$-dimensional hypercube?

Question: I choose random points $X,\,Y$ in $[0,\,1]^n$ (I assume all $2n$ Cartesian coordinates are $U(0,\,1)$ iids). What is the probability distribution of $\left\Vert X-Y\right\Vert _{2}^{2}$? Even the $n=1$ case requires some care, since if I first fix $X$ then $Y$ has a uniform distribution with extrema of opposite sign.
Comment: You ask about the sum of identically distributed independent variables (the $(X_i-Y_i)^2$, whose distribution is readily computed). The methods explained in the investigation at  https://stats.stackexchange.com/a/43075 will therefore be applicable to solving this problem. As that thread indicates, the result will be messy: to describe it with a formula typically requires $n$ separate expressions. Thus, it would help for you to indicate *in what form* you are looking for an answer as well as to tell us whether approximate solutions would be acceptable in your application, whatever it might be.
Comment: @whuber An approximate CDF will do.
Answer: For an approximate cdf, one possibility is the saddlepoint approximation. For that the mgf (moment generating function), or its logarithm, the cgf (cumulant generating function) is needed. For background see How does saddlepoint approximation work?.   So let $X_1, \dotsc, X_n, Y_1, \dotsc, Y_n$ be iid $\mathcal{U}(0,1)$. Then $D^2 = \sum_i (X_i-Y_i)^2$ have mgf
$$ \DeclareMathOperator{\E}{\mathbb{E}} \DeclareMathOperator{\P}{\mathbb{P}}
M_n(t)=M_{\sum_i (X_i-Y_i)^2}(t)=M_{(X_1-Y_1)^2}(t)^n=\left(\E e^{(X_1-Y_1)^2 t}\right)^n
$$ so the cgf is
$$
   K_n(t)=n\cdot \log\left\{ \E e^{(X_1-Y_1)^2 t} \right\}
$$ which in this case is defined for all real $t$.
Without going into details, and with some help from maple, we find that
$$
 \E e^{(X_1-Y_1)^2 t} = {\frac {\sqrt {\pi}{\rm erf} \left(\sqrt {-t}\right){t}^{2}+{{\rm e}^{
t}} \left( -t \right) ^{3/2}- \left( -t \right) ^{3/2}}{ \left( -t
 \right) ^{5/2}}}
$$  or alternatively
$$
 \E e^{(X_1-Y_1)^2 t} = {\frac {-2\,i{{\rm e}^{t}}{\it dawson} \left( i\sqrt {-t} \right) {t}^
{2}+{{\rm e}^{t}} \left( -t \right) ^{3/2}- \left( -t \right) ^{3/2}}{
 \left( -t \right) ^{5/2}}}
$$ but before using this numerically, more work will be needed to find a useful form.
I will come back later to add the resulting approximation.


Turn on gas wall heater w/o electric thermostat

Question: We are having a power outage in much of Los Angeles right now, big storm (02/17/17 3:55PM). I have a gas wall heater, pilot is lit, but no power to the wall thermostat. Can I turn on the unit manually to get heat?

Comment: Usually you need the power to activate the 24v system to open and close the gas valve solenoid(s). Unless you have a generator or some way to provide power to the gas valve, then no, there is no way.
Comment: What make and model is this heater?
Comment: It's a cottage with a wall heater. The thermostat is electric but there is no blower and the pilot light is on, gas is flowing. I don't think there is a "reset" on the wall thermostat. It's very simple-not digital.
Answer: Gas Empire-style wall heaters use millivolt thermostats.  They have two wires going to the thermostat, and if those wires are connected to each other, that is a "call for heat" and the heater should fire.
So, you have a system that requires AC power?  Either it's not an Empire-style millivolt system... or somebody's hacked it in some weird way, e.g. to use a Nest style thermostat.
If they hack it like that, they should connect the new relay/whatever/thing in parallel with the original thermostat, and leave that in place for just this contingency.
Northeasterners/Midwesterners: This type of system is nothing like anything you know.  It is a closely held secret by Floridians, Pacific Coasters, and the northeastern HVAC cartels, and at this point, my job is to convince you that it doesn't exist.  Furnaces that can work on gas alone, without electricity?  Absurd. Just ask your HVAC distributor.  These aren't the heaters you're looking for.  You can go about your business.  Move along.
Comment: How do I add photos to this post on my iPhone?
Comment: Native iPhone photos are too large.  Take the photo, email it to yourself which will create a much smaller version of the photo.  Then read the email and save the photo to Photos.  Then you can insert it in the usual way.
Comment: Yes, 2 wires to wall thermostat. Are you saying, at the heater to disconnect the two wires and join them together to fire the heater?
Comment: I would do it at the thermostat if feasible, that way you're sure you have the right two wires.
Comment: So, I disconnected the red wire and white wire from thermostat, connected them together and nothing. I checked at the heater to make sure these  same wires were connected at the heater-they are. Any other suggestions? And thank you for your attention to my problem.
Comment: If you're sure they are the same two wires, you could try connecting them at the furnace.
Comment: I've seen cases (like my own current house) where the millivolt system was "supplemented" with 24volts.  The problem with millivolt only systems is that if there is a long loop with a lot of resistance then it doesn't work.  Can you find where the wire from thermostat enters the heater?
Comment: The wires from thermostat are connected to the gas control valve (DEXEN 6003 NAT 3.5 WC max. 1/2 PSI). I disconnected them from the valve and touched them together-still nothing.
Comment: Touch the valve contacts together, not the wires that you disconnected from those terminals
Comment: Ok, used a 16g copper jumper contact-to-contact-I heard a distinctive "click" each time contact was made but still no firing of heater. Sounds like a bad valve maybe?
Comment: Sounds like you're doing everything right, and the heater is not firing for some reason.  Did it work when the power was on?
Comment: It did, though it seemed intermittent so I replaced the thermostat. That appeared to do the trick but then noticed it didn't seem to respond "on call." That was a few days ago. Power outage today was unexpected.
Comment: This is an older cottage built in '62--has been a bit of a fixer-upper. Lucky to find anything affordable in LA. Maybe a short in the wiring going to controller-b/c of intermittent function.
Comment: So, alas no heat. I think I'm gonna drink now. Thank you Tyson and Harper for your assistance. It's 60 degrees in here so I think I'm gonna live. ; )
Comment: Ha!! Power just came back on! The power co said it would be tomorrow afternoon. Thanks again, you galant knights of the exchange.
Answer: When you have time, do this to trouble shoot this heater. This gas valve is powered by a pilot generator. If you have a volt meter follow the 2 wires from the pilot to where they connect. check the output voltage on these wires. The voltage should be about 3/4 volts DC. If you get the 3/4 volts dc, disconnect the wires. Did the pilot go out?  If it did relight the pilot. this proves that the pilot generator is working. Next, if the gas valve does not click when the thermostat is turned up and down, put a jumper wire on the control circuit. If the gas valve clicks the problem is in the control circuit. You stated earlier that the gas valve clicked when you jumped out the control circuit. If the valve clicked but the gas did not light, you may have a spider web in the orfice of the gas input line at the burner. You will need to take out the burner remove the gas orfice from the gas pipe at the burner and clean it out. reassembly and retry the heater. Spiders in gas orfices are rare but they do happen. I know I have cleaned out a few. They crawl in when the heater is off for an extended period of time.
Comment: Wow. thanks for the thorough instructions d,george. Going to add this to my to-do list. The spider thing may be a possibility given this is Los Angeles and the heater is not often used. I'll check back in after I've done the troubleshooting.


How do you solve this circuit with the node voltage method?

Question: This question requires you to find the node voltage between nodes 1 & 2 as well as condense the circuit into its Thevenin Equivalent with R2 as the load. The correct answers are 4 V between nodes 1 & 2 and 36.5 V & 7.8 for Thevenin Voltage & Resistance respectively. Could someone please explain this to me? I'm especially confused as to why the Thevenin Voltage is higher than the source voltage. Thanks in advance.
Comment: Step 1 of the nodal method is to label your nodes. If you do that it will make it easier to discuss your  circuit.
Comment: But notice that you also have a constant current source in your circuit. And this current source will also provide a power. The voltage drop across R1 resistor is 5mA x 6.3kΩ = 31.5V
Comment: @G36 thanks for the feedback. Does KVL still apply to that circuit or not, and if so how? I'm struggling to reconcile the two ideas and I think that's where I'm confused.
Answer: Redraw the schematic so that the whole thing isn't quite so confusing. (Positive at the top, negative at the bottom, signal input at left, signal output at right. Don't bus power rails around -- it's confusing to do that.)

simulate this circuit – Schematic created using CircuitLab
Note that I've used the schematic editor that is available to you when you create a question here? You should use it, too.
You should be able to see where I got the \$-5\:\text{V}\$ node point. I've labeled all of the remaining possible nodes (ground and \$-5\:\text{V}\$ are already labeled, obviously.)
At this point, I can see that you really only need to do nodal analysis on \$V_X\$. The other nodes are almost certainly unimportant.
Also, you should be able to see that \$R_4\$ is completely irrelevant since the current source has \$\infty\$ impedance. You would be perfectly in your rights to simply remove it and everything "behind" the current source. The only thing that matters is what it injects into the \$V_X\$ node.

Some notes here, assuming you were NOT doing nodal analysis:

You should be able to see that \$R_2\$ and \$R_3\$ can be summed up into an equivalent resistor value.
You should be able to see that once (1) is complete, that you are left with a simple voltage divider made up of two resistors. You should be able to Thevenize this almost immediately into an equivalent voltage source and an equivalent series resistance from it.
Given the current source, this then means you can work out the voltage at \$V_X\$, almost trivially.

Of course, if you do the above all you've done is avoid the nodal analysis.

At this point, you really should be able to perform your nodal analysis. You can include a statement for both \$V_X\$ and \$V_Y\$ and solve them simultaneously. Or you can lump \$R_2\$ and \$R_3\$ and only write one equation for \$V_X\$. Which method you apply depends entirely on what you feel is more appropriate to your circumstances.
Comment: Thanks! I'm relatively new to circuits in general, so I'm a bit unfamiliar with the schematic you posted above. Once I get home from school I'll take a better look at it. In the meantime, which node is ground? Additionally, is converting circuits to its Thevenin equivalent the best way to analyze circuits, or does each method has its own merit?
Comment: @Qwerty Each method has its own merits. And it helps a lot to use all of them because it gives you various ways to "look" at something. The circuit you provided already has a ground shown. All I did was to retain it in my re-drawing of it. The two schematics are ***identical*** in every detail. One important thing you should learn to do, soon, is to ***remove*** wires that do nothing more than bus voltage rails around. These serve little purpose except to keep you from being able to focus on what is important. They distract. So learn to remove them. And stick with (+) on top, (-) on bottom.
Answer: . According to thevenin's theorem we can solve difficult circuit analysis.That is the reason we solve the above problem easily


How can I change or install screensavers?

Question: I want to change the default screen saver in Ubuntu 11.10/12.04. On 11.04 I just did a
sudo apt-get install xscreensaver-data-extra xscreensaver-screensaver-bsod

And then I could change it in the control center -> screen saver options.
Now there seems to be no other option to change the default screen saver.
Answer: Background
The Gnome 3 Devs dumped the old gnome-screensaver.  The replacement screensaver is just a blank screen.
The Canonical Devs thought it was a useful idea to continue and raised a blue-print for implementation in Oneiric.
A few ideas were raised such as a Compiz specific implementation or reusing a Lubuntu/Xubuntu screensaver implementation.
However, at the time of writing, no implementation has been started.
XScreenSaver
installation
Potential workaround - installing xscreensaver
sudo apt-get install xscreensaver xscreensaver-gl-extra xscreensaver-data-extra

Now remove gnome-screensaver
sudo apt-get remove gnome-screensaver

Now start the xscreensaver configuration tool - from a terminal:
xscreensaver-demo

or search from the Dash:

Click OK to both prompts asking to turn-off Gnome Daemon and to start xscreensaver-daemon respectively.

starting xscreensaver from login
Now to start the xscreensaver daemon on login you need to search in Dash for startup applications
Create a new entry running the command xscreensaver -nosplash
Locking the screen
If you want to manually lock the screen with the keyboard combination CTRL+ALT+L then you will need to run the following to repoint the old gnome-screensaver lock to xscreensaver
sudo ln -s /usr/bin/xscreensaver-command /usr/bin/gnome-screensaver-command

Logout or reboot for all changes to take effect.
Comment: I wish I could upvote this more than once....
Comment: This works great for me :) ... thanks for the help i now got the good old bsod again
Comment: For 14.10 this doesn't work :(
Comment: This works in 13.05. :)
Comment: I recommend also Really Slick Screen Savers sudo apt-get install rss-glx
Comment: What's the command name of the GUI on the screenshoot? `screensaver` says «command not found», and `xscreensaver` is just a command line tool.
Comment: This works but it even shows the screensaver when I watch a movie on the browser. I don't want that! What should I do to make it show screensaver only when I'm not having anything going on?
Answer:
Ubuntu 11.10 doesn't come with
  screensaver package installed. You must install xscreensaver if
  you want screensavers activated when your computer becomes idled.

sudo apt-get remove gnome-screensaver
sudo apt-get install xscreensaver xscreensaver-gl-extra xscreensaver-data-extra

Links

http://en.wikipedia.org/wiki/Screensaver
http://ubuntuforums.org/showthread.php?t=1860551
http://www.liberiangeek.net/2011/10/enable-screensavers-in-ubuntu-11-10-oneiric-ocelot/
http://www.liberiangeek.net/2011/10/enable-screensavers-in-ubuntu-11-10-oneiric-ocelot/

Disclaimer
Above method works in 11.10 ,i didn't tried in 12.04
Comment: Tried it on 12.04 and i works like a charm!!
Answer: Please take note that, for Ubuntu 12.04 and in order to be able to run several screensavers using images from the harddisk (e.g., Carousel, Gleidescope, GLSlideshow, Jigsaw, or XAnalogTV) , I had to install some additional packages.
These are:

libxss-dev
libxss1-dbg
libxss1
kdelibs-bin
kdelibs5-data
kdelibs5-plugin

Many others might get installed automatically together with the ones listed, particularly KDE libraries.
I found the instructions in this blog.
Answer: If you sudo apt-get remove gnome-screensaver but then sudo apt-get install rss-glx (see this Ubuntu Forums post and this one), the Really Slick Screensaver (GLX) effects will run on top of a screen that has not been blanked under Unity in Ubuntu 12.04 LTS, not just in xscreensaver-demo but also when the real screensaver kicks in.
Hence, a solution is required that does (even in the absence of gnome-screensaver) blank the screen prior to running the xscreensaver (which does work fine under LXDE for one thing).
Answer: There is no screensaver by default in Ubuntu. You can install xscreensaver from the archives.
I'm not entirely sure screensavers actually do save screens anymore, though I'm inclined to think they don't. But they do consume large amounts of energy that could be better used for other things.
Comment: They prevent image burn-in on LCDs. And the amount of energy consumed by CPU is less than what Flash applets in a browser consume during normal day.
Comment: Switching off a monitor is a more efficient way to save both energy and the screen, wouldn't you say? This wasn't always possible.
Comment: Indeed. Though, there's a corner case - I don't want to warm up the monitor every time I'm away for less than 10 minutes, but would like it to auto-lock my screen. Blank screen is still there in Gnome, and why not replacing it with some fun pictures.
Comment: It encourages people to not power down their monitors, is one answer.


How to create meetings on Outlook without it saving in your calendar

Question: How do you create a meeting in outlook without it going into your calendar when your just doing it on behalf of someone else?
Answer: If you are arranging a meeting on someone elses behalf, you should arrange to be able to raise meetings in their calendar rather than your own.
The person should share their calendar with "Create Items" permissions. They can right-click on their calendar and choose "Properties", then go to the Permissions tab. They should add you and choose the appropriate permissions.
Once done, you will be able to open their calendar and create new meetings. Meeting invites will go out from your email but will be marked "on behalf of ....". The meeting will only show up in the other persons calendar unless you include yourself as an attendee.


-half resolved- Bamboo Pad not working in Ubuntu 15.04

Question: I got a Bamboo Pad graphic tablet, which does not work.
I'm running standard Ubuntu 15.04 on a Lenovo Yoga 2 pro.
I tried updating grub and other tips given here which seem to work in 14.10, but do not seem to work in 15.04 (someone else had the same problem).
Here is the result of lsusb:
Bus 001 Device 008: ID 056a:0318 Wacom Co., Ltd

Comment: You can give a shot at a new driver --- http://askubuntu.com/a/601691/16395 (but I really do not know if it will work).
Answer: Ok, I got halfway there. Thank you all for your responsiveness.

using the usbhid.quirks trick did not change anything. This trick used to work in 14.10. It does not appear to work in 15.04
updating kernel to 4 made my pad work. I used the following method to upgrade

Now only the stylus input work. The finger input does not, neither the bottom button. Adding the MatchIsTablet "on" did not solve this.
edit: when I run dmesg | grep -i wacom
here is what I get
 [    1.457401] usb 1-2: Manufacturer: Wacom Co.,Ltd.
    [    2.813078] input: Wacom HID Pen as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:056A:0318.0006/input/input13
    [    2.813174] wacom 0003:056A:0318.0006: hidraw1: USB HID v1.10 Device [Wacom Co.,Ltd. Bamboo Pad, USB] on usb-0000:00:14.0-2/input0
    [    2.813304] input: Wacom HID Pen as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:056A:0318.0007/input/input15
    [    2.813393] wacom 0003:056A:0318.0007: hidraw2: USB HID v1.10 Device [Wacom Co.,Ltd. Bamboo Pad, USB] on usb-0000:00:14.0-2/input1
    [    2.813545] input: Wacom HID Pen as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/0003:056A:0318.0008/input/input17
    [    2.813602] wacom 0003:056A:0318.0008: hidraw3: USB HID v1.10 Mouse [Wacom Co.,Ltd. Bamboo Pad, USB] on usb-0000:00:14.0-2/input2

So a mouse is detected, additionally to two pens. How do I configure it to work?
Answer: There is a bug (you can access it here) that seems to describe your issue. Although it's a little bit old, the solution should still work.
From the #38 reply:

Got it perfectly running, now someone can help to get it fixed for all
  by default. So the steps are:

Add usbhid.quirks=0x056a:0x0319:0x40000000 to the grub boot cmdline(/etc/default/grub). Now the tablet is already working with
  wacom driver but automatically assigned wacom driver doesn't support
  touchpad and it's keyboard part
I have added to 50-wacom.conf (/usr/share/X11/xorg.conf.d/) the line
 MatchIsTablet "on"

in the first section after
     MatchProduct "Wacom|WACOM|Hanwang|PTK-540WL|ISD-V4"

This way evdev works for keyboard and pad parts of the device and
  wacom only for tablet
Everything works, including three-finger swipes(which are sent by
  keyboard driver as Alt-Left,
  Alt-Right, Super etc) and pressure
  sensitivity of pen! There must be a better way to match Bamboo Pad
  without breaking the generic wacom file but I have no experience of
  doing that, still I will try later if no one else does it faster.
For the wired edition replace 0x0319 with 0x0318 in the grub
  cmdline


How to create Event Visualforce page

Question: How to create a Activity event(Sobject) vf page without the duration and time field. Because these fields are required one i don't need these on my page.so can we do it without these fields. If so can anyone provide me with some sample.
Comment: Unclear question, what do you want to achieve? Do you want the VF page to set some default values for your two required fields upon sobject creation? Do you want to replace the standard view-layout of an object with a VF page that hides certain fields?
Comment: i created a vf page with some custom field in it from Event object but i didnt place DurationInMinutes and ActivityDateTime fields in this page because i dont need these field to my requirement when im trying to save the record im getting error msg                                                                                REQUIRED_FIELD_MISSING, Required fields are missing: [Duration]: [Duration]
Answer: A Salesforce Event happens at a particular time and date, and has a duration in minutes. If you set the Start Datetime and Duration, the End Datetime will be filled in, and if you set Start and End, Duration will be filled in. However, you can't create an Event without specifying this information in some way. If you don't want to display it on the page, you could write a custom controller extension that sets these values "behind the scenes".
However, I don't understand why you would create an Event that doesn't happen at a particular time, so it may be that I'm missing something.
Comment: i created a date custom field and for time i created a picklist. I'm placing these custom field on vf page. so i dont need those Standard fields as u said can you  plz provied me the sample with controller extension to set values behind
Comment: I see, you need to convert between the custom field and the standard datetime field. I suggest you give it a try writing a controller extension based on the Event standard controller. If you have trouble with the extension, post your code here with a new question and we'll help as we can.

How to create Event Visualforce page


First release of OSS project

Question: How do you decide the right time for the first-release of an OSS project ? Any insight on this would be very helpful.
Comment: Is this a corporate thing (group of paid devs have been working on this for a while, and are thinking of throwing it over the wall) or a personal itch-scratching project ("me and my cat want a better mouse interface")?
Comment: What is a "release" exactly? Announcing in your README file in GitHub? Tagging and making a release on GitHub?
Comment: :-) In this case, it is the former, an organization building something and now looking at seeing what can be done with the project. But any insights on the the later also would be most welcome. Thank you.
Comment: By release I was referring to tagging and making a release on GitHub.
Answer: The wikipedia page "Release early, release often" (quoted below) explains this adequately, based on the 25 year old essay "The Cathedral and the Bazaar" by Eric S. Raymond, that discussed good open source software engineering methodology (the "Bazaar").

Release early, release often (also known as ship early, ship often, or
time-based releases, and sometimes abbreviated RERO) is a software
development philosophy that emphasizes the importance of early and
frequent releases in creating a tight feedback loop between developers
and testers or users, contrary to a feature-based release strategy.
Advocates argue that this allows the software development to progress
faster, enables the user to help define what the software will become,
better conforms to the users' requirements for the software, and
ultimately results in higher quality software. The development
philosophy attempts to eliminate the risk of creating software that no
one will use.
This philosophy was popularized by Eric S. Raymond in his 1997 essay
The Cathedral and the Bazaar, where Raymond stated "Release early.
Release often. And listen to your customers".
This philosophy was originally applied to the development of the Linux
kernel and other open-source software, but has also been applied to
closed source, commercial software development.
The alternative to the release early, release often philosophy is
aiming to provide only polished, bug-free releases. Advocates of RERO
question that this would in fact result in higher-quality releases.

First release of OSS project


Measuring correlation of trained neural networks

Question: I am training an artificial neural network (backpropagation, feed-forward) with non-normal distributed data. Beside the root mean squared error, literature does often suggest the Pearson correlation coefficient for evaluating the quality of the trained net. But, is the Pearson correlation coefficient reasonable, if the training data is not normally distributed? Would it not be more reasonable, to use a rank-based correlation measure, e.g. Spearman rho?
Comment: Can you elaborate on how exactly one would use it or give a reference?
Answer: The Pearson correlation coefficient measures linear association.  Being based on empirical second central moments, it is influenced by extreme values.  Therefore:

Evidence of nonlinearity in a scatterplot of actual-vs-predicted values would suggest using an alternative such as the rank correlation (Spearman) coefficient;

If the relationship looks monotonic on average (as in the upper row of the illustration), a rank correlation coefficient will be effective;
Otherwise, the relationship is curvilinear (as in some examples from the lower row of the illustration, such as the leftmost or the middle u-shaped one) and likely any measure of correlation will be an inadequate description; using a rank correlation coefficient won't fix this.

The presence of outlying data in the scatterplot indicates the Pearson correlation coefficient may be overstating the strength of the linear relationship.  It might or might not be correct; use it with due caution.  The rank correlation coefficient might or might not be better, depending on how trustworthy the outlying values are.

(Image copied from the Wikipedia article on Pearson product-moment correlation coefficient.)
Comment: Can you give some sources for your statement about using rank correlation to measure regression performance?


How can I Automate MongoDB schema design from existing MySQL Database and Logs?

Question: I am working on the project which will automatically generate sample MongoDB schema analyzing existing MySQL database and logs. I am looking for help regarding the below questions. Please, share your thoughts,some links or references.
1) What are the MySQL parameters which can help me to automate the process?
2) What are the criteria to design the idle MongoDB database? What I should keep in mind while designing MongoDB database? Example MongoDB schema for any MySQL database would be great help.
3) How denormalizing the database will help?
4) Is there any existing opensource application/tool which can help automation process?
Answer: I would not recommend doing automatic migrations from any relational databases (or other that differs in logic) to MongoDB. Of course it can be done, but the database performance might not be (and will most probably not be) good.
Now, answering your questions directly:
1) what do you mean by MySQL parameters?
2) Check the official docs page about the topic: Data Modeling in MongoDB
3) This question has already been answered in StackOverflow - Embed vs Reference.
Nevertheless, here is where automatic migration rules will most probably fail. You need to decide this based on your use cases and necessities. Also, be aware that mongoDB doesn't support joins (meaning you will have to do it manually on the client side).
4) Only know MongoHub - it has an import/export tool that supports mysql


SOQL Count() limits

Question: Summer '18 changed Count() impact on query row limit from "number of records matched" to 1.
Is there still some form of a limit, like selectivity criteria related limits, or can an arbitrary number of records be counted?
Answer: We have found that COUNT queries can still face limits in the form of exceeding CPU limits in the transaction, and I believe this is actually caused when the WHERE clause for the SOQL query requires significant filter-related processing against unindexed columns.
This help page discusses "selectivity":

For best performance, SOQL queries must be selective, particularly for queries inside triggers. To avoid long execution times, the system can terminate nonselective SOQL queries. Developers receive an error message when a non-selective query in a trigger executes against an object that contains more than 200,000 records. To avoid this error, ensure that the query is selective.

It goes on to say:

A query is selective when one of the query filters is on an indexed field and the query filter reduces the resulting number of rows below a system-defined threshold. The performance of the SOQL query improves when two or more filters used in the WHERE clause meet the mentioned conditions.

Even then, the platform doesn't always terminate the query and you face CPU limits being exceeded instead of the selectivity exception. I have a hunch this happens when the platform is forced to perform some post-query, in-memory filtering to fully apply all the conditions in the WHERE clause.

SOQL Count() limits


When should I use "parallel" over "parallelism", and vice versa?

Question: I am a bit confused about the words parallel and parallelism: When and where should one use which?
Answer: First of all, consider the grammatical class they belong to in order to understand usage better:

Parallel is an adjective (see below, if I edit it further, I need to change it too much), a noun (see for example each of the imaginary parallel circles of constant latitude on the earth's surface) or even a verb (be side by side with something extending in a line).

When it's an adjective, as you may already know, it's used to classify objects that put side by side have the same distance continuously everywhere.
But it has also other meanings: about Computing, for example, it means "involving the simultaneous performance of operations". It can be also related to Music or Grammar.

Parallesism is a noun and its adjective form is Parallelistic.

As F'x said, it means: "the state of being parallel or of corresponding in some way." Also in this case it can refer to other fields, such as computing or poetry.
Comment: @Kejia柯嘉: no prob! :)
Answer:
A parallel is synonymous with either: "an analog" (or "an equivalent"), "a similarity" or "a comparison".
Parallelism is the state of being parallel, or (in grammar or literature) the use of successive constructions with the same grammatical structure, or (in computer science) the use of parallel processing.

So, if you're discussing mathematics, computer science or literature, odds are you want parallelism. For everything else, parallel is more likely what you need.


I can't seem to break any blocks while in sneak mode

Question: I'm using a Macbook and have already tried to use a different mouse, but got the same outcome. I've also tried changing the Game mode and still the same outcome occurs. For some reason, my left click just switches to place. This happens to every type of block as well.
Comment: What else have you tried? Have you accidentally rebound the keys?
Comment: How about your right click? Does it place blocks as well?
Answer: Just a guess, but have you rebound your Sneak button from Shift to Control?
In MacOS, Control+click is translated to right-click so, if Control is your sneak button, anytime you're sneaking all your clicks will become right-clicks.
Answer: I'm unsure about macbooks and how they work, however may I suggest rebooting your computer, and making sure you are not using any snapshots. If you continue to see this problem, make some backups for your worlds to be on the safe side.


Were Pandavas non-vegetarians?

Question: We know that the Pandavas were Kshatriyas. Were they consuming non-vegetarian food?
Comment: I think yes. When they were in exile period or hiding in jungle after Lakshyagraha incident, there were some verses indicating that Yudisthir was missing some animals flesh. It could be during their stay with Hidimba also that they ate flesh.
Comment: Yes they did. Pandavas where kshyatriyas, they where allowed to hunt and eat it. During the war of Mahabharata many hunters where hired so that bhima would get all the meat possible. Earlier there was also the tradition of Bali. The meat was used as prasad.
Comment: @AshokKumar Yeah, you're right.  See my answer.
Comment: There's already a question re: Krishna: [Was Krishna a non-vegetarian?](http://hinduism.stackexchange.com/q/7662/2995)...so you should edit the question and remove the part about Krishna.
Comment: @sv. See now you make sense.
Answer: Yes, the Pandavas did eat meat.  In this chapter of the Vana Parva of the Mahabharata, Yudishthira tells his brothers that they should leave the Dwaita forest because they've been eating all the deer there, so out of compassion for the deer they move to the Kamyaka woods:

Once on a time, as Yudhishthira lay down at night in the Dwaita woods, some deer, with accents choked in tears, presented themselves before him in his dreams. To them standing with joined hands, their bodies trembling all over that foremost of monarchs said, 'Tell me what ye wish to say. Who are ye? And what do ye desire?' Thus accosted by Kunti's son--the illustrious Pandava, those deer, the remnant of those that had been slaughtered, replied unto him, saying, 'We are, O Bharata, those deer that are still alive after them that had been slaughtered. We shall be exterminated totally. Therefore, do thou change thy residence. O mighty king, all thy brothers are heroes, conversant with weapons; they have thinned the ranks of the rangers of the forest. We few--the remnants,--O mighty-minded one, remain like seed. By thy favour, O king of kings, let us increase.' Seeing these deer, which remained like seed after the rest had been destroyed trembling and afflicted with fear, Yudhishthira the just was greatly affected with grief. And the king, intent on the welfare of all creatures, said unto them, 'So be it. I shall act as ye have said.' Awaking after such a vision, that excellent king, moved by pity towards the deer, thus spake unto his brothers assembled there, 'Those deer that are alive after them that have been slaughtered, accosted me at night, after I had awakened, saying, 'We remain like the cues of our lines. Blest be thou! Do thou have compassion on us.' And they have spoken truly. We ought to feel pity for the dwellers of the forest. We have been feeding on them for a year together and eight months. Let us, therefore, again (repair) to the romantic Kamyakas, that best of forests abounding in wild animals, situated at the head of the desert, near lake Trinavindu. And there let us pleasantly pass the rest of our time.'
Comment: @user3547 Thanks!  No, Kshatriyas are permitted to hunt and eat animals.  But if the Pandavas had decided to not eat meat, they would accumulated good karma; the Manu Smriti says abstaining from meat gives you as much Punya as performing 100 Ashwamedha Yagnas.  Plus it's compassionate to animals (which was Yudishthira's motive in leaving the forest), and vegetarian food gives you better gunas which can make you a better person.  So there are many excellent reasons to be a vegetarian.
Comment: @ChinmaySarupria But we don't need to rely on the example of Buddha.  Rama eats meat in the Ramayana.
Comment: @ChinmaySarupria Kalki kills Buddhists at the end of Kaliyuga ( not sure some or all: there may be only few Buddhists at the end of Kali Yuga) and grants them all Moksha. So the mistakes done by Buddha will be rectified by Kalki.
Comment: This should be the accepted answer
Comment: @ChinmaySarupria Eating meat isn't a sin for Kshariyas, I was just outlining various benefits that can be obtained by abstaining from meat.  In any case, we shouldn't judge things by the actions of Buddha, since Vishnu specifically incarnated as Buddha in order to deceive people.
Comment: Would the Pandavas be accumulating bad karma if they killed deer?
Comment: If eating meat is a sin then why did Buddha, incarnation of Vishnu, eat meat?
Comment: @KeshavSrinivasan He may have incarnated to deceive people but still those who follow him are able to attain Moksha so people may have got deceived but they are able to realize the highest truth.
Comment: @ChinmaySarupria Well, I don't think Buddhism leads to Moksha, but as we've discussed before we have a difference of opinion concerning our view of other religions.
Comment: OP also asks _Was Krishna a Non-Vegetarian too?_...is there a mention in Mahabharata for Krishna as well? There's already a separate question for that though: [Was Krishna a non-vegetarian?](http://hinduism.stackexchange.com/q/7662/2995)...so maybe we can edit this question and remove the part about the Krishna.
Comment: @sv. OK, I edited it.
Comment: During those time the first three varnas including Kshtriyas wore the Yajñopavita. If I'm not wrong, those who wear the sacred thread are prohibited from consuming meat?
Comment: @Naveen No, there's no general prohibition on those wearing the sacred thread eating meat.  There is a prohibition on wearers of the sacred thread eating the meat of five-nailed animals, though: see my answer here: http://hinduism.stackexchange.com/a/8687/36
Comment: @KeshavSrinivasan do you have some article about Vishnu incarnating as Buddha to deceive people?
Comment: @aitchnyu Yes, see this chapter of the Vishnu Purana: http://www.sacred-texts.com/hin/vp/vp092.htm
Answer: In India actually meat was prohibited for a civilized person, here uncivilized means people who does not belong to the society, mostly who resides in forests (tribes). you can find following lines on Wikipedia about it:

The fiend who smears himself with flesh of cattle, with flesh of
  horses and of human bodies,
  Who steals the milch-cow's milk away, O Agni,—tear off the heads of such with fiery fury.
The cow gives milk each year, O Man-regarder let not the Yātudhāna ever taste it.
If one would glut him with the biesting, Agni, pierce with thy flame his vitals as he meets thee.
Let the fiends drink the poison of the cattle; may Aditi cast off the evildoers.
May the God Savitar give them up to ruin, and be their share of plants and herbs denied them.
Agni, from days of old thou slayest demons never shall Rākṣasas in fight o'ercome thee.
Burn up the foolish ones, the flesh-devourers let none of them escape thine heavenly arrow.

— Rig Veda (10.87.16-19)
That means no one was allowed to eat meat and its kind of a sin. Surely Mahabharata time period is much before that so i don't think Pandavas ever eaten meat or something, and during there vanvaas they live like Brahmins so there is no question of meat there. Here is the link from wikipedia.
Comment: -1: Your quote from Rig Veda seems to be about Rakshasas (Rākṣasas), flesh-devourers. How does it apply to Pandavas and Krishna and how it does answer OP's question? Also, look at [this answer](http://hinduism.stackexchange.com/a/7097/2995) to [Was Lord Rama a non-vegetarian?](http://hinduism.stackexchange.com/q/2002/2995)
Answer: It depends on how you define a "non-vegetarian".
If you define non-vegetarian as a person who eats captive-bred meat (today's scenario), then answer is No. pAndavas were not non-vegetarian because they did not eat this kind of meat. The reason is because as per mahAbhArata anushasanaparva CXV captive-bred meat is sinful for all dvijas (brahman, kshatriya and vaishya):

He who permits (the slaughter of an animal), he who cuts it up, he who kills it, he who buys or sells (meat), he who cooks it, he who serves it up, and he who eats it, (must all be considered as) the slayers (of the animal).
One should never eat, O chief of Bharata's race, like a Rakshasa, any meat that has been obtained by means not sanctioned by the ordinance.

One source of meat which was sanctioned by ordinance for practicing-kshatriyas was that obtained by hunting of wild animals i.e. venison-game as mentioned in anushasana parva Chapter CXVI of mahAbhArata:

Listen to me as I tell thee what the ordinance is that has been laid down for the Kshatriyas. They do not incur any fault by eating flesh that has been acquired by expenditure of prowess. All deer of the wilderness were dedicated to the deities and the Pitris in days of old, O king, by Agastya. Hence, the hunting of deer is not censured. There can be no hunting without risk of one's own life. There is equality of risk between the slayer and the slain. Either the animal is killed or it kills the hunter. Hence, O Bharata, even royal sages betake themselves to the practice of hunting. By such conduct they do not become stained with sin. Indeed, the practice is not regarded as sinful.

pAndavas consumed venison-game which is fundamentally different from modern day captive-bred meat as seen in mahAbhArata vana parva L :

"Those bulls among men, collecting the produce of the wilderness and hunting the deer with pure arrows,
And hunting with arrows Rurus and the black deer and other kinds of clean animals of the wilderness,
And the king himself wending towards the east, and Bhima, towards the south, and the twins, towards the west and the north, daily hunted with bow in hand the deer of the forest, for the sake of venison.

The diet of pAndavas thus comprised of (veg + venison/game) as opposed to diet of modern day non-vegetarians which comprises of (veg + captive-bred meat).
pAndavas in today's world would thus be vegetarian due to prohibitions on hunting.

Were Pandavas non-vegetarians?


JPG file is more grey than file in Photoshop

Question: Hi I'm new to this forum and I have a question. I am a fashion design student and at the moment I am retouching some pictures from a photoshoot. I like the colors I have in Photoshop but when I save it as a JPG somehow it all turns a little flat and grey, instead of the lively colors it is supposed to have. I have made a screenshot of both pictures, you can see it here:
Photoshop is set to RGB mode and I am saving it as the highest quality JPG. I really hope someone knows why this could happen, because unfortunately Google hasn't given me any answers. Thanks in advance :)!
Answer: The exported file needs to be converted to sRGB either before exporting or during the export if you are using "Save for Web" option. If you are using that option you will see Convert to sRGB with a check box next to it, put a check mark there and then save it. If you are simply saving it as JPEG, then before saving it:

Go to Edit/Convert to Profile
Choose for the destination profile sRGB
Click OK

You will not see anything noticeable in Photoshop but when you save the image it will have the right color space for viewing anywhere. By the way, if you normally work in 16-bit mode, you should also convert it to 8-bit before converting the profile


Joystick's pad is moving mouse cursor

Question: I have got a pad with 2 analog pads. If I move first one (on the left side) it moves mouse cursor that returns into center of screen. The second one does nothing but moving pad into the right side teleports mouse into the center. This is very annoying especially when I want to play games. I use ubuntu 16.04 if this info is needed
Answer: Have you checked driver compatibility with your gamepad?
If you are looking for a temporary fix, use the following code:
sudo modprobe -r psmouse
This will disable input to your screen cursor. To turn it back on, enter this :
sudo modprobe psmouse proto=imps

Joystick's pad is moving mouse cursor


Does bank interest paid offset interest received?

Question: I'm gathering information for my US income taxes.  I received $100 in interest on my savings account.  However, I also paid $100 in interest on my overdraft line of credit.  Do they cancel out such that I report $0 interest income?
Comment: Do *you* (not your business - **you**) ever -- have you ever -- deducted interest expenses on your tax return?
Comment: Sure, mortgage interest.
Answer: No - interest expense is reported separately form interest income. One reason is that interest expense is an itemized deduction, so you could have interest income that is taxable, but not deduct any interest expense if you don't itemize because the standard deduction is more than your total itemized deductions.
Also note some interest expenses such as interest paid on a credit card or line of credit (other then possibly a HELOC) are not deductible anyways. So your interest expense may not even be deductible.


Search non-direct messages in slack

Question: In slack, can I search messages in public/private channels only? I would like to exclude direct messages to me from the search because I know I have already read them. I am interested in finding information about a topic I may have missed in channels.
Answer: One can use:
<code>-is:dm SEARCH_QUERY
</code>
E.g. to list the non-direct messages that I sent in Slack:
<code>-is:dm from:me
</code>
<code>-</code> is the negative search operand.

Search non-direct messages in slack


Typo: "对" read "代"

Question: 第18章 第二具尸骨的身份 https://www.vodtw.com/book/6042/chapter/5020723.html: 1st line of 3rd paragraph contains the following phrase:我不该对替她隐瞒, some users hold the view that 对 may be a typing error, in fact that 代 would make better sense, see e.g. BKRS: 代替: "instead", e.g. 代替他写了信
Answer: 我不该对替她隐瞒 is ungrammatical
Depending on the context, the correct sentence should be either 我不该对她隐瞒 (I shouldn't hide the fact from her) or 我不该替她隐瞒 (I shouldn't hide the fact for her)
Also, 对 is not a typo of 代 because the sentence "我不该代替她隐瞒" (I shouldn't hide it in her stead) is illogical. As if she didn't have to hide something from people because you would hide it in her stead. The problem is that "she didn't need to hide it" implies she is disclosing it.
Edit:
Based on the context, the correct sentence is 我不该替她隐瞒
我不该对替她隐瞒 is a typing mistake
Comment: phrase follows 我当初就该和警方说的,i.e. 我不该对替她隐瞒  some users wonder whether possibly "not talking to the police" may mean hiding the facts from the police and thus favoring her, i.e. "instead of her" in the sense of "helping her"
Comment: i.e., 我不该替她隐瞒  would make good sense because of context, users still wonder how to explain the appearance of 对, that is the question is, how could such an error possibly arise
Comment: such an error possibly arises when the typer typed 我不该对她隐瞒 and realizes it should be 我不该替她隐瞒. He should have highlighted 对 and typed 替 over it . Maybe due to a bad mouse move, he ended up adding 替 after 对 instead. And the sentence became 我不该对替她隐瞒
Comment: The most common method of typing seems to use the Wubizixing keyboard and the codes for 对 and 代 respectively are cf and wa which seems to suggest to some users that mistyping one for the other may be very unlikely.
Answer: Please read Tang's answer. My answer does not have much new value.
In Chinese, there is no composite word "对替".
People would not say 我不该代替她隐瞒. Instead, people would say (a) 我不该替她隐瞒; and (b) 我不该对她隐瞒. But (a) is different from (b) in meaning.
(a) 我不该替她隐瞒. - I should not hide her wrongdoing in the benefit of her. (for her).
(b) 我不该对她隐瞒. - I should not hide what I did (or the things that I knew) from her. (not telling her when facing her, or in front of her)
From your link, I think the contents would be like this, 我当初就该和警察说实话的. 我不应该对警察撒谎, 替她隐瞒她的行为.
替她隐瞒 = 为她隐瞒 (for her). You cannot use 代替 (substitute her position) in this sentence.
代替 means completely substituting a person or the role of he or she. For example,
她今天没来上班, 我代替她收银. - She did not come to work, therefore I will be in her position as the cashier.
You can simply say 今天我替她收银.
By the way, when you say 我代替他写了信, that can be ambiguous because it can be interpreted as,
(1) I wrote the letter for him because he is illiterate. (or he has no time to write.) 我替他写了信
(2) I wrote the letter without his knowledge. (This is rare though)
Comment: Is this a criticism of BKRS? Being ambiguous in the sense that there could be different reasons for writing the letter does not seem to detract from the validity of BKRS's example of the use of 代替.
Comment: 代替他写了信 is ambiguous, it could mean "impersonated him and wrote the letter" or "take up his duty of writing the letter"
Comment: Similarly, 代替她隐瞒 could mean "substitute her identity and hide the fact" or" take up her duty of hiding the fact" . Neither makes sense in this context
Answer: In the story, the lead character feels betrayed after hiding the fact from the police "for" a person/the wrong-doer who has later turned against him/her. In this case, the sentence "我不该替她隐瞒 - I shouldn't lie/hide the fact for her)" is anticipated/correct.
However, if the story-line changes to that the wrong-doer at first denied the fact but later confessed to the police, after the lead character committed perjury in her favor, the sentence "我不该代替她隐瞒 - I shouldn't instead hide the fact to the police for her" is then correct.
In any case, the sentence "我不该对替她隐瞒" is wrong, as there is no such word - "对替" in Chinese. However, note that "我不该对她隐瞒 - I shouldn't hide from/lied to her" is a valid sentence, but it does not fit well with the story.

Typo: "对" read "代"


Grep versus spotlight on mac

Question: I'm a newly minted CS major and I have been wondering what the benefits of using grep versus spotlight on mac. I ran a command to search for a specific file because I lost track of which directory it is in, which took a while, but when I did it in spotlight the result was instantaneous. I enjoy using the command line and it makes my life much simpler than the UI directory view on mac, so I would like to learn how to use it to its full potential.
Comment: Are you only concerned about using `grep` to find files on your filesystem?  In which case it's probably not the best tool to use, `find` would be a lot better.  However it's likely taking a while because of all the `permission denied` errors it has to get when searching the entire filesystem.  Not sure if there is an easy way to resolve that without building a search function that ignores those directories.
Comment: Yes I did find a use of the find method, which I ran and it went for a number of seconds without producing a result. I was surprised by the time but I'm guessing it doesn't use an algorithm that ignores directories that have nothing to do with your file.
Comment: Again, I'm pretty new to this stuff, but graph traversal algorithms and complexity interest me. So the fact that it's slower than spotlight at that particular form of searching makes me so interested in how they actually work!
Answer: Quick comparisons
Iterative
grep is usually to search file contents for matching patterns. Think searching file contents. grep will have to manually walk the file system from a given starting point.
I am curious how you were using grep.
find is the standard *nix command to search your file system for a file. Check out the man page, it has lots of ways to use it. But basically, it walks your file system from a given starting point and looks for matches.
Indexed
spotlight is an OSX utility that searches an indexed list of files. spotlight relies on an index and thus is capable of very fast lookups as it is not manually iterating over the file system. Usually a worker thread does that to build the index.
The tradeoff with spotlight is that if the file has not been indexed, then spotlight will not find it, even if it exists. However, if the directory has been indexed, then spotlight has good performance.
Others
If you are needing to search for file contents and are using version control, say on a development project, ag silver_searcher is a much faster alternative to grep. It works within version control scenarios and respects your list of ignored file types to find files containing a pattern
Comment: I think I used a command that had used find along with grep for a regex pattern to match the file I was looking for. Thanks so muchf or this information!
Comment: Find can also grep for regex patterns.  You can use it like this:  `find / -type [f/d] -name [string]`
Answer: As a possible solution for you;  OS X also has a locate command that utilizes indexing to find files. That is probably your best bet of seeing the same search performance on the cli that you see in spotlight.  In order to setup your database you must run the command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
Once your database has been created you can use:
locate <file>

Grep versus spotlight on mac


How can I use OpenStreetMap in my Compact Framework App?

Question: Does anyone know, how I can use OpenStreetMap inside my Compact Framework application? Is there a Framework or something like that? All I can find in their wiki is how to contribute to their project and to user their software to map data. But I want to use their maps to show the users location inside my own app. I could not find anything about using their web service or whatever I have to use to show their maps inside my application.
Comment: I'd like to know how you render the XML from OpenStreetMap into an actual image.
Answer: There is a project on Google Code that wants to create a .NET library for the OpenStreetMap API. The website states that there currently is an alpha release, so it might be worth checking that out: code.google.com/p/openstreetmapnet
And there are two similar projects on CodePlex as well:
osmscout.codeplex.com
gmap4dotnet.codeplex.com
Maybe those can be used in the Compact Framework as well, or you could ask the project teams to add that feature (or get involved yourself, it is opensource after all).
Comment: The OpenStreetMap.Net project hasn't been updated in long time.
Answer: CloudMade provides APIs for embedding OpenStreetMap maps in many languages - but not .NET as of the time of writing. There are plain HTTP APIs for map tiles available that you could call from .NET programs, but this is of course fairly low-level.
The CloudMade APIs are designed for developers who want to embed OSM output in their projects, rather than the OSM API which is geared towards map creation, so I think you might be interested in the CloudMade stuff.
See http://developers.cloudmade.com/projects for more.
Answer: They don't appear to have any CF libraries, but the API specification is well documented, so there's no reason you couldn't integrate with it.
Answer: I've developed a CF component that can download OpenStreetMap tiles, and also plot points of interest and basic routes. Depending on your requirements, and any restrictions on licences that you're permitted to use, then it may be of use to you?
Answer: Brutile looks quite promising. It is a library designed for C# to connect to OpenStreetMap sources. (Silverlight demo available Here.
The wiki also has a listing of all .NET related pages. Of the documented projects, OpenStreetMapViewer looks like it fits your needs the best. It's designed to display a portion of OpenStreetMap within a .NET app. I'm sure at least one of these will work for windows mobile.