binding onblur and onclick events using jQuery to show the next tr in a table that is already hidden

Question: Okay, this will be the last question, although I'm learning alot about jQuery from you guys so thanks!
Okay as I've mentioned previously (see original)... "I'm currently having to extend an very old ASP.NET site which has a database generated front end and is a behemoth of an application, it needs completely rewriting - however I've been told to add to it than redevelop it "
Okay, the backend renders a table which I have little control over, it produces element names and ids using GUID (or something). I've amended the backend to output 4 rows in a table (the example shows one row but all have the same structure just different names and ids), jQuery loops through this table, switching the innerHTML of one cell to another and hiding some of the rows. It traverses the table and returns the radio button group name on a specific row. It also take the value of the textbox on that row too, I'll need this later...

                  <input type="text" name="*" id="*" class="currentPaymentAmount"/>

I now want to extend the jQuery so if a radio button is checked on that row and the text box with the class of currentPaymentAmount on the same row has a length larger than zero the next row is displayed (which should be hidden).
Here's my jQuery so far...
    $('#tableID tr').each(function (i) {

        /*switch select and validation and clear */
        $(this).children('td.qCol').html($(this).children('td.qCo5').html());
        $(this).children('td.qCo5').html("");
        /* hide all but the first row*/
         if (i >= 1) {
            $(this).hide();
         }

         /* get the radio button name and check if either are selected also see if the text box exists*/
        if ($(this).find('input:radio').attr('name') & $(this).find('input.currentPaymentAmount')) {
            var thisRadioName = $(this).find('input:radio').attr('name');
            var thisAmount = $.trim($(this).find('input.currentPaymentAmount').val());

/* now check to see if either of the radio buttons are checked and the textbox has a value*/

}

I now need to check that one of the checkboxes are checked and the legth of the amount is greater than zero, if all is well I want to show the next row (which should be hidden)... something like this
     /* now check to see if either of the radio buttons are checked and the textbox has a value*/

if ($(this).find('input[name=' + thisRadioName + ']:checked') && amount.length > 0) {
        $(this).next().show();

}

I'll then have to bind these to a blur event on the text box and the onclick of the radio buttons... how on earth do I do this?
I realise how complicated this is and my explaination is pretty awful. I'd find this easier in JavaScript but I wish to start using jQuery so I write less!
Answer: You could do
$('.qCo5 input.currentPaymentAmount').blur(function(){
     if ($(this).val().length >0){
        $(this).closest('tr').next('tr').show();
     }
});

and
$('.qCo5 input:radio').click(function(){
     if ($(this).is(':checked')){
        $(this).closest('tr').next('tr').show();
     }
});


Is there any word or phrase for the idea that "everything in the universe is a miracle"?

Question: Is there any word or phrase for the idea that "everything in the universe (including the creatures) is a miracle"? Or someone who chooses to see everything as a miracle?
Answer: From a philosophical point of view, I believe you could call this pantheism: the belief that all things are part of god.  However, the answer depends on how we understand the word 'miracle'.
Comment: Yes. By some definitions of the word, *everything* being a miracle would be a logical impossibility. In fact, *most* things being a miracle wouldn't make sense either.


How should we handle users who never bother to click on answer tick?

Question: Some people here in community must exist who never bother to accept answer as answer. How should moderator deal with them? They always gets an answer and disappear. Now more response, never mark answer as answer, but ask next question instead. Moderator should consider these type of users. I think?
Comment: What is the issue? Why is it so important for you that OPs accept/upvote answers?
Comment: Buddy, I Saw this in stackoverflow, so I asked it here.. Nothing important it this
Answer: Nobody can mark a question as answered except the asker, not even moderators, and that is by design.
The checkmark means, from the perspective of the asker, "this answer solved my problem or helped me solve my problem." Nobody but the asker can make that judgement. Consequently we do not (and will not) attempt to moderate, scold, encourage, cajole, badger or coerce users into marking questions as answered. It's entirely up to them.
There's nothing bad or incorrect about never accepting an answer on a question.
Comment: But he told me in his next question that previous answer was useful and he forgot to say thanks.. So he thanked me on very next question for the previous answer, but still he didn't mark that
Comment: So? That's not a "problem," in the sense that that's not something that can be moderated. What are you *proposing* we do in these cases?
Comment: At least remind him to do the formalities so next time at least people don't leave your question or don't answer you quickly because of your past reputation
Comment: That's not going to happen; it's very possible and correct that *no* answer helps an asker and thus none *should* be checked. It's also possible the user just never comes back (in which case the reminder is a waste). *You* (or any individual) can suggest to a user that they might consider accepting an answer, but that's not going to be a site policy, and furthermore abusing it (that is, badgering somebody too often to choose an answer) *is not* allowed.
Comment: Actually I saw this at stackoverflow. What can I say...
Answer: Welcome to the Internet.
Internet is full of people

that come and go
that come and stay
that are intelligent
that are stupid
that can read rules and guidelines
that bother to read rules and guidelines and don't bother abiding by them
that don't care about the rules and guidelines
that enjoy using a service by the rules and guidelines
that act like [boy|girl]-scouts
that act like bullies

Stack Exchange is on the Internet, and, by default, there is all sorts of people using the site.
Stack Exchange suggests to mark the answer as accepted. There is a reward for the OP and for the answer author. You'll find people that will enjoy doing it, and you will find some who don't know or don't care.
And it's ok.
At the end of the day, it's only 15 reputation points.
Comment: Fifteen reputation is *trivial*; even if reputation gain is your primary motivator for answering (and I find that unfortunate, if true), a decent answer will generate *far* more reputation over time from votes than it will from acceptance.
Comment: Currently going worse than that
Comment: @HamzaHasan I'm not sure I understand what you mean here..?
Comment: It was about 15 reputation per day :D
Comment: Agreed. And m not here for that. Don't be like that for me :D
Comment: I just saw a [question](http://gamedev.stackexchange.com/questions/98554/in-unity-why-do-my-animator-states-wait-until-the-end-of-each-animation-to-chan) get updated by Community where the asker *answered their own question* and didn't mark it as accepted.  Given that the user only has 11 rep, I doubt they'll ever return.  It disappoints me that this question will forever rise to the top as a result.


The meaning of the clause "his chin nuzzled into his breast"

Question: I started to read a novel written by Jorge Orwell - "1984". There is a clause in a sentence "Winston Smith, his chin nuzzled into his breast in an effort to escape a vile wind, slipped quickly through the glass doors of Victory Mansion, ...". I can understand the meaning of the clause. Did Smith's chin take the action of nuzzling into his breast, or is it a passive voice with omitted verb? Correct me, if I am wrong
Answer: It is a participle, but a past (or passive) participle used to describe what is being done with his chin.
Let's look at an example with a verb that has a distinct past tense and past participle.

The apple, its flesh eaten by maggots, was on the table.

Here the participle describes the apple's flesh.  The part between the commas is parenthetical, and has an adverbial effect, describing the context of the apple on the table.
The verb "eaten" is a passive participle, so it has the same effect as the passive voice, in that the implied subject (his chin) is the natural object of an active verb "nuzzle"
So in your longer, more complex sentence we know that Smith is "nuzzling" his chin into his breast, that is he is lowering his head and raising his shoulders in a vain attempt to keep warm.
Comment: Thank you for you reply, James! I have read a couple articles based on your answer. If I get it right, that *parenthetical* part is used to add insignificant information to the main sentence, and now I wonder if we could add any information that is related to Smith in some way, until the main sentence grammatically correct? For example, about his boots, coat, the iron he forgot to turn of?
Comment: It's not exactly "insignificant information". See [this literary analysis](https://www.google.co.uk/books/edition/The_Cambridge_Companion_to_Nineteen_Eigh/4bH2DwAAQBAJ?hl=en&gbpv=1&dq=his+breast+in+an+effort+to+escape+a+vile+wind&pg=PA42&printsec=frontcover), which points out that right from the very first sentence, all the way to the end of the book, Winston Smith is constantly but unsuccessfully struggling to find shelter from a hostile world. Essentially, that "parenthetical" clause foreshadows and underpins the entire book!
Comment: @FumbleFingers, thank you for that discovery!


Is there a multiple copy/paste app for iOS?

Question: I am particularly interested in copying several chunks of text, and then pasting all of them together into another app.
Answer: I find CopyClip 2 from FIPLAB Ltd very useful - it doesn't merge clips automatically, but it does continually record up to 100 copied pieces of text on an easy-access icon.
Comment: FlyCut does the similar thing and I find it quite awesome!
Answer: I believe what you are looking for might be a Clipboard manager. There are a few around for OS X (e.g. https://itunes.apple.com/au/app/copyclip-clipboard-history/id595191960?mt=12) - you can easily find more on Google.
Now, for iOS I don't believe you can have that exact same functionality, but some apps get close. They can check your clipboard content and you can add any copied text into that app easily as shown here:
http://www.cleanshavenapps.com/clips/
Another popular app is found here:
https://itunes.apple.com/au/app/clipboard-manager-history/id320175134?mt=8
I don't think any of these will merge your copied texts automatically, though - you could check out IFTTT to see if you can create your own (or existing) automated recipe. Maybe also Workflow or Launch Centre Pro could help automate this for you.
Answer: Paste is a contemporary alternative with an iCloud synced clipboard. It's possible to concatenate multiple items from the clipboard history. In addition to recent clipboard history, it offers "Pinboards" where important clips can be saved, e.g. code snippets, folder paths, images & documnets and so forth. It's possible to preview the files from within the app.
There is a trial version available.
Answer: Thanks Chris for the suggestions.
I found another app called NoteBox, recommended by Federico Vittici but not tried by me, that appears to do something like it.
I also found a small (and old) one trick pony app called Copy+ HD, last updated 2012 that seemed to have been designed exactly for what I wanted, so I splurged and bought it, even though I feared it would not work any more. Well, it does! It's not perfect but it is closer to this task than any other app I know of. (I did not try Workflow or IFTTT.)
Answer: My favorite is Copyless.
It's very lightweight and fairly customizable, allowing you to easily switch to plain-text mode (i.e. clears styling when copying from/to e.g. MS Word) and paste the n-th item in the clipboard history, among other features. And all this beauty is free! Definitely worth a shot.
Comment: This app is only for macOS - there appears to be no iOS version, which the OP is asking for.
Comment: @IconDaemon My bad! Came here from a macOS question and my mind made the wrong connection.


Is SEO consultant that starts by creating profiles on other sites for backlinks doing legitimate work?

Question: I hired someone to do SEO work on my website. He started by creating free profiles on dozens of sites that have nothing to do with my business. For example, evernote.com, penzu.com, pearltrees.com, diigo.com, ello.co, livejournal.com, myspace.com, etc... I think the idea was to get backlinks. However, only a few of these sites provide dofollow links and I think Google would be smart enough to know that these are not quality backlinks. He says he is following protocol and only uses "whitehat" techniques. Should I be concerned?
Comment: Yes, it indicates they likely are either following bad advice, or possibly trying to add backlinks to other client sites, or even their own. As davigo mentioned below, some of these aren't recognizable and likely wouldn't be considered _authoritative_ or _relevant_. Low-quality/unnatural links could lead to a manual action and consequently should be disavowed - see Google's advice [here](https://support.google.com/webmasters/answer/2648487?hl=en). I'd suggest going with SEO consultants who have a proven track record and verifiable testimonials/referrals - or just do it yourself, it's not hard.
Comment: Here are some things that might help with the later:  [What are the best ways to increase a site's position in Google?](https://webmasters.stackexchange.com/questions/2/what-are-the-best-ways-to-increase-a-sites-position-in-google)
Comment: Thanks @dan. Any idea where to find good SEO consultants? I could probably do 90% of it myself but I still need help once in awhile. This guy came from Upwork and he had good reviews.
Answer: Yes.  You should be concerned.   Links from sites which do not relate to your content are likely to decrease your SEO performance.  I am not very familiar with many of the sites he listed, and it is likely legitimate for him to host your profile in appropriate sites/directories (but it sounds like the appropriate bit is missing from his endeavours.)   If you are a maker/creative and are trying to promote a website focused on creative endeavors it is possible that what he is doing is appropriate, but it seems somewhat unlikely.
"following protocol" sounds rather hollow to me - I am unaware of any "protocol" which applies to SEO, although there are certainly best practices.  None of these were named in your post!
I do not hold myself out as being an SEO expert, but I've been around long enough to know that SEO is about ensuring you have the appropriate content on a "clean" site - with appropriate keywords (but not using keyword stuffing), having backlinks from credible, related sources, and doing things like GMB, using appropriate schema and taking whatever steps you can to make your site a credible, authorative source of information.
I did want to point out that nothing described would be considered "blackhat", so its not likely to get you blocked from Google - it just sounds like someone who does not know what they are doing following a 15 year old playbook which is obsolete.
Comment: Google is smart enough to recognize links from user profiles on sites and forums. It is also able to distinguish such links from profiles and pages on social networks or other sources. Perhaps you have chosen not the best promotion strategy, but it is unlikely that it can harm you.
Comment: I think profile links from well-known and legitimate, albeit irrelevant sites are unlikely to _decrease_ SEO performance, whether by means of unnatural linking penalties or otherwise. Aside from that, this is a good answer and I agree completely with your last sentence: it's sounds like someone who doesn't know what they're doing.
Comment: @gdvs Im pretty sure that Google looks for relevance in the backlinks as a way of providing higher quality results and reducing link farms. One of the problems Ive seen is web design companies who have a link to their website from their (unrelated industry wise) clients sits, and Google hammers them for it.
Comment: I'm not disputing that Google look at the relevance of backlinks. I do however disagree with your position that a handful of links from web profiles that are merely irrelevant will **decrease** SEO performance. To the best of my knowledge, there's no good evidence to support that claim. The instance you site is less to do with relevancy, and more to do with it _undeniably_ being an at-scale link marketing tactic which is expressly discouraged (at least by Google).
Comment: Alright that's what I was afraid of. Thanks @davidgo


Ideas for Segmenting Audio Data

Question: I'm currently working on audio data trying to perform a recognition for given classes (for example grinding coffee etc.). However, I have some trouble distinguishing the null class from interesting sound segments.
Currently, I simply look at the audio intensity. As I have a limited, known number of classes I want to detect, I thought about saving some aggregate of the signals (mean fft) comparing the unclassified signal to it. If it is close enough to one of the saved aggregates do a classification, if not just drop it.
My approach seems to me quite naive. Therefore, input/ideas appreciated ;)
Answer: There are interesting ideas you have already started to dig in. You should just dig a little more.

Using decomposition on a meaningfull basis like fft or wavelet transform is interesting. This is alternative representation. You can think of a lot of alternative representations... wavelet is my favorite for audio data.
Using "directly" the whole signal to try to discriminate if it is from the null class is not a good idea, and as you already started with, you need to build up statistical summary. This can be one summary but there can be a few more. You have to think wether this statistical summary contains interesting information for the discimination you want to do or not. For example I doubt that the mean of the FFT is interesting in your case. This is dimensionality reduction.
There exists automatic ways to find meaningfull statistical summary. For example you can build up automatically a large number of candidate (with for example linear combination of your wavelet coefficient, or simply the coefficient themselves, or some other combination, or wavelet coefficient and fft coeff, ...) and measure there discrimination power somehow and keep the one that have best dicrimination power.
Answer: I think the R package rggobi is exactly what you're looking for.  Audo recognition is even their example problem!

Ideas for Segmenting Audio Data


Can I put my pressure tank over 200' from the well head?

Question: I want to winterize my system which means me moving the pressure tank 200' to a heated structure. Will this cause any problems I should be aware or plan for?
Comment: It's hard to know without more detail. Is the water being piped to that structure anyway? What is the distance to other structures? Uphill or downhill? Since the tank tee and pressure switch will follow the tank, you'll need to consider the wiring issues as well as the plumbing. Often, a bit of heat tape and some insulation can do the job. What are the coldest winter temperatures you expect to deal with?
Comment: Sub zero temperatures are not uncommon. I intend to run self regulated heat cables between the tank and well head. The tank itself will either be situated in my garden shed or if I can make room the main cottage I intend to service in the winter months. The shed is only 10 yards from the cottage
Comment: Can we assume a submersible pump? Internal or external motor control? I recommend keeping external motor controls as close to the pump as possible. You can run the AC power from the pressure switch to the well head instead of the pump wire. Is this a new installation or a retrofit?
Answer: Should not be a problem. Pressure tanks are best located in or near the structure served, not near the well-head.
Mine is ~400 feet of pipe from the pump (300 up and 100 or so sideways.)

Can I put my pressure tank over 200’ from the well head?


How to convert a varying 28~60V DC high into 3.3V?

Question: I want to design a PCB, include a GPIO of a MCU detecting the on and off of a LED driver. The LED driver input is 220V 60Hz, the output varies between different LED within 28 to 60V DC. My intuition tells me to lower down the DC voltage to 3.3V to the GPIO, but I dont exactly know how to do it. Someone tells me to use an MOSFET or BJT. Using the 28 to 60V as an input to turn on the BJT or MOSFET as a switch, to connect GPIO and an 3.3V. It sounds like an good idea, but I cannot find a MOSFET or BJT with that hign input voltage. Most MOSFET Vgs is 20 at most, and BJT even smaller. and, even if I can find a proper MOSFET, I am not sure if it generates lots of heat or expensive because of the high volgate of DC input. I prefer not. Finally, I don't even know what is the common method to convert a verying high DC voltage to a fixed low DC voltage. Maybe the BJT and MOSFET is not the best way. I don't know. If someone can share experience about this, I will appreciate. Thank you very much.
Answer: You can use a voltage divider:

simulate this circuit – Schematic created using CircuitLab
This configuration divides the voltage 11:1, so the GPIO pin will see 2.54 to 5.54V depending on the LED voltages while the very high (100k) series resistance will limit current to about 500uA maximum.  Assuming your MCU has any protection diodes, this should be safe even though you're going above 3.3V.  If it doesn't, you could add an external diode in parallel with R2 to clamp voltage at 3.3V.
Comment: @Superuser You could pick a diode that switches on at around 3.3v for a current of a few hundred microamps. Then if the voltage goes above 3.3v, the diode takes the current. The trick is that you'd have to pick the diode carefully since the current is so low or it might not turn on. Probably better to check the datasheet and see if the vendor has handled this for you. Often GPIO pins are rated for some over voltage current.
Comment: Thank you very much! This is the exact answer to the problem. Just one question, would you please elaborate that adding an external diode in parallel with R2 to clamp voltage at 3.3V? I am not sure how it works. Thank you very much.
Answer: Using a resistor potential divider R1 and R2, obtain close to 3V (a digital high) when LED voltage is 28V. Clamp the MCU input to 3.3V maximum with zener diode D1:

simulate this circuit – Schematic created using CircuitLab
This arrangement ensures that voltages below about 12V (corresponding to about 1.5V or less at the MCU input) will not be recognised as "high" by the MCU. This might be useful because there may still be a small potential difference across the LEDs even though they are not lit.
To obtain 3V at the MCU input, LED voltage will have to be at least 28V, but as that continues to increase, zener diode D1 prevents the MCU input from rising with it, beyond 3.3V.
Comment: Thank you very much! This is the exact answer to the problem. I thought about dividing voltage with resistor, and I thought about zener, but I dont exactly know how to use zener. It has been decades after I learn electronics at university. Thank you for your answer and example. It helps a lot.

How to convert a varying 28~60V DC high into 3.3V？


How can I export gmail message subject lines from a search?

Question: I have a label that sorts all my email marketing from one company. I want to export the search results so I can grab the subject lines. There are about 350 messages, and I wanted to research the subject lines. Any ideas?
Answer: This trick only works on one hundred at a time, in the normal view of all your email subject threads. If you check all the boxes, then click More > Forward as Attachment, it will open a new composition window with each email as an attachment. You can select the list of attachments as text at that point and copy it out to somewhere else. Then trash the new email.
Answer: You can use MsgExtract to export only the subject lines or any other email field to excel or to a text file.
After you label the search in gmail, you only need to select the same label in MailExporter and then select the email parts that you want the export:

You can find further information about MsgExtract exporting features here:
http://www.maildev.com/msgextract/
(Disclaimer, I am the author of Msgextract)
Comment: Mac OS support?
Comment: That is EXACTLY what I was looking for @jponce thanks. I will try it out :)
Answer: One way to do this is to extract messages to text files by using an IMAP mail client and then using a regular expression to extract subject lines from these text files.
I tried this with Thunderbird.
By default, Thunderbird exports messages by creating one text file per message. Thunderbird names files according to this format: "{subject} - {sender} - {date}.eml". So I already had subjects in file names. Then I just used terminal and redirected ls (use dir, if using Windows) output to a separate text file:
ls -1 > mymessages.txt

In Windows you'd do this:
dir /B > mymessages.txt

If you want to get rid of the sender and date part, you can use your favorite regex supporting text editor (like Notepad++ or vi) and find
^(.*) - .* - .*.eml

in mymessages.txt, replacing it with $1 or \1 (depending on your editor)
Comment: I may try this - but I would have to download 51,000+ message first. I'm not sure if that's a good plan...
Answer: You can apply a label to the emails you want to export.
Then in https://www.google.com/settings/takeout/custom/gmail :
Click 'Select labels' and choose the label you applied.
Click 'Create Archive'
Comment: Seems to want to export a *.mbox file that you need Thunderbird to open?


Can anyone suggest an intervalometer for the Nikon D90?

Question: I was wondering if anyone had suggestions for intervalometers for a Nikon D90.  The D90 lacks a remote port, so it has to be triggered either by USB or IR, which limits the 3rd party remotes it is compatible with quite a bit.
Comment: Ended up making my own.  A fully functional one can be put together for about $10 with a little bit of electronics knowledge.  Everything else available seemed way overpriced for what they did.
Answer: The Nikon D90 can in fact accept a wired remote.  It plugs into the GPS port which is the second rubber-covered area on the side of the D90.  While some cameras have separate ports, the D90 uses this single port for both purposes.
Here are a couple options from Amazon:

Satechi TR-M Timer Remote Control for Nikon D90
GSI Super Quality Multi-Function Timer Remote Control Shutter for Nikon
Answer: I ended up making my own using some slapped together electronics.  Personally I think this is the best option considering how overpriced everything else is.
The setup is very simple.  I use a TI Launchpad with an MSP430G2231 to generate the IR signal. It's a $5 solution that is very flexible and I can set it up to do just about anything I need.
Here is a link to the schematic: Link to schematic :) (link broken)
Comment: Right here in the answer would be a nice "somewhere".
Comment: I too built my own using the Arduino platform but it cannot go beyond 1/3 shutter speeds in bulb mode. So IR and CableTrigger only good for timelapse style photography (which is where the intervalometer shines!)
Comment: Can you write up somewhere what you did?
Comment: +1 for @Evan as I too would like the schematic and overview to build my own
Comment: Looking forward to the writeup.
Comment: James, seeing your schematic (very nice work) and an image of the commercial thing (esp. its connector), I wonder how did you arrange a connector for your self-made intervalometer?
Comment: The device communicates with the camera by emulating an IR remote.


Do mixers support 6.5mm mics?

Question: I an new to recording world. I jut want to know is does mixers support 1/4inch mics for recording. Or XLR mics with XLR to 1/4inch converter cable?
Comment: It depends on the mixer! Most will have at least one of: separate 1/4" input on same channel; combined 1/4" and XLR socket; or a separate channel with 1/4" inputs.
Answer: Most professional consoles have 1/4" inputs as well as XLR inputs.
However, these are line inputs, not mic inputs. What this means: there is no dedicated preamplifier, the signal is directly fed to the EQ stage (or AD / ... whatever comes first in the given console model). And those stages expect a reasonably strong signal. If it's too weak you can still use the mixer, but the SNR will be less than satisfying.
Add to this that mics with 1/4" plug usually have horrible quality to begin with, and it's clear that you aren't going to achieve anywhere decent results this way. For loud, mid-heavy sources like brass or a guitar amp it's ok perhaps, but for anything else do get some proper condenser mics with XLR plug1 if you're serious about recording. There are really affordable, yet well-sounding models available nowadays.

1Or USB: if you only need to record one channel at a time you can skip the mixer entirely and record straight into a laptop / tablet etc..
Comment: Would it also be true that phantom power needs XLR, not 1/4" jack?
Comment: @Tim: yes, definitely. Phantom power should never be applied over 1/4", because these connectors tend to short pins to ground when connecting/disconnecting.
Comment: Your second paragraph is not always true. There is usually still an input gain control on line-ins, and since you already have one for the mic it makes sense to use the same gain stage for the line-in too. Typically one of three things happens; the mic could get a 20-30dB fixed gain boost that is then reattenuated or further boosted by the gain knob; the line-in could be padded by the same 20-30dB amount and then reboosted by the gain stage; or the gain stage could simply have enough "usable" adjustment to level the input regardless of raw signal strength.
Answer: Look up the specs of the mixer you are interested in.  If you don't have your sight on one, look at some used ones in online music stores to figure out brands with resale value.  Those should be somewhat representative.

Do mixers support 6.5mm mics?


How to get Null values of records in aerospike

Question:
I'm working with aerospike. Using AQL, I inserted some data. I want to get null values of records with particular fields in aerospike. I'm tagging picture in that picture one record does not have a name its empty space
Answer: Aeropsike is schemaless - each record is self describing. Any bin that is non-null is part of the record. Any bin that is updated to null actually gets deleted from the record. So, think in terms of units of record instead of a table with columns.  You can query for a specific bin from a record and if not found, Aeropsike will return a null.  Here is the java API:
public final Record get(Policy policy,
         Key key,
         String... binNames)
                 throws AerospikeException
Read record header and bins for specified key. The policy can be used to specify timeouts.
Specified by:
get in interface IAerospikeClient
Parameters:
policy - generic configuration parameters, pass in null for defaults
key - unique record identifier
binNames - bins to retrieve
Returns:
if found, return record instance. If not found, return null.
Throws:
AerospikeException - if read fails

Comment: can you please elaborate on what happens to a bin when i put null on them? is that a process that delete the bin? what happening? is the LUT of the record is updated on insert null to the bin? is it shipped over XDR?
Comment: null --> deletes a bin, yes. what's happening? --> an updated version of the record is re-written in the system with updated LUT. If you are using XDR, that will cause that record to ship via xdr.
Answer: Ran some test code - the record key is valid with some other bins:
userRecord = client.get(null, userKey, "notThereBin");
    if (userRecord != null) {
        console.printf("\nINFO: User record with notThereBin read successfully! Here are the details:\n");
        console.printf("notThereBin:  " + userRecord.getValue("notThereBin") + "\n");
    } else {
        console.printf("ERROR: User record not found!\n");
    }

and the output is:
    INFO: User record with notThereBin read successfully! Here are the details:

notThereBin:  null


LSI SMC2108 hardware to HBA

Question: I have SMC2108 (LSI controller) hardware controller, which I want to replace with LSI SAS 9207-4i4e (it's HBA - fakeraid). Can I switch the controllers and to access my data (even with readonly). I know that SMC2108 keeps the metadata in the DDF format in each disk, and mdadm have support of DDF. So anyone have actually done such transition from hardware LSI (DDF superblock format) to software mdadm? In fact I only need to read my data and then I will recreate ordinary software raid with mdadm.
Comment: I'm not sure anyone's going to be able to give you a 100% certain response to this, it'll be a 'suck it and see' job I'm afraid, just make sure your backups are VERY good :)
Answer: You asked about two different targets (hardware card or software mdadm) so I'll answer them each separately.
As for moving between cards, going from LSI to LSI usually works great. In my experience, transplanting an entire array from an older series LSI card to a newer 9620 with absolutely no hiccups. The controllers understand the metadata well enough and import the correct configuration. If it doesn't import the configuration correctly, just back out of the BIOS tool without making any changes, and plug the old card in.
If you have 50% redundancy in your array (e.g. a 2 disk RAID1), it can't hurt to take one disk out and plug it into the new card. The system should pick up the configuration from this disk alone. If you are able to boot into it and see data, you are all set. Just add the other disk to the new card too, and let it rebuild.
As for software raid, depending on the number of disks and the type of RAID, LSI's setup allows you to mount disks directly from command line in linux. I've taken apart a RAID1 from an LSI 9620 (identical to your SMC2108), plugged one disk right into the motherboard, and booted. If you have a RAID5 or RAID10, obviously that would not work quite so well.
A best course of action would be to use extra hard disks to make your mdadm raid in the correct size and configuration, then copy data over.

LSI SMC2108 hardware to HBA


Comparing action values for policy improvement (Sutton and Barto)

Question: In section 4.2 of Sutton and Barto's book, they say that to decide whether a policy $\pi$ needs to be changed, we can compare the action value function $q_\pi(s, \pi'(s))$ and $v_\pi(s)$. Why can't we instead compare $q_\pi(s, \pi'(s))$ and $q_\pi(s, \pi(s))$? This would not make a difference since the policies are deterministic, right?
Comment: My understanding is that one has the relationship
$$ v_\pi(s) = \mathbb{E}_\pi[R_t\mid s_t=s] = \int_\mathcal{A}q_\pi(s,a)\pi(s,a)\,\mathrm{d}a$$
So in a sense $v_\pi(s)$ weights all possible decisions and their expected reward using the probability of doing $a$ in state $s$ according to policy $\pi$, which is $\pi(s,a)$.

How do you define $\pi(s)$ and $\pi'(s)$ ? Is this the greedy assignment $\pi(s) = \arg\max_a\pi(s,a)$ ?
Comment: The book mentions that the policies are deterministic. This would mean that there is only one action taken in a state with probability 1. Furthermore, it is mentioned that "For some state s we would like to know whether or not we should change the policy
to deterministically choose an action $a \neq \pi(s)$." So, the two policies differ in that in state s, policy $\pi'$ takes an action $a \neq \pi(s)$. And yes, $\pi(s) = \arg\max_a\pi(s,a)$.
Comment: If your policy is deterministic then $v_\pi(s) = q_\pi(s,\pi(s))$ !
Answer: If your policy is deterministic then $v_\pi(s) = q_\pi(s,\pi(s))$. This is because the expectation in
$$ v_\pi(s) = \mathbb{E}_{a\sim\pi}\left[q_\pi(s,a)\mid s_t=s\right] = \int_\mathcal{A}q_\pi(s,a)\pi(s,a)\,\mathrm{d}a$$
is taken over a deterministic policy = $\pi(s,a) = \delta_{\pi(s)}(a)$ and therefore the expectation becomes an evaluation at $a=\pi(s)$.


Virtual list view not checking items that are not visible in GUI

Question: I have a virtual list view and each row has a checkbox, I have a master checkbox that checks all the rows in the grid, this works fine until I filter some of the rows (all rows currently unchecked) and then load back all rows into the list view and then click my master checkbox to select all rows, all rows appear selected until I scroll down and then the rows I filtered are not selected but the rest are. Now this sounds like an obvious bug but if I make my window bigger so I can see at least one of the rows that was filtered and then click the master checkbox the visible row is now checked in other words rows that are not on screen that were previously filtered remain unchecked while rows that were not filtered and were not on screen are checked.
Any ideas why this would be?
Thanks
Comment: If you're using a virtual list box, you should in my opinion operate on the actual data instead of the list box entries anyway. That might solve your problem already.
Comment: WinForms, ASP or WPF? It makes a big difference :)
Answer: It appears that when you filter the rows an attribute or o flag changes that prevents the master checkbox to select them. Try posting some of your code to help us.


Is it safe to delete .pkg/.dmg files after installation?

Question: Can I delete a pkg dmg zip file after I install its content? I mean if this is a little app can I delete the installation file without breaking the installed application?
Answer: To answer your question(s), generally speaking, yes, you can delete the container file whether it be a .pkg, .dmg or .zip file. This of course assumes that all content of the container file has been installed. In other words, some .dmg files might contain extras in a separate folder within that are not installed when you drag and drop the app into Applications.
So use common sense when making the decision to delete the container. Obviously if the container contains a single file and you install it, then there is no need to retain it if you don't mind downloading again if for some reason it's needed again.
Answer: The answer is yes. You can delete the .pkg/.dmg/.zip file after installing the app. It will not affect the app as both files are different. These packages are just containers.
Answer: Take care that some installers (.pkg files) may also contain a menu/button for properly uninstalling the app. Browse the app's doc to see if this is mentioned. If so, it is a good idea to keep the .pkg file somewhere (external drive, ..)
Answer: Yes, it's no longer required to run the application so it's safe to delete. Personally I like to archive a copy first, in case I ever want to re-install an app or version of an app that's no longer available. So at this point I have a network drive with thousands of DMG and PKG files on it...


One or more prerequisites required to install Kaltura failed

Question: I am following https://github.com/instructure/canvas-lms/wiki/Kaltura-setup-instructions to install Kaltura. But I am getting issue in sudo php install.php step.
sneha@SCS-I82:~/Downloads/kalturaCE_v3.0.0-instructure$ sudo php install.php
[sudo] password for sneha:

Thank you for installing Kaltura Video Platform - Community Edition

A previous installation attempt has been detected, do you want to use the input you provided during you last installation? (Y/n)
> n

In order to improve Kaltura Community Edition, we would like your permission to send system data to Kaltura.
This information will be used exclusively for improving our software and our service quality. I agree (Y/n)
> Y

If you wish, please provide your email address so that we can offer you future assistance (leave empty to pass)
> email@example.com

PHP Notice:  Array to string conversion in /home/sneha/Downloads/kalturaCE_v3.0.0-instructure/installer/OsUtils.class.php on line 13
Please provide the following information:

The following apachectl script has been detected: /usr/sbin/apachectl. Do you want to use this script to run your Kaltura application? Leave empty to use or provide a pathname to an alternative apachectl script on your server.
>

The following PHP binary has been detected: /usr/bin/php. Do you want to use this script to run your Kaltura application? Leave empty to use or provide a pathname to an alternative PHP binary on your server.
>

Full target directory path for Kaltura application (leave empty for /opt/kaltura)
>

Please enter the domain name/virtual hostname that will be used for the Kaltura server (without http://)
> kalturadev.example.com

Your primary system administrator email address
> email@example.com

The password you want to set for your primary administrator
> India_4321

Database host (leave empty for 'localhost')
>

Database port (leave empty for '3306')
>

Database username (with create & write privileges)
>
Database username cannot be empty, please enter again
> sneha

Database password (leave empty for no password)
> India_4321

The URL to your xymon/hobbit monitoring location. Xymon is an optional installation. Leave empty to set manually later
Examples:
http://www.xymondomain.com/xymon/
http://www.xymondomain.com/hobbit/
>

Verifing prerequisites

One or more prerequisites required to install Kaltura failed:
   Failed to connect to database 127.0.0.1:3306 user:sneha. Please check the database settings you provided and verify that MySQL is up and running.

Please resolve the issues and run the installation again.

Can someone please suggest some solution for the same.
Answer: Thats not an error, only a warning. But you could correct the problem:
Open the file OsUtils.class.php
nano /home/sneha/Downloads/kalturaCE_v3.0.0-instructure/installer/OsUtils.class.php

and replace the line
logMessage(L_INFO, "User: $output");

with
logMessage(L_INFO, "User: $output[0]");

Now start the install script again and you will see this:
Thank you for installing Kaltura Video Platform - Community Edition

In order to improve Kaltura Community Edition, we would like your permission to send system data to Kaltura.
This information will be used exclusively for improving our software and our service quality. I agree (Y/n)
>

If you wish, please provide your email address so that we can offer you future assistance (leave empty to pass)
>

Please provide the following information:

The following apachectl script has been detected: /usr/sbin/apachectl. Do you want to use this script to run your Kaltura application? Leave empty to use or provide a pathname to an alternative apachectl script on your server.
>

The following PHP binary has been detected: /usr/bin/php. Do you want to use this script to run your Kaltura application? Leave empty to use or provide a pathname to an alternative PHP binary on your server.
>

Full target directory path for Kaltura application (leave empty for /opt/kaltura)
>

Please enter the domain name/virtual hostname that will be used for the Kaltura server (without http://)
>
Must be a valid hostname or ip, please enter again


How could a triggered earthquake be stopped?

Question: A fault that ruptures causing an earthquake can cause a chain reaction of dynamically triggered earthquakes in nearby faults, thus causing a much larger seismic event. What are some high unlikely but still plausible ways to stop this chain reaction of earthquakes, in progress, so that a major city is not destroyed in the end?
Comment: Earthquakes are energy released from built up tension and compression in the plate. One could hypothesize that preventing those secondary releases could potentially lead to a much more dangerous earthquake further down the line - which actually could make a great plot line. 'We tried to fix it and made things worse' isn't a bad plot device in sci fi. Just some thoughts.
Answer: It actually may not be that sci-fi at all: lubricating the fault line could mitigate the situation by allowing easy movement of the faults rather than the snapping action that traditionally produces earthquakes.
More explanation for clarity
Earthquakes are the result of pent-up stresses in within the crust of the Earth (technically the interactions at plate boundaries but I'll get to that in a second) suddenly gets released. Generally speaking, the tectonic plates of the Earth are constantly in motion but this motion gets hung up at the plate boundaries due to friction between the plates. Over time this stoppage allows enormous amounts energy to become stored in the deformations of the rocks. You get an earthquake when this pent up stress overcomes the friction binding up the system. The crust of the earth springs back producing the earthquake. The key here is the plates of the earth bind up due to friction between them allowing all this energy to build which inevitably leads to an earthquake.
So if you could somehow prevent this stress from building or limiting the magnitude that builds before the slippage, then you can stop or reduce the destructiveness of an earthquake. For example, lubricating it, quite literally putting something between the plates to make them slip past one another more easily. My link references water acting as lubricant, but I've seen ideas of using oils or even nanomachines to facilitate the movement.
Comment: Could you elaborate your answer in greater detail? I am not sure I understand what you mean by "lubricating". This could be a good answer to the question and I would probably upvote it if you described your plan in greater detail. (I didn't read the link as answers should provide all the necessary information as a link can go out-of-date. Maybe a summary of that would be enough?)
Comment: @Secespitus is my edit satisfactory?
Comment: Perfect! Thanks for the edit; +1 from me
Answer: That depends on how much scify you are willing to accept.
I'm pretty certain it is not yet possible to do that, but as an earthquake is a wave, a wave with correlationfactor -1 would nullify that wave.
Another way would be to reflect the wave by previously having built something that reflects earthquakes deep into the earth.
Or, even further from possible, if you were able to liquidify a big amount of earth around the city but horizontally contained, the earthquake might be reflected at the boundary just as ultrasound waves are reflected on boundaries between air/water or bone/water.


Is there a free software that can import excel into mysql on mac?

Question: not csv format files, but .xls or .xlsx format excel files, is there any free software for mac, that can import data into mysql?
Answer: Full disclosure.. I am the author of the following program.
Give it a try and let me know what you think.
I have tried many applications including the excel add-in from MySQL, but was not satisfied with them, so I wrote my own.
The current version of my program is slow (just like the MySQL add-in), doesn't support international characters, and doesn't support command line parameters, but it is free and works well.
http://panofish.net/excel2mysql/
I am working on a much better version which will remedy the aforementioned shortcomings and should be available soon.
Comment: Version 2.0 of Excel2MySQL is available and it is FAST and more importantly 100% accurate.  No longer free, but it is cheap.  http://excel2mysql.net
Answer: I haven't tried any of the followings. But just sharing with the hope that this may help you...
http://blog.mclaughlinsoftware.com/2011/02/27/excel-2011-query-mysql/
http://blog.mclaughlinsoftware.com/microsoft-excel/excel-2011-mysql-config/
Source: http://forums.mysql.com/read.php?171,561930,561930
FYI, MySQL officially introduced a tool namely MySQL for Excel (for Windows) to work with Excel.

MySQL for Excel allows you to work with a MySQL database from within Microsoft Excel. MySQL data can be imported into Excel, Excel data can be exported into MySQL as a new table or appended to a current table, and MySQL for Excel allows you to edit the MySQL data directly from within Excel.
Answer: Save it as .csv and then use the mySQL CLI [or other client-side utility] to issue a LOAD DATA LOCAL INFILE statement.
Comment: Agree 1000% using 3rd party software for this type of activity is bound to complicate things more than it needs to.


Will Kubuntu no longer being a funded derivative affect it's official derivative status?

Question: It's a really simple question.  I was just wondering since it has far reaching implications for the site, and it is a substantial change to the ecosystem.
Comment: Since [the status of what derivatives are official](http://www.ubuntu.com/about/about-ubuntu/derivatives) is a general Ubuntu matter (and not specific to, nor determined by, the Ask Ubuntu sub-community), this question should probably be migrated to main. (Most of the question, and all of the answer, are AU-nonspecific.)
Comment: I find hbdgaf comments related to LTS for other Ubuntu flavors very good. Trying to look for a source that says if any of the Ubuntu flavors has LTS supports is very hard.
Answer: What funding are you talking about. If it is about Canonical (Which was a year ago) then please read this
At the current state, the development cycle will continue as normal and will meet the deadline as it has always done. You can see all development release dates in wikipedia
For what it matters, Kubuntu (KDE) for me is my second best distro and Ubuntu flavor.
Comment: I was talking about the year ago thing.  I was considering the change in the context of LTS releases, where a year is really not a valid unit of measurement for the type of issue to which I was referring.  Thanks for the info and accept.
Comment: @hbdgaf Lubuntu doesn't have LTS releases anymore and they're still supported..
Comment: @Seth I don't think Lubuntu ever had LTS releases. [According to Wikipedia](https://en.wikipedia.org/wiki/Lubuntu#Lubuntu_10.04), Lubuntu started with 10.04, and Lubuntu 10.04 was non-LTS (while "vanilla" Ubuntu was LTS.) If I'm not mistaken, this further supports your main point--Lubuntu and Kubuntu don't have LTS releases, but [are definitely considered official](http://www.ubuntu.com/about/about-ubuntu/derivatives).


What is a Lie Group in layman's terms?

Question: I'm having trouble getting my head arround the concept.
Can someone explain it to me?
Answer: I think that understanding comes through examples. The most fundamental example I believe to be the rotation group. Consider the sphere $S^2\subset \mathbb{R}^3$. The sphere has rotational symmetries. If we rotate the sphere by any angle, the sphere doesn't change.
The collection of all rotations forms a Lie group. The group property basically means that
if we rotate the sphere over any angle $\alpha$, after this over an angle $\beta$, it is the same if we would have rotated it in one go (over some different angle). Also any rotation has an inverse (rotating it over the opposite angle). This makes the rotations a group. The "Lie" in Lie group means that these rotations can be done arbitrary small. Many small rotations makes for a big rotation.
Lie groups capture the concept of "continuous symmetries".
Comment: I have tried to understand Lie groups before and not had the slightest clue about them until I read this answer
Comment: It would be helpful in addition if you could provide another example, and perhaps show how the main definition like you find on Wikipedia can be understood after learning from your really helpful example!
Answer: Consider the set of $(n\times n)$ matrices that have non-zero determinant. Such a matrix corresponds to a system of linear equations ($n$ equations in $n$ unknowns) that has a unique solution. You can think of the solution as the unique point of intersection between the graph of a function and a horizontal hyperplane. Here it is helpful to think of $n=1$. In other words, the coefficients of the system correspond to a transformation of space: the variables $x_1, \ldots x_n$ are transformed to $\sum a_{ij} x_i$. The set of such transformations form a group: the matrices can be multiplied, each has an inverse, the multiplication is associative, and the identity transformation fixes each point of space.
Intuitively, it is easy to see which transformations are close to one another. They are close if they move points that are nearby to points that are nearby. Arithmetically, if the entries in the matrix are close, then the transformations are close: thus $0.14x + .33y$, is a reasonable approximation to $x/7+y/3$.
Thus the  set of invertible $(n\times n)$ matrices is a space of invertible $(n\times n)$ matrices. What is not easy for a layman to see is that its spacial characteristics are defined via the determinant since as a set, the $(n\times n)$ matrices are a subset of $n^2$-space. The non-singular matrices are the pull-back of a regular value of the determinant function. [There is a small lie here: this is true for for matrices of determinant 1, but all non-zero determinant matrices deform onto that smaller space].
One important spacial characteristic is that these matrices form a smooth manifold. This is something that is analogous to the surface of a sphere (which is NOT a lie group), the surface of a torus (which is) or the $3$-dimensional sphere that consists of the set of $(x,y,z,w)$ such that $x^2+y^2+z^2+w^2=1$ (which also happens to be a Lie group).
From these examples, we abstract the idea of a Lie group which is a group (that can be thought of as a set of transformations or symmetries) that has the structure of a smooth manifold --- at small scales it is indistinguishable from ordinary Euclidean space. The multiplication and inversion maps are a differentiable functions. And these multiplications occur between pairs of symmetries --- they should not be confused with the action of the matrices on the vector space which is where I started the discussion.
Examples include the real line, the non-zero real numbers, the circle, the torus, the $3$-sphere, the set of rotations of 3-dimensional space, and the special unitary groups representations of which determine particles in physics.
There are some small problems with the definition that I gave. A smooth manifold is a topological space which is paracompact and Hausdorff (neither definition will play a role in the layman's understanding), and that is covered by coordinate charts with specific properties. I imagine that Wikipedia has the relevant definitions articulated carefully.
Comment: Sorry for necropost: when you describe entries as "being close" , do you have any norm/metric in mind?
Answer: Group theory is the study of symmetry.  Lie groups were invented by Lie to study the symmetries of differential equations.  You might like the article:
Starrett, John. "Solving differential equations by symmetry groups."
Amer. Math. Monthly 114 (2007), no. 9, 778–792.
MR2360906
(author's preprint).
It describes how to solve some reasonably calc-2 or calc-4 problems using symmetry and can serve as introduction to what Lie groups do.  It also has pretty pictures of smoothly flowing curves.
Answer: it's a group thats a smooth manifold.  Technically, the group structure and topology should be related, i.e. $X\times X\to X, (a,b)\mapsto ab^{-1}$ should be smooth.  For instance, $\mathbb{R}^n$, the circle, a torus (surface of a doughnut) the three sphere ($\mathbb{R}^3$ with a point at infinity) can all be given the structure of a lie group.
Comment: My understanding is as follows: Lie group - smoothly varying families of symmetries. A differentiable (locally smooth) manifold whereby the group operations are compatible with the smooth structure – Bijective transform mappings maintain symmetry. It is a group object in the category of smooth manifolds. In a compact lie group, the symmetries form a bounded set.

What is a Lie Group in layman's terms?


GeoDjango: Order by distance for model that has a ForeignKey relation to another model that has a PointField

Question: Model A has a ForeignKey relation to Model B. Model B has a PointField. Is there a way to order Model A objects by distance from a POINT?
Answer: Assuming that both Model A and B are using objects = models.GeoManager(), the FK field on Model A is named b, Model B has PointField named point, and pnt is a GEOSGeometry then the following should work:
A.objects.distance(pnt, field_name='b__point').order_by('distance')

Comment: thanks. i have yet to try this, but it looks promising. is this documented somewhere? i couldn't find it...


Differential Equations in Python

Question: I'm working with a DE system, and I wanted to know which is the most commonly used python library to solve Differential Equations if any.
My Equations are non Linear First Order equations.
Comment: Have you tried ODEINT in Scipy.integrate? https://apmonitor.com/pdc/index.php/Main/SolveDifferentialEquations
Answer: If you need to solve large nonlinear systems (especially stiff ones), the scipy tools will be slow and awkward. The PyDSTool package is now quite commonly used in this situation. It lets your equations be automatically converted into C code and integrates them with good solvers. It's especially good if you want to define state-defined events such as threshold crossings, add external input signals from arrays, or have other analyses done (such as bifurcation analysis, as the package includes an interface to AUTO).
Answer: You use SciPy's integrate, which interfaces with the standard LAPACK routines for something like this.
See this tutorial, which is just one I found on Google. Here are the docs.
Answer: For calculations in symbols - use sympy.
Answer: You learn how to do Differential Equations in Python using the numpy and scipy packages on this website:
https://www.udacity.com/course/differential-equations-in-action--cs222
The course is Differential Equations in Action.
Answer: Probably something in SciPy or NumPy.
See: http://docs.scipy.org/doc/scipy/reference/integrate.html
Answer: You can use PyDSTool which is for Dynamical systems modeling, simulation and analysis environment. It is mostly use scipy and numpy

Differential Equations in Python


Unable to navigate to local google drive sync files in Linux Mint

Question: I am using linux mint 20.1 Cinnamon. I have turned on google account in online account setting for google drive syncronisation.
So in my folder explorer, there is an entry under networks relating to my google account that I signed into. It shows the current state of my google drive.
The problem is that I am not able to use this location in my applications. For example, I am not able to use this location of google drive files in my Obsidian app.
When I print the directory of the google drive folder, it shows as: /run/user/1000/gvfs/google-drive:host=gmail.com,user=[my_username]
Now I am unable to navigate to this location as there is no folder gvfs inside the folder named 1000
Is there a workaround? I need to sync files from my google drive into a local copy.
Answer: Is your directory 'google-drive' activated via the 'google-drive-ocamlfuse'  program (https://github.com/astrada/google-drive-ocamlfuse)  ?


How to install Image Magick for MAMP (Pro) on Mountain Lion (10.8.2)

Question: I've been searching for a way to install Image Magick on my Mountain Lion setup (where I use MAMP Pro). I did find this article, but it isn't specific to ML. Also found a couple other similar questions here on SO but they were too specific I think. Doesn't help that I'm not great at this sort of thing. Can anyone point me to a good resource?
Answer: As was pointed out in erwinheiser's comment, MAMP 3 now comes with imagemagick pre-installed. I checked MAMP's User Guide (PDF) and found this:

The ImageMagick PHP module is included by default, but you must enable it inside the php.ini template file. Remove the ';' from the following line.
;extension=imagick.so

And how do you find and change the (right) php.ini file for MAMP Pro?

From MAMP's menu choose File › Edit Template › PHP › [the latest version]

or use the keyboard shortcut: ⌘4

Make the edit. (Imagick was was at line 542 in mine.)
Save and close the file.
MAMP asks if you want to restart the servers now, choose yes.

And you're done!
Comment: Note that PHP 7 in MAMP 3.5 does not have the ImageMagick extension installed. So uncommenting it in the php.ini file won't have any effect there.
Comment: If you don't have MAMP Pro, depending on your PHP version look here in OSX: **/Applications/MAMP/bin/php/php5.5.14/conf/php.ini** then just create an alias in your .bash_profile and easily edit your php.ini file whenever you need to: **alias phpini='nano /Applications/MAMP/bin/php/php5.5.14/conf/php.ini'**
Comment: After doing this, I get "Uncaught exception 'ImagickException' with message 'NoDecodeDelegateForThisImageFormat" while trying to create a thumbnail.
Comment: This may have to do with the file extension of your image. Are you trying it with a '.jpg'?
Comment: Tried with both a jpg and a png, same error. Finally I'm trying with exec() or passthrough(), because the sytem-installed binary works ok, until I find a way that imagick reads those.
Comment: After losing a lot of time, this is for me the best answer for install ImageMagick for MAMP 3.4 on 2015..
Answer: Make sure you check out Joel Farris' answer if you're using an up-to-date version of MAMP

I finally managed to get it installed properly using Homebrew and the instructions here: http://egoco.de/post/23167969231/installing-imagemagick-for-php-and-mamp
I did have to run brew doctor and brew link a couple of times to fix dependencies (and change permissions on a file or two), and use
brew install php54-imagick

rather than the one mentioned at the url.
The extension he mentions at the end (the bit you have to paste in your different ini files) is:
[imagick]
extension="/usr/local/Cellar/php54-imagick/3.1.0RC2/imagick.so"

Hope it helps!
Comment: apparently the latest mamp pro version comes with imagemagick pre-installed, Check http://www.mamp.info/en/mamp-pro/
Comment: I had to run this before running the above `brew tap josegonzalez/php` `brew tap homebrew/dupes` as per http://stackoverflow.com/a/16064860/778669
Comment: I had to run `brew update` and clean up the whole thing before running `brew install php55-imagick`
Comment: Thanks, it really helped. I was failing on instruction by egoco.de, but your two lines of code fixed everything ;) Cheers!
Comment: if imagick is preinstalled on mamp then why can't i use it. i also use bluehost and it says it's supposed to be preinstalled as well but it still says not found. can someone PLEASE help me with this. it's driving me nuts
Answer: MAMP comes with Imagick installed. I have MAMP v3.2.1 (not MAMP Pro) running on OS X 10.10.3 (Yosemite).
I enabled imagick by editing php.ini file which comes with MAMP.
php.ini file is available on the following path:
/Applications/MAMP/bin/php/php5.6.7/conf/php.ini

Replace 5.6.7 with your php version number.
php.ini file will contain the following line:
;extension=imagick.so

Change that line to:
extension=imagick.so

Now restart the MAMP servers and you are good to go.
Answer: We made a Mac installer package here— http://www.cactuslab.com/imagemagick/
Comment: this installer is for ImageMagick only or also for the Imagick php extension?
Comment: Nice. Well, now I know if I ever need it again. :)
Comment: I just tried to use that and got "The operation couldn't be completed. (com.apple.installer.pagecontroller error -1.)"
Comment: Seems not to include the php extension.


How to convert Old Irish Latin script to Ogham?

Question: If you look on at an online Ogham Translator, it converts words like "crann" to ᚉᚏᚐᚅᚅ, which seems to be a letter-for-letter translation. The only guide I've seen to Old Irish pronunciation is this. But I would like to essentially go into the Old Irish Dictionary (or this if that is down) and convert it to Ogham. How do I do that? Is it literally letter for letter? Or is it somehow sound-based?
Comment: But also, have you read up at all on Ogham? Or on Old Irish phonology? Or on the Latin-script orthography for Old Irish? If you actually want to work with Ogham, reading any sort of overview, even just Wikipedia, would be a good start; as is I can't really tell if you've done any research at all before asking.
Comment: That second dictionary link looks like the entry for "Old Irish" in an English-Irish dictionary. As in, the Gaeilge/Modern Irish word for "Old Irish". You might want to find a different source.
Comment: You would also need to look at Primitive Irish, the language that Ogham was originally used to write, and it has a very different phonology from Old Irish.
Answer: It's not clear if you're asking for programming instructions: I'll assume you don't literally want to know "how do I do it". "áras" and "baithis" appear to be OIr words (as you correctly predicted, the dictionary site is down). If you consult this page of Ogham letters, you will see that there is no letter "th" (and, there is no "h"), and no letter "á". But there are some additional letters, the "Forfeda", like the letter ᚖ "oi". As Wiki suggests, some of those letters may be "early modern" – you decide if these are "proper Ogham".
On the face of it, it seems that Old Irish spelling has more information that can be expressed with Ogham. You would need to assemble the extant works written in Ogham. But then you probably should evaluate the works to determine whether it is the product of an online transliterator (I can submit the Gettysburg address and get back a bunch of automatic replacements). Perhaps you want to insist on only considering inscriptions found in the relevant ares up to the 9th century (or earlier?), excluding any neo-pagan "data". You can inspect the majority of the inscriptions in McManus A guide to Ogam, and read the related scholarly literature. An existing example is ᚉᚒᚅᚐᚂᚓᚌᚔ ᚐᚃᚔ ᚊᚒᚅᚐᚉᚐᚅᚑᚄ, transliterated as CUNALEGI AVI QUNACANOS "Cunalegi, descendant of Qunacanos". The main challenge is figuring out how to relate that to Old Irish spelling (which is like spelling in general in the era – a moving target).
Comment: What I wanted to know is if it is a sound-based language like runes, or if it's letter-mapped.
Comment: You mean writing system. What are two examples of letter-mapped systems that are not sound-based?


Just bought house with hairline diagonal crack from window

Question:
We just bought our house at the end of November here in Wisconsin. So weather is changing. Noticed this crack by the window. House is from 60s I believe. Should I be concerned? Or could this be from tempture change. This does stem from a large corner window with two windows near it too.
Comment: At least check the basement/slab for any signs of recent (or long term) water damage or heaving. Make sure downspouts are moving water away from the foundation. Is there 8' of snow on the roof? If all of these are no, just watch it, and follow eagles answer, Time to enjoy home ownership, congrats!
Comment: Thanks! There has been no real heavy snow fall. And no downspouts are on that side.
Answer: Probably just the house settling - could be due to:

Underlying soil conditions causing the house to rise or fall
Changes in seasonal humidity causing the window casing to shrink
Perhaps you didn't notice it until it got dark and cold so you're inside more
Moving in: if the house was empty, then filled with all your belongings, it can actually cause the house to settle.  Happened to my parents' house.

Probably not a serious structural issue (IANAL). If you patch it, make sure to use some reinforcing mesh to keep it from just cracking again.
Perhaps this question might also help.
Comment: It would make sense to accept the answer then, & Iron would probably appreciate it :)
Comment: Thanks! There was a 10 degree temperature drop around when we moved in so that makes sense.


Which tools is easy and good to design app for android and iPhone?

Question: I would like to design a app for android and iPhone. App will consist of min 10 text pages and search function at the top. which tool is better for designing such a app.
Thanks for help in advance.
Answer: If you're trying to create an app that will work on both platforms, the only real choice is to create an HTML5 Web Application (skinned for mobile devices) that can work offline.
If you need some guidance, I would check out:
Mobile HTML5 - Tutorial: Your First Mobile HTML5 App
The second part of the tutorial discusses how to make your app available offline.
Answer: Titanium Appcelerator seems to be a good way to do that


QImage Rotation without losing infomation

Question: I have a QImage of size 12x12 in GIF format. I want to rotate it on certain angle with very high frequency. My application involves a robot so when it changes its orientation(which it does very frequently) my QImage in simulation should also be rotated but it causes loss of information. I am doing it something like below.
<code> robot_transform.rotate(angle);
*robot2 = robot->transformed(robot_transform,Qt::SmoothTransformation);
*robot2=  robot2->scaled(12,12, Qt::KeepAspectRatio,Qt::SmoothTransformation);
</code>
I need suggestions that whats wrong in this approach and secondly is there any other optimal approach for the desired application?
Thanks
Answer: I would increase the resolution of the source image to at least double. Rotating an image to non-90-degree angles will cause loss of pixel information. An higher res source can compensate for that.
Most sprite based animations use pre-rendered images for each possible angle.
Answer: The problem is the scaling afterwards, you need to crop the center of the image. You can do this with QImage::copy.


wp_enqueue_scripts, wp_register_scripts, wp_print_scripts: i'm confused

Question:
I've been reading up a bit on this subject, but the more I read - the more confused I get.
Can someone explain to me in short what's the exact difference between wp_enqueue_scripts, wp_register_scripts and wp_print_scripts?
For example, I have the following code in my functions.php - and it's working, but I do not understand why I can not use wp_print_scripts for the stylesheets, whereas the code still works if I use wp_enqueue_scripts for the javascript files:
add_action('wp_print_scripts', 'add_my_js');
function add_my_js(){
    if(!is_admin()){
        wp_enqueue_script('default',  get_bloginfo('stylesheet_directory').'/js/default.js', array('jquery'));
    }
}

add_action('wp_enqueue_scripts', 'add_my_stylesheet');
function add_my_stylesheet() {
    wp_register_style('default', get_bloginfo( 'stylesheet_url'));
    wp_enqueue_style( 'default');
}

Answer: wp_print_scripts is the action that runs when scripts are output to the template. wp_register_script and wp_enqueue_script are functions for registering/enqueueing scripts to be output when wp_print_scripts runs.
you can't register or enqueue styles in the wp_print_scripts action hook because styles have already been output in the wp_print_styles hook, which runs before wp_print_scripts.
refer to the action reference to see the order things are executed in in a request:
22. wp_head
23. wp_enqueue_scripts
24. wp_print_styles
25. wp_print_scripts

Comment: wp_register_script registers the script with WordPress, but does not add it to the queue. If you don't also call wp_enqueue_script, the script will not appear. The purpose of this is to let you register your script once, then later conditionally enqueue it somewhere else in your code. This is useful for plugin developers where a script may be enqueued in multiple places within the code. You can also just enqueue your script directly without registering it.
Comment: So then, what is the difference between wp_enqueue_script and wp_register_script?


Trouble importing videos to iMovie from Canon Vixia HF R600

Question: I have a Canon HF R600, and when I open iMovie 10, I can see my camera listed, but there are no videos displayed. When I look on the camera, though, there are a bunch of files. Why aren't the files popping up?
Answer: If you open finder, look in the storage card instead of using imovie. Sometimes the camera makers store files in other directories than the one indicated for current images
If you can find the files, drag them to a desktop folder and try importing them from your folder instead of directly from the card. Once things are all saved, using the camera or the Mac to reformat the media usually clears up the multiple folder confusion.


Schema of unstructured data can be defined at query time

Question: I am looking for an example to understand the following statement:
Schema of unstructured data can be defined at query time
Answer: The statement "Schema of unstructured data can be defined at query time" sounds like a little bit of poor choice of words but likely eludes to the point that all data has a structure, even if it hasn't been defined explicitly yet (such as in a relational database management system).
In the context of NoSQL, an unstructured dataset such as JSON may not explicitly define things like the data types of the data itself, but the consuming applications of that data may define the schema of that data explicitly ahead of time such as when defining models to physically represent your data as objects.
For example, TypeScript is a JavaScript framework where you can define class files to store your model definitions that deserialize the JSON data into objects, such as when you receive data back from a restful web service. Furthermore, you can then persist that data into another database system, such as SQLite for example, where the schema is materialized with different (but compatible) data types. TypeScript has the number data type whereas you could store the same data in SQLite as INTEGER or REAL depending on what fits your use case.
The point being, there is no defined schema at the source of the data, but once it's queried and consumed in an application, it is possible to define one, or even multiple schemas that appropriately fit the shape of the data.
Additionally, some applications implicitly define a schema around the data they consume, for example, with an ORM, or with data migration tools. The purpose of an ORM is to literally define concrete models for a particular set of data. While most ORMs usually consume structured data, there are unstructured ORMs as well.


How to get the public key in form of JWS Key set

Question: I have a JWT Class which generates JWT Token using Private key. Now, I need to expose an endpoint for exernal application to get the public key in the form of JWKS KeySet.
Can anyone guide me how to achieve this scenario.
Answer: The JWKS is located based on a URL specified in OpenID Connect metadata. The discovery of OIDC metadata uses a special endpoint that Salesforce already provides out of the box and you won't be able to override it. Ship your public key to the other party via an out-of-band means or use Salesforce's out of the box support for issuing JWTs.
Answer: The Salesforce OpenID configuration exposes the JWKS information. Take this one as an example: https://de03-dev-ed.my.salesforce.com/.well-known/openid-configuration. Look for jwks_uri and follow that URL to https://de03-dev-ed.my.salesforce.com/id/keys. This will contain the key material you need.
Comment: The keys are only in RSA algorithm format


What are some good investment options for a foreigner in France who doesn't have a permanent residence permit or a French citizenship?

Question: I'm a non EU citizen living in France, with a work permit valid until December 2021. I don't have permanent residence permit yet, but will apply for it soon with a year or two. So I was wondering what are some good investment options (e.g. mutual funds etc. and others) in France that I can invest in now? I'd like to invest small, say 1000-1500€ at one time, or invest 100€ every month. Thank you!
Answer: Invest in an ETF that holds U.S. bonds, notes, or bills at short durations and that gets the investor both in-the-dollar and hopefully gets the three-month U.S. Treasury interest rate.
The reason for this sector selection is a current theme of slowing global growth but with Europe leading the concerns more-so than the U.S.
Then the reason not to go with longer durations is the worry of a large supply of U.S. Treasury securities coming to market. However, longer durations would ordinarily perform well in slowing economies. Avoid high-yield bonds at durations of more than six-months when economies are slowing. Concentrate on A-rated bonds.
Or put the investment in an over-the-counter Forex account that is based in Euros and hold an unleveraged dollar position as a sell-side EUR/USD currency pair. That gets the investor both in-the-dollar and gets about a 1.75% to 2% interest rate after commissions.
Also, gold is showing current strength.
Comment: Yeah, you are earning income in Euros and you might want to  hedge the Euro while  also finding an interest rate.
Comment: @S Spring: Thank you for your answer; I'm not a US or Canadian citizen (I've an Indian passport)-would this suggestion be equally applicable for me?


Knocking right underneath the valve cover?

Question: My engine was starting to make a loud knocking noise, so what I did, I turn the engine off, and I checked the oil, and the oil dipstick did not even register no oil at all? So I turned the engine on, and tried to hear where it was coming from? The loud knocking noise, was coming from one of the valve covers, right underneath it?
Comment: Have you filled the oil to the correct level?
Answer: Yeah so uhhhh the way knock usually happens is from having inadequate amount of oil. Like, little to no oil in the engine. If you pulled the dipstick and there was NO OIL on it, that maeans your engine is dangerously low on oil. Therefore why youre probably hearing that knocking sound. i dont know what kind of car you have, but you need to add oil to it asap. Sometimes, its too late to save it. Once knock starts, its not gonna go away without any sort of engine teardown and rebuild.


Are Holocaust records available online?

Question: I have a relative who is looking into her family history. According to her aunt many of her relatives on her father's side (Beinhorn) were victims in the Holocaust. Do records exist online that she might be able to search for them? (Their first names have been lost to history, so the relationships between individuals will be a key element to these records in order to piece the family history together.)
Answer: Not a lot of Holocaust records are online, but Fold3.com has a few and Ancestry.com has a partnership with the USHMM to index and put some online.  And keep in mind that many Holocaust records for some areas, especially the eastern front (modern-day Ukraine, Belarus, etc.) did not survive at all.  For example, the records for the Belzec death camp were destroyed.
I would recommend that your relative post her query, with as many names, towns, and dates that she knows, on one of the JewishGen.org e-mail listserves.  She should also contact Yad Vashem in Israel and see if they can help do a look-up in their files, only a small number of which are online.
Answer: The Yad Vashem site has a database of people who perished in the Holocaust. It includes records from the Gedenkbuch and individual pages of testimony. The data records include dates and places of brith and residence prior to deportation, and may also include names of parents and other biographical inorfmation. The pages of testimony are particualry valuable, as they are often submitted by surviving relatives, whose information may also be reported on the form.
Here are the search results for the Beinhorn last name. You will need to filter by location, as there are quite a few names.
Comment: The need to rely upon such "pages of testimony" in the absence of more usual sources brings into sharp relief the assumptions that we make (in other circumstances) about the reliability of second- or third-hand reports.
Comment: In my experience with such records, I found two main classes: one class, submitted by surveying relatives, and the other submitted by researchers. While these documents are not sourced, they certainly offer valuable guidance about where to seek primary sources.
Answer: Ancestry (working with JewishGen) has just made a number of Holocaust records available:
<code>Poland, Martyred Jewish Physicians, 1939-1945 (2465)
Germany, Bergen-Belsen Prisoners Liberated at Farsleben, Death Train From Bergen-Belsen, 13 April 1945 (2018)
Germany, Jewish Arrivals to Buchenwald on Jan 22, 1945 (2746)
Germany, Breslau Deportations of Jews, 1941-1942 (1845)
Lublin, Poland, Initial Registrations of Jews, 1939-1940 (6535)
Poland, Jewish Prisoners of War Registration Cards, 1939-1945 (2938)
Poland, Auschwitz-Buchenwald Transport, January 22 & 26, 1945 (4359)
France, Hidden Jewish Children, 1939-1945 (4080)
Krosno, Galicia, Poland, Jewish Inhabitants (3298)
Hungary, Hungarian Jewish KMSZ (Military Forced Laborer) List, 1938 (4497)
Poland, Riese and Gross-Rosen Prisoners and Transports, July 1944 (4806)
Romania, Tîrgu Mureş Deportation List, 1944 (4596)
Rovno, Ukraine, Victims Killed in the Kostopol Forest, 1942 (5166)
Poland, Forced Laborers in Borysław and Drohobycz, 1939-1944 (4971)
Poland, Częstochowa Forced Laborers, 1943-1944 (4610)
Arad, Romania, Jewish Census, 1942 (9698)
Belarus, Jewish Partisans, 1941-1944 (8451)
Poland, Lódz Ghetto Work Identification Cards, 1940-1944 (13280)
Liepaja, Latvia, Holocaust Memorial Wall (6428)
France, Jewish Deaths During Deportation, 1941-1948 (7346)
Switzerland, Jewish Arrivals, 1938-1945 (21730)
JewishGen Yizkor Book Master Name Index (17306)

New York, American Jewish Joint Distribution Committee, Remittances for Russian Jews, 1916-1917 (98)
New York, American Jewish Joint Distribution Committee, Remittances for Polish Jews, 1915-1918 (2396)
New York, U.S., Jewish Joint Distribution Committee, Remittances for Romanian Jews, 1917-1918 (149)
Lithuania, Jews Saved by Passports From the Japanese Diplomat Chiune Sugihara, 1940 (2140)
Germany, Women in Flossenbürg Branch Camps (Hans Brenner Book Lists), 1944-1945 (15842)
Kisvárda, Hungary, Records Before Deportation, 1944 (3516)
Germany, Dachau Inmates, Possessions Upon Entry, 1933-1945 (2839)
Germany, Deaths in Mühldorf, Nov 1944 - April 1945 (1857)
Łódź, Poland, Vital Records of Jews in the Łódź Ghetto, 1939-1944 (61502)
</code>
The numbers in brackets are the number of records in each dataset.
Comment: Thank you for this update. My relatives ancestors originated in Hungary, so I'm guessing the KMSZ is the most relevant.
Answer: You may have more success a few years from now than you would have now. A wealth of documentation has become available only since archives in the former Soviet bloc nations began to grant access to Israeli researchers.
In 2004, Yad Vashem had approximately 2.7 million names. Today it has 4.2 million. They expect the 1.8 million or so names that are still unknown are likely to be found in the archives they can now access.
Yad Vashem is copying all the documents, including passports and records of building superintendents.
See the Jerusalem Post April 5, 2013 article about this. The article did not state how much of these records will be available online, but it is obvious that the Yad Vashem will soon be the best place to go for Holocaust records.

Are Holocaust records available online?


How often is PhD work linked to life after the PhD?

Question: So I am currently a Master's Student in an earth sciences field, looking to get into the PhD program at my university, provided that there is funding. My current adviser likely won't have funding for my PhD. Recently, my adviser told me about an opportunity with a different adviser, working on a topic in life sciences with an influence of earth science, but one which I may be qualified for. If I do this, is it likely that I can find jobs/postdocs in earth science, where my true interest lies, or would I be irreversibly altering my career path for life science?
Comment: Is there life after a PhD? :-)
Comment: I think this is impossible to answer without detailed knowledge of the field, the exact research topic and other specifics.
Comment: @MassimoOrtolano: Gods above I hope so :)
Answer: It depends on the exact topic and what guidance the new research group will offer you. There's plenty of opportunities to develop expertise in life sciences during PhD. Your options after may not be as limited as you perceive. There is a lot of demand for collaborative and interdisciplinary researchers both in academia and industry.
I'm doing an interdisciplinary PhD between stats and genetics. While on paper you do have to enrol in one course and will be assessed on it. In practice, you can lean on the other field. For instance, with the methods I use. My research questions are biological but my methods differ from lab trained biologists.
You ought to still have room to develop your earth science skills in this way, particularly if your new research group collaborates with people in your field that can advise you on those aspects. You should have a wider range of an advisory committee and peers to assist you with work in both disciplines. A PhD is also an independent project, especially near the end, you should be able to build up confidence ants negotiate using some of your current skills if they tie in the research topic cohesively.
In short. Consider it, it may not be a one way track to biology. It's also not too late to apply to other labs.
Answer: It doesn't seem you have a choice, does it? Your situation is

life science: no PhD
earth science: possible PhD

Unless you have other options, this question is meaningless. Because if you want to do a PhD, you have to do earth science anyway, even if it means your career is irreversible.

My suggestion is you should apply for more PhD programs in life science, do not limit yourself to your current university. Applying for a PhD takes time, I heard that it takes years in some cases.

However, if you end up doing a PhD in earth science, remember that:

As a Master's student, it maybe too early to decide what you like. People often like what they understand the most, you may like earth science if you dive into it.
Andre Geim had changed subject 5 times before getting the first tenured position.
Comment: _My suggestion is you should apply for more PhD programs in **life** science_ Did you mean earth science?
Comment: @qsp , I think you got the question wrong-as far as I see it, it's *probable* PhD in earth science vs. sure PhD in life science.
Answer: @BarocliniCplusplus , I can totally relate to your problem because I have been faced with a problem very similar to yours myself. When I was in my masters program I had research interests of my own and I managed to prepare an entire research grant proposal even in my masters in a field which was both promising and underexplored. As we use to say in my country "on paper" my proposal seemed like a very unique idea and had great potential to answer fundamental questions about the entire field I graduated in (I'm a graduate in life sciences), if not for all science in general. However, when I had to begin the actual work to build up my PhD thesis and work on the topic I choose I started to face a great deal of problems-both in the "pure" scientific sense as ever more and more research was needed to expand my initially very specific topic and in terms of funding for the experiments I was proposing and finding proper guidance, so in one point in time my initially "top score" expectations turned out to "bog into" an ever more difficult and more difficult challenges-both as scientific problems to solve and the inability to cope with the funding at hand.
It got so hard that I was forced to quit and abandon my research interests because there wasn't anyone in my country who was willing to fund such research even if the prospects were mind-boggling. I wish to give you this as an example as to what can happen if you just "pursue your dreams" and hop into something you know very well and have everything you need to expect you can excel there. Sometimes life just doesn't work like that no matter how good you are and how great are your ideas. If not for the lack of ideas people can stop you for the lack of funds if they dismiss your qualifications. And this happens all too easily. For example, I know for at least two other students in different countries working in my field or similar to it which were "cut down" not for the lack of ideas or prospects but simply because their peers felt it would be better to spend the cash somewhere else.
What I would suggest you is to find some good program you can get in even if it's only "remotely" related to your interest and to get a hold on some field even if it isn't related to your ideas per se. Time will pass and you would come to understand it's the best option right now. If you risk it all because you know your field (I assume you have already reach an expert's status in it) I can tell you from personal experience the chances are higher to drop out, than to actually succeed. And if you drop out you might have very hard time getting back in. It was almost 7 years for me and I still am not able to get back on the research path. I decided to answer you like that because I actually have some personal experience with trying to pursue your own agenda because you have simply grown so knowledgeable that you may know your field better even than your professors, but, please, believe me, knowledge doesn't always "count in" when the actual research in the PhD starts and there are zillions things that can go wrong any time no matter how much you know it. It's just better to be a part of a team of someone who has more experience than you do and to hope his/her advice will get you through the program.
So, my advice derived from personal experience is that you should enroll in the program you know has funding and prospects even is it isn't what you have hoped for rather than getting "stucked" in a field you like but obviously has not enough funds. Even if you turn out to be live scientists, rather than earth scientists it would be better than being no scientist at all! I would advice you that altering your career path is better than not having one at all which could happen if you try to "pressure" (if you even can) the people around you to pursue what you are really good at. Please, take this personal story into consideration.
P.S. In the end I would like to cite the popular saying: "If life offers you lemons, make lemonade." I know it may not seem to be very good choice as you see it now but it's better than nothing which may be what you will get if you try to pursue your own research interests. But, ultimately, it's your life-take a deep breath in and think thoroughly how you want to end up living it risking for a PhD in earth science or getting the "safe heaven" of life science. Nobody but YOU knows the answer. I think this is the best advice anyone can give you.


Is impedance the ratio of voltage to current at any instant?

Question: My book defines impedance as the ratio between the amplitude of voltage to that of the current (Vmax to Imax), I just wanted to make sure whether its also true for the instantaneous values of voltage and current.
Comment: I thought that too at one stage, but thats not actually correct. It is indeed V/I. dV/dI is not consistent with devices such as capacitors, and only works for resistors (because they are linear with respect to V and I). This is by convention.
Comment: It is not even true for dc voltages and currents. $Z=dV/dI$ not $Z=V/I$.
Answer: Wikipedia states

In quantitative terms, it is the complex ratio of the voltage to the current in an alternating current (AC) circuit.

https://en.m.wikipedia.org/wiki/Electrical_impedance
Answer: Impedance expresses a linear response relation between current and voltage, but is usually considered only for fourier-transformed voltages and currents. I.e., it is a complex function $Z(\omega)$ so that:
$$V(\omega) = Z(\omega) I(\omega).$$
The proper real-time analogue would not be the instantaneous ratio of voltage to current, but rather a relation that is nonlocal in time:
$$ V(t) = \int_{-\infty}^{+\infty} dt'\, Z(t-t') I(t'). $$
This $Z(t-t')$ function would be the fourier transform of the $Z(\omega)$ function. And so you can say "If a current pulse of duration $dt'$ is applied at time $t'$, what is the voltage at another time $t$." The ratio of the voltage to the current is this nonlocal impedance $Z(t-t') dt'$.
Answer: It is indeed the ratio of $V_{max}$ to $I_{max}$ but only when you are talking about a sinusoidal voltage source and a "linear" component. For example, consider the charging curve of a capacitor:

It would be incorrect to assume the impedance of this circuit is just $V_{max}\over I_{max}$ as this circuit behaves in a little bit of a more complex fashion.
How to think about this
It is probably easiest to understand this with a rotating phasor, for devices such as capacitors, the voltage and time at any instant have to be related by:
$ I = C {dV\over dt}$
You can get the impedance easily by imagining your circuit with a sinusoidal voltage input. If you imagine voltage as a rotating vector in the complex plane, then the current will also be another rotating vector in the complex plane. Here, impedence is the ratio of the lengths of these vectors.
Now since any fourier transform can be thought of as a sum of complex phasors rotating at different frequencies, then you're fine to just consider the case of a single rotating phasor.
Summary
This is therefore not true in general, the instantaneous value of the voltage over the current does not always give you impedence. For example, the charging capacitor above certainly shouldn't have zero impedance as time approaches infinity :)
Hope that helps.
Answer: In electrical circuits impedance $Z = \dfrac {V_{\text{peak}}}{I_{\text{peak}}}$ or $\dfrac {V_{\text{rms}}}{I_{\text{rms}}}$
If $I = I_{\text{peak}} \sin \omega t$ and $V_L = L \dfrac {dI}{dt}$ then $V_L = \omega L I_{\text{peak}}\cos \omega t = V_{\text{peak}} \cos \omega t$
This gives $Z = \omega L$
However look at the ratio of the instantaneous values one gets
$\dfrac {V_L}{I} = \omega L \cot \omega t$
which is certainly not constant.