Time required to train a model based on features shape and CPU capacity?

Question: How to estimate the time required time to train a model, given feature shape, CPU/GPU sepcs and type of model
Answer: There is no answer to that question because besides model parameters, hardware specs and dataset size, there is also the question of the difficulty of the problem, which is not quantifiable.
An easily-solvable problem can require fewer epochs for the model to sufficiently converge. Take for example two image classification tasks:

The first is ILVRC which contains around 1m images.
Another dataset that contains 1m red and green images (just pure red and pure green).

Both datasets have the same image dimensions, the same number of images and will be used to train the same model on the same computer. Even though these tasks seem identical, the latter is much easier to solve and will require only a few iterations (i.e. a few seconds). The former is harder and could require 2-3 weeks.
Due to this huge difference caused, solely, on a non quantifiable characteristic of the dataset, there is currently no way to tell how long a model will require to train.
Furthermore, due to the stocahasticity of the training process, two identical models might take different times to converge, even on the same dataset (due to different initial conditions).
Note: what you can estimate is the time it takes for each epoch if you know the model (number of parameters, choice of certain hyperparameters), the dataset (features, samples) and the hardware.


When neigbour solicitation and router solicitation are used to get the IPv6 address, then what is the role of 0:0:0:0:0:0:0:0/128?

Question: I am learning computer networks, but getting confused each time I proceed my analysis. Kindly help. Thanks in advance!
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
Answer: That is the IPv6 unspecified address, and you use it when you do not know an address or have an address. The IPv6 unspecified address (<code>::/128</code>) is explained in RFC 4291, IP Version 6 Addressing Architecture, Section 2.5.2. The Unspecified Address:

2.5.2.  The Unspecified Address
The address 0:0:0:0:0:0:0:0 is called the unspecified address.  It
must never be assigned to any node. It indicates the absence of an
address. One example of its use is in the Source Address field of any
IPv6 packets sent by an initializing host before it has learned its
own address.
The unspecified address must not be used as the destination address of
IPv6 packets or in IPv6 Routing headers. An IPv6 packet with a source
address of unspecified must never be forwarded by an IPv6 router.
Answer: there are at least two uses of the "unspecified address" that I am aware of.
Firstly before assigning it's first (link local) ipv6 address a node is expected to perform duplicate address detection. To do that it must send a neighbour solicitation packet but it doesn't have any address yet.
Secondly the address is used as a wildcard in the "sockets" API for an application to tell the OS that it wants to listen on all addresses.


Is there a verse in the Vedas that confirms the existence of the Para-brahaman in materialistic form?

Question: I'm looking for a source from the Vedas and not from Purana and Upanishads about confirmation of the existence of Para-brahman in Materialistic form.
Comment: Quite the opposite. The Upanishads give the sequence of creation from Parabrahman. Gross Materials are at the end and are a combination of the fine elements.
Comment: @MIKEYSINGH - In your question you want verses from Vedas and not from puranas or Upanishads. But you are saying in your above comment that you need from both.
Comment: @SwamiVishwananda Please mention the verses with translation and name of upanishads as well.
Comment: If we view the concept of of **brahman** in pure Spiritual sense, then we can say "Yes, there is confirmation of Existence of Para-brahman in Materialistic form"
Comment: @SwiftPushkar Nope, I do need verses with translation from Vedas nd Purans both.
Comment: @SwiftPushkar Basically, i need it from vedas as per i have seen already many from purans. In above comment my aim was just to get both verses from Ved and Puran as well.
Answer: We have to understand the core of SPIRITUALITY  carefully.
Mundaka upanishad 3.2.9 says as follows:

स यो ह वै तत् परमं ब्रह्म वेद ब्रह्मैव भवति नास्याब्रह्मवित्कुले भवति
। तरति शोकं तरति पाप्मानं गुहाग्रन्थिभ्यो विमुक्तोऽमृतो भवति ॥ ९ ॥
sa yo ha vai tat paramaṃ brahma veda brahmaiva bhavati
nāsyābrahmavitkule bhavati | tarati śokaṃ tarati pāpmānaṃ
guhāgranthibhyo vimukto'mṛto bhavati || 9 ||
He who knows that highest Brahman becomes even Brahman; and in his line, none who knows not the Brahman will be born. He crosses
grief and virtue and vice and being freed from the knot of the heart,
becomes immortal.

So one who REALISES, but not understands, BRAHMAN becomes BRAHMAN.
Sages like Vamadeva, Viswamitra, Vasistha, etc, in that era, and Sages like Sri Ramakrishna Paramahamsa, Sri Ramana Maharshi, etc, of our era REALISED the BRAHMAN and thus they are BRAHMAN by themselves.
This is existence of Para-brahman in Materialistic/Human form.

Coming to the issue of reference to the Veda, where such mention was made, we can refer to Rig Veda IV.26.  The rishi is Vāmadeva Gautama
What did he say?

अहम मनुर अभवं सूर्यश चाहं कक्षीवां रषिर अस्मि विप्रः | अहं कुत्सम
आर्जुनेयं नय ॠञ्जे ऽहं कविर उशना पश्यता मा || अहम भूमिम अददाम
आर्यायाहं वर्ष्टिं दाशुषे मर्त्याय | अहम अपो अनयं वावशाना मम देवासो
अनु केतम आयन || अहम पुरो मन्दसानो वय ऐरं नव साकं नवतीः शम्बरस्य |
शततमं वेश्यं सर्वताता दिवोदासम अतिथिग्वं यद आवम ||

I became Manu and the sun. I am Kakṣīvant, the inspired seer. I steered myself down to Kutsa, the son of Arjuna. I am Kavi Uśanā. Look
at me!
I gave land to the Ārya; I (gave) rain to the pious mortal. I led the bellowing waters. It is my will that the gods followed.
I, in my exhilaration, broke apart all at once the nine and ninety fortresses of Śambara, and the hundredth, his dwelling place, to
complete it, when I helped Divodāsa Atithigva

Why did Vāmadeva Gautama say that

I became Manu and the sun?

I gave land to the Ārya; I (gave) rain to the pious mortal?

I, in my exhilaration, broke apart all at once the nine and ninety fortresses of Śambara?

It is because Vāmadeva Gautama became the BRAHMAN and thus he was speaking as if HE did it all.
This is existence of Para-brahman in Materialistic/Human form.
However, we should not expect the BRAHMAN to take form of the Gods that we are accustomed to , ie., Vishnu, Shiva, Devi, Ganapati, etc, and live among us.


A CMS on 2 DIFFERENT frameworks?

Question: I'm not sure if this is possible, but let's say you want to build a CMS, but you're torn between 2 frameworks because each has some features that you like. Is it possible to create the CMS with both framewoks? Does this approach have merits or pitfalls?
Comment: Using an MVC and/or ORM pattern from one, and templating engine from another, yes, I can see that happening. But with the exception of Zend most frameworks don't really play that well together / aren't made of real independent components. I would be more inclined to go with the _best fit_ framework, and try to integrate the features I miss into it myself, possibly offering it back to the framework of choice if I deemed the features interesting enough & had the time to properly work it out & document it.
Comment: it depends on the frameworks; which two are you torn between?
Answer: Speaking strictly about the Zend Framework (ZF) I would say yes. ZF components are written to be as independent from other components as possible. I would say that it would not be very difficult (It may actually be quite common) to integrate libraries of ZF into other frameworks like Cake, Symfony, or Codeigniter.
Answer:
Is it possible to create the CMS with both framewoks?

While it's possible to use components from the Zend Framework inside other Frameworks / CMSs - this may be the case with other component libraries as well, but Zend's the most modular one that I know - It's usually not a good idea to mix two full-blown Frameworks.
Many central functions like MVC structures, URL routing, the database layer, Unit testing, error management and so on are by nature unable to be served by two frameworks at once without massive friction. Also, you're likely to get problems when one of the frameworks needs to be updated.
I would recommend to pick the framework that covers most of what you need, and try and add the missing features using plug-ins or own modifications.
Answer: Your question is too abstract.
For instance Zend Framework is more to be a library of specific functionalities ready-to-be-include into Your codebase then some closed development environment like for instance Symfony framework.
Thanks to it can be ZF simply included into your codebase (and Symfony too).
Symfony Framework compared to it is closed solution depending on front server environment so you cannot use it like some other framewor's slave.
Answer: The composability of most frameworks is such that that is most likely to give you all the disadvantages of both, while simultaneously eliminating most of the individual advantages of both.
Answer: Of course it is possible and I don't see something wrong with it. For example I used CakePHP and Zend on a relatively large Project which was kind of a cms. CakePHP for the core (Routing, MVC) and Zend for some "Modules". Mainly for PDF, E-Mail (smtp), FTP and a few others that CakePHP was not that good at. With Cake it was fairly easy to use ZF components and didn't feel hacky at all.
In fact, ZF was written to be as independent as possible, so that you can use any component at any time anywhere. Yet, it would not work the other way round (Using ZF as core, and Cake components). Surely it is possible, but a real pain with no benefits. So ZF could be used propably inside of pretty much any other framework and nothing would be wrong with it, imho.
Answer: You can do it. Most modern frameworks (Zend, symfony, flow) is capable to use parts of other frameworks. Symfony 2 uses Zend Logger, flow3 uses sfYaml... It is possible tu interchange some components.
But, imho, you should stick to one framework as a core, and use second only to relatively isolated subsystems. Adapter and Facade design patterns can help you to mix them together - some components / clases demands some wrapping before use in non-native environment.
For further reading: http://www.symfony-project.org/book/1_2/17-Extending-Symfony#chapter_17_integrating_with_other_framework_s_components
Answer: It would really depend on which  things you liked about both...
Zend Frameowrk is more like a library, so you can pick and choose components from it.  Symfony also has some re-usable components you can use.
Really, you can do anything... it just depends how much work you want to do, and how willing you are  to modify the framework code.  Note: most other PHP frameworks are not nearly as flexible as Zend Framework (next up probably being Symfony).
This sounds very messy, so I'd advise against it, unless you use it in the fashion I've described above.  It's easy to pull ZF or Symfony components into other frameworks, but not the other way around.
Hope this helps.
Answer: It seems to me like one framework will for serve as the core - bootstrapping, MVC stack, routing - while the other will be used to pull in specific functionality - like classes for forms or filtering or interacting with web services, etc.
As much as I prefer Zend Framework for the core - and most everything else - its use-at-will architecture argues for making the other framework the core and pulling in ZF components where you need them.
As @Adrian notes, it's easy to pull in ZF components into a project built primarily on another framework, since ZF is designed with that flexibility in mind. Other frameworks are less accommodating in this regard.

A CMS on 2 DIFFERENT frameworks?


dark brown stains in the bottom of a toilet

Question: a rental toilet has a dark clay looking stain in the bottom of a toilet that the renter was unable to remove.  At first I thought it was very hard water, however, there was no evidence of stains in a second bathroom or any other fixture.  There is evidence of cat litter in the area and I was wondering if cat litter could form a tough clay layer in the bowl?  Also, if cat litter is in the toilet, could it be in the drain piping and be a problem waiting in thwings. Can anyone suggest a way of removing from the bowl?
Comment: On the chance that it's actually rust and/or minerals, try turning off the feed valve and then flushing to empty the bowl.  Then see if CLR makes a difference.  You can lay paper towels against the bowl, wet them with the CLR, and let them sit for awhile (the paper towels will hold the CLR in contact with the stain).  After maybe half an hour, use the paper towels to wipe the stain and see if it comes off.  If it lightens it but doesn't completely eliminate it, repeat the process.
Answer: My mother had a cat and dumped the cat liter down the toilet. At 90+,She would sometimes forget to flush the stuff and it would cake like that. When I would find it I would use a stick to dislodge what I could, and  After much use it would dissolve and be gone.
Answer: Cat litter is typically bentonite clay, so even if it has settled to the bottom & stuck to the surface it should be possible to remove it as it won't harden & set while under water (unlike cement).
I'd try using some sort of hard plastic spatula-like impliment to scrape the bulk off, followed by a vigorous scrub with a stiff-bristled toilet brush.
As for the rest of the drain plumbing ... if it is clay cat litter and it has settled somewhere inaccessible - you may well have a potential problem brewing.
You probably won't know until something gets stuck somewhere (or you go to the trouble of pushing an inspection camera down the pipes).
Answer: If the toilet is older, maybe it does have hard water build up because the porcelain isn't as protected as the other..more porous possibly from years of abrasives. Just a thought. I have the same issue and will try Fixer1234'method.


Will the Japanese version RWBY remake the animation or just be changing the voice actors and actresses?

Question: I saw this and read on the news that RWBY was going to be dubbed by Japanese. I was wondering if the Japanese version would remake the animation, like anime style, or use the original animation, just replacing the voice actors and actresses. Does anyone know an article or a thread regarding this matter?
Comment: Reading the article, since it just said dubbed, i doubt they will be touching anything regarding the animation. Dubbed usually means they just swap out the voice acting. There has been cases where "sensitive" subjects that the ATF frowns upon gets swapped out during localization, though. Even in that case, its censoring, rather than wholesale remakes. If anything to that extent was going to happen, I'm sure they'd mention it.
Comment: Sorry for that. I forgot to change it. Anyway, so the entire volume will be redubbed in Japanese, having two different versions?
Comment: Your first link is to an [unofficial Japanese dub project](https://www.youtube.com/playlist?list=PLSH7ruLqwsMHbUUg0WEYI6N1DZRMlhUSs). It's more likely this would be a localization (same content, different voices) than a new release... but who knows? Given that this is a BD release it's possible that there would be some touch up here and there for HD.
Answer: I have compared the animation and dialogue in the English and Japanese versions of the first episode of RWBY ("Ruby Rose"). The dialogue and voices have been set to match the flaps of the character's mouths rather than the other way round.
The dub is purely audio, no animation changes were made. This is typical of most localisation dubs both in the western world and in Japan also.


Are states affected by federal law before admission to the union?

Question: I was curious whether a territory would be affected by federal law before it was ratified as statehood. For example, if a federal law passed in 1934, would it impact Hawaii which was admitted on August 21, 1959?
Comment: This might be a better fit on the [Law SE](https://law.stackexchange.com/).
Answer: The answer to the question in the title is "it depends"; the answer to the question in the body of the question is "yes" see below.

"New states have generally been admitted after a period of territorial government, during which Congress and the President have broad authority pursuant to the Property Clause, also in Article IV, Section 3. An Act of Congress established the territorial government, often giving greater self-government (e.g., in the form of an elected territorial legislature) as the territory's population increased over time. Some states, however, such as California and Texas, have been admitted without ever being territories."  ConstitutionCenter.org

If a territory is administered by the Federal government, then Federal law applies. If a territory is admitted without having been administered as a territory, then, no.

Spurred by the nationalism aroused by the Spanish-American War, the United States annexed Hawaii in 1898 at the urging of President William McKinley. Hawaii was made a territory in 1900, and Dole became its first governor. state.gov

Hawaii, administered as a federal territory, would have been subject to Federal law
Comment: Very clear, thank you!
Comment: @MCW  Your answer is flawed.  Residents ofmMunicipalites are subject to the laws of the counties they are in. Residents of counties are subject to the laws of the states or territories they are in.  Residents of states and territories are subject to the laws of the federal government.  You seem to have interpreted the question as asking whether territories would be exclusively subject to federal law and not have any legal system of their own before becoming states.
Comment: @MAGolding - That sounds like the basis of an alternate answer. I'm not sure which of us would be closer to OP's actual intent.  (Although I think I agree with your conclusion, I don't agree with the analogy, but I suspect that is an artifact of comment compression)
Comment: another reason would be that the territory would likely spend the time before officially becoming a state to bring their own laws in line with US law, thus making its law over a period of several years become more and more in line with US federal law.


Concept and usage of social abuse

Question: If I say to an individual, who belongs to a higher social caste, that I will not help him but only those who are socially outcast and downtrodden, will it be considered as an abuse to the higher caste?
Comment: What kind of [abuse](https://en.wikipedia.org/wiki/Abuse)?
Comment: What is an *higher caste* ?
Comment: To clarify, are you asking whether this *will* be considered an abuse? If so, by whom? (Would this question be answered by philosophizing about it, or by public opinion polling, or...?) Or are you asking whether it *ought to be*, or *would rightly be* considered such?
Comment: To add to AlabamaScholiast's comment, if the person who is considering the act as an abuse is, in fact, the person that you did not help, they are highly likely to consider it to be abuse.  Caste systems have a tendency to enforce this sort of thinking, so its statistically likely the particular caste system in question will do so.
Answer: You need more context.
If you are giving a gift, it is completely fair to grant it to someone who is more in need.
But ethical action isn't always best modelled on gift giving. Should you "help" a higher caste person who had collapsed in the street? Of course.
One thing I really dislike is when people treat ethics like a zero sum game, so that any injury to someone belonging to privileged group helps those in an under privileged group. Not least because it always seems the marginalised within the former who lose out (white, but disabled and working class).

My answer was accepted already, but I had something to add, about an ethics of care. I agree that we should "care" for those that have a claim (be that due to our moral duty or something else) to that. It seems natural to suppose that the underclass have more of a claim for our kindness, but that needn't end up in abuse of anyone else.
Answer: Almost certainly not. You are talking about positive discrimination, or affirmative action. Different jurisdictions have different frameworks for what is allowed. But the core principle is correcting for past discrimination, is not discrimination.
See the discussion here for a detailed answer: Paradox of resolving discrimination

"A society that has done something special against the Negro for
hundreds of years must now do something special for the Negro." -
Martin Luther King
Comment: This answer relies on the implicit assumption that it is groups rather than individuals who are abused. This is not only a false assumption, it is an evil assumption. It is the very assumption that led to the mass murder of the Jews by the Nazis and the mass murder of the Kulaks by the Soviets. It makes history a never-ending war of tit for tat. Are Christians justified in attacking Muslims because 1400 years ago, the Muslim raped and pillaged their way through the peaceful Christian lands of the Middle East, North Africa and Spain? Reject identity-based ethics. It is evil.
Comment: I didn't suggest that anyone pretend racism doesn't exist. I said that racism is always evil, even when it is retaliatory racism.
Comment: @DavidGudeman: Pretending racism doesn't exist, will not end racism.
Comment: if you mean refusing to help some but not all privileged people in need, that's very different to helping the downtrodden more. our moral choices are not a zero sum game

Concept and usage of social abuse


"has [been/gone] there for three days"

Question: As we know the meaning of (has/have been to) is he or she came back.
So, how could we say the following?

She has been there for three days

I think it is wrong to say so. We should say

She has gone there for three days

Which one is right ?
Comment: Possible duplicate of [difference between "been" and "gone"](https://ell.stackexchange.com/questions/185984/difference-between-been-and-gone)
Comment: They're not similar .. Read the 2 questions first.
Comment: @LeeMac your answer in the linked question is incomplete, and in any case doesn't apply to this situation where the person is still wherever she has gone to.  Moreover it doesn't address the grammatical mistakes in Karim's question.  The close vote is not justified.
Answer: "Has been there/here" does not always imply that the person is no longer at the location. For example:

A: Is your father at home?
B: Yes, he has been there all day.

or

A: Have you been to this restaurant before?
B: Yes, I have been here. I came here last week.

In the first example, the father is still at home and has not left. In the second example, the person was at the restaurant last week, left, and came back.
The present perfect expresses a past event that has consequences right now. You can say that someone has been somewhere both if they have gone there and come back and if they are still there.

However, your example with the verb "gone" does not work. When someone goes somewhere, the action ceases once they arrive. Therefore the below example would imply that the woman has gone to the destination and then returned (or at least gone somewhere else) on each of the three days.

She has gone there for three days.

would be better written as

She has gone there every day for three days.

The sentence most certainly does not mean that she arrived three days ago and has remained there the entire time.

“has [been/gone] there for three days”


How do the names of methods affect execution of test cases in robotium?

Question: How do the names of methods affect execution of test cases in robotium?
Answer: Robotium seems to execute methods in a test class in alphabetical order. So if you precede the name of the methods by something like "test1...", test2..." etc, you can determine the proper order. However, the order should not matter for your test results. If it does, then your tests are not independent.
Comment: test1, test2, etc are not descriptive names.
Comment: No, they aren't. Feel free to use more descriptive names. Also, I said "prefix your methods by ..". I use things like test1LoginUserToServerApi, and test2RegisterUserWithFancyDescriptiveName, etc.
Answer: Methods prefixed with the name "test" are considered tests and are executed in alphabetical order.  This is actually a functionality of JUnit, which the Android Test Framework is built on top of, and doesn't have anything to do specifically with Robotium.


Ubuntu 16.04 booting to emergency mode after updating windows 8.1 to windows 10 in dual boot

Question: I updated my windows 8.1 to Windows 10 and then the grub menu was not appearing, it directly booted to Windows 10, I tried in cmd with this code
( bcdedit /set {bootmgr} path \EFI\Ubuntu\grubx64.efi )
It didn't work and then I installed Easy BCD
And it worked but when I try to load ubuntu it loads to emergency mode and I have tried systemctl reboot an systemctl default but again it opens in emergency mode. What should I do?
Answer: Make sure you turned off fast boot in Windows 10. Windows 10 enables this setting by default, but this causes Ubuntu (in my system!) to boot into emergency mode.
It's available in the power settings of Windows 10.
I hope that helps you out!
Comment: Did that, it's still the same


Specifying redirect_url when contacting salesforce rest api

Question: I'm trying to contact the salesforce api from my rails app. I use omniauth-salesforce gem for oauth. When I'm initializing the OAuth2::Client, my options hash looks like below
{ :site => 'https://login.salesforce.com',
:authorize_url => '/services/oauth2/authorize',
:token_url     => '/services/oauth2/token'
}

Now, since my redirect url is dynamic, I would like to add that to the options hash when contacting salesforce, so it can pick up this dynamic url and send the access token back to this URL. Please let me know how to add this.
Answer: Please have a look on the Force.com REST API toolkit. It contains the sample HTML Page which shows the way of passing the redirectURL. You can also see more details @ http://wiki.developerforce.com/page/Getting_Started_with_the_Force.com_REST_API


Does high accuracy metrics with small (but equally sampled) dataset means a good model?

Question: I have been training my CNN with 200 images per class for a classification problem.  There problem is a binary classification one. And with the amount of test data ( 25 per class) I am getting good accuracy, precision and recall values. Does that mean my model is actually good?
Answer: You can do a crossvalidation to be sure your testing set is not just very easy to classify.
If it is possible, you could try to augment the size of your training set by doing some rotation, shift, flip ... If you are using Keras, you can read this blog.
Comment: I have already did a cross validation by switching the training and test data independently in multiple runs. I should not do augmentation due to some internal restrictions regarding frame position.
Answer: You could read some papers about problems with small dataset like this one https://arxiv.org/pdf/1611.03199.pdf:

Recent work has demonstrated that standard machine-learning techniques such as random forests and simple deep-networks are capable of learning meaningful chemical information from only a few hundred compounds

Although this example isn't about images (I recommend you to look over medical problems with images and cnn), as you can find, such challenges are wide spread in different fields, where it's difficult to get sufficient amount of labeled data (medical problems for instance). The idea is that it's possible to create appropriate model and judge about the quality of it's performance. And if the target field of the further usage of your algorithm has the same data representation, it's quite possible that your model is good enough.
Comment: You could share some more details about the classes of your images and size of it.


Convenient Way to Turn an Apple Note to EPUB

Question: Recently I have converted one of my iCloud notes into an EPUB by first copying and pasting its content to Pages (by parts, since the entire content was not willing to be copied for some reason), then by manually designating all the headers as Pages headers (to get the table of contents working), and then by using the Pages "Export to EPUB" option. This was a lengthy and unpleasant procedure. Is there a better way to turn a note into an EPUB? By the way, I specifically need to have all the images from the note in the resulting EPUB document.
Comment: The issue here is converting from Notes to anything - I suspect the easy answer is to start writing in something else (e.g. Pages) not notes.
Comment: My guess is that you'll need to use something like calibre & calibre command line tools. My issue is that the notes app is just hard to control – it seems like you don't have a lot of options in terms of getting contents of your files. You can't "save as" or anything like that. All you can do is copy&paste or export as a PDF. I tried converting the exported PDF to epub with calibre, but only got mediocre results. What's the downside of a PDF (so I can think of other solutions)?
Comment: @TalosPotential For me, the main downside of an auto-generated PDF in Notes is its font size - if I generate my PDF on iPhone, the text size will be too huge to read, and if I generate it on Mac, the font size will be too small to read on iPhone.
Comment: There is a 3rd party app to convert all your notes to text files.
Comment: The downside of pdf is that it copies what it looks like on papaer and loses all information about formatting if you chnage the size of the paper/screen. epub is html so you can resize fonts change the screen size etc without losing information.
Answer: Sorry you had challenges with the copy to pages. In my experience, the content from the note to Pages is generally excellent and one step. Pages has EPUB export capabilities and has taken over all functions for complex document authoring and layout that the discontinued iBooks Author app provided in the past for macOS.

https://support.apple.com/en-us/HT211136

I think you will find the hassle to get it into pages lessened over time and benefit from having it in a format you can edit easier than PDF.
Once your notes grow more complicated, doing the authoring in pages first may be the best solution so you are not hobbled by the limited features and choices made for notes app to be a lightweight authoring environment. Pages is much better for things that fall between PageMaker / LaTeX documents and notes which hit the phone / pad / desktop sweet spot for basic function.
Answer: You can save a Note as a PDF in the Notes App. Then you can use EPubIr to convert the PDF to EPUB. EPubIR is an app available at the  link above.  It sells for $2.99.
Comment: pdf to epub is lossy
Comment: why the downvote?


How to make automator run an applescript that turns of mac?

Question: I want to make an applescript that taps the apple in the corner, taps shut down, and then taps shut down. I can't record it, since it actually involves shutting down the computer, making the script not being saved.
Comment: I've updated my answer with a _click menu item_ example if you still want that.
Answer: You can use the following in an AppleScript to shutdown the system:
tell application "System Events" to shut down

If you really want to click the menu items you can go straight to clicking the "Shut Down" button with the following:
tell application "System Events" to click menu item "Shut Down" of menu 1 ¬
    of menu bar item "Apple" of menu bar 1 of process "Finder"

Note: I've add the ¬ Line-Continuation Symbol to keep from having to horizontally scroll to see the entire line, just remove it and place it all on one line in the script if you want.  If you want to actually bring up the Shut Down message change "Shut Down" to "Shut Down…".


what battery(s) do i need to power a 12 amp 200 mph motor for 1 hour?

Question: I have a plug in leaf blower/vacuum and would like to convert it to battery power. here is a link to the equipment in question. http://www.amazon.com/Factory-Reconditioned-Ryobi-ZRRY42110-Electric-Mulcher/dp/B004NC014Q/ref=cm_cr_pr_product_top?ie=UTF8. 12amp is its maximum output and i don't necessarily need it running that high but would like to know if it is possible to simply wire it to a 24v battery and still use it for at least an hour?
Comment: I'd use a garden rake to tidy up the leaves - it's much more ecological and doesn't use electricity at all other than what your brain produces to control your arms and legs.
Comment: With the reviews on that thing it sounds as though you're better off getting a new battery-powered device instead.
Comment: That's a 1440 Watt leaf blower... 12 Amps at 120V
Comment: Definitely not worth the effort or cost to make the conversion.
Comment: I would recommend getting a 6V, 12V or 24V (depending on what battery you want to use) DC motor instead if you plan on running it on a battery. Using a DC -> AC converter for this sort of job would be very inefficient, compared to DC-Power -> DC-Battery.
Comment: You could wire 10 12V 15Ah deep-cycle SLA batteries in series.. but that's around 100lbs/$400 worth of batteries.
Answer: Since it is clearly running off a power cord, you cannot just connect it to a 24 volt battery and expect it to run properly. The motor is probably a universal AC/DC motor, so it might well run from a battery, but it would need to be 120 volts. If you use an inverter, you could do that. Ignoring inverter losses, you would need to provide 120 amps, so for one hour's operation you'd need at least a 120 Ahr battery. And if you're thinking of using lead-acid, you should never discharge more than 50%, so you would need a 240 Ahr battery.
Answer: It looks like that leaf blower is designed to take AC power in which case it couldn't be powered by battery by any simple means. That leaf blower uses 120*12 = 1440 watts. At 24 volts you would need 60 amps, and to power it for an hour you would need a 60 amp hour battery (aka 25 of these)
Even if you could figure out battery size you would have to buy an AC to DC converter. I think you would be hard pressed to find a small portable converter able to put out that many amps. There would also be energy losses in the conversion, which would necessitate a larger battery.
If you need a cordless leaf blower it would be best to buy one.


How to install DTclassifier for QGIS?

Question: I want to install a dt-classifier plugin I have downloaded from a web page (http://gis-lab.info/qa/dtclassifier-eng.html). I unzipped it to the qgis plugin directory but it won`t show up in my plugin manager in Q-GIS.What can I do?
Comment: I have the same problem. I moved the plugins files into the /User/.qgis/.... directory, also to the /Program Files/Qgis/.... directory, in the appropriate folders, and it doesn't show up. I also added a path to the plugin's directory in the Options menu, and nothing. Anybody solved this??
Comment: Please don't add "I see that too" style problems as answers. You can make a comment on the question if you have additional details, or just mark the question up if it matches your situation.
Answer: If you are in offline click here, may be it will help you..,
If you are in online click here
Comment: Its not a python plugin, but a c plugin. So it must be installed in the program path, like C:\Programs\Quantum GIS Lisboa\apps\qgis\plugins
Comment: No, the online method is only ment for python plugins. But my Qgis wont load the plugin. I get an error message that a procedure cannot be found. I guess you have to contact the author.
Comment: I already tried the offline solution with the problem mentioned above. Trying the online solution I put the URL of the website where you can download the plugin as new repository. But there are no plugins shown for it.
Comment: I unzipped it to C:\Programs\Quantum GIS Lisboa\apps\qgis\plugins but havn`t installed. I thought this would be done with qgis.
Comment: Did you make sure to go to "Manage Plugins" in then menue and check the box next to your plugin?
Comment: Yes, but it does not show up in the list.
Comment: Check out here [http://gis.stackexchange.com/questions/24741/how-to-deploy-qgis-c-plugins]
Comment: Well, the plugin is intended vor Qgis 1.8.0, which runs here. But the files are from Feb and May 2012, at that time it was still the dev version.
Answer: Did you do exactly as described on the plugin homepage?

To work with plugin under Windows you need:

download and install QGIS 1.8 or higher (read more)
download the archieve with plugin and necessary libraries
(optionaly) check md5 sum:
  7622527e656373797080b4c40a9bb4f2 DTclassifier.7z
extract archive into QGIS plugins directory (usually C:\OSGeo4W\apps\qgis-dev\plugins)

Linux binaries are also available. To work with plugin under Linux you need:

download and install QGIS 1.8 or higher.If packages for your distribution are not available — you need to compile QGIS from source
download the archieve with plugin: 32-bit binary (download) сompiled under 32-bit Slackware 13.1 using OpenCV 2.3.1
(optionaly) check md5 sum:
  b3089f69602b9b55652380728f7b2a3c dtclassifier-linux.tar.bz2
extract archive into QGIS plugins directory (usually /usr/lib/qgis/plugins)

After installing you should run QGIS and enable the DTclassifier in Plugin Manager ("Modules → Manage plugins").
Comment: I tried the Windows part. But maybe the plugin expects some other OSGeo4W modules that are not in the standalone Installer Version.
Comment: What's your QGIS installation path and where did you extract the plugin to?
Comment: As mentioned above: C:\Programs\Quantum GIS Lisboa\apps\qgis\plugins. Thats where the other C++ plugins are. Starting Qgis I read in the protocol, that all plugins are successfully loaded, except DTclassifier.
Comment: I have the very same issue as Andre.. Anyone?

How to install DTclassifier for QGIS?


Which is grammatically correct, "my name is John" or "the name is John"?

Question:

My name is John.
The name is John.

Which of the above sentences is grammatically correct? If both are, which is preferable and why?
Answer: Your first version is perfectly correct. The second can be used tersely or humourously if someone gets the name wrong, either by John himself, or by his friend to the third-party who has made the mistake. It is also not unknown for it to be used by John when introducing himself, but rare.
Answer: Both of them are correct, but they are not equally suited in every situation. "The name is John"  can be used if two people are conversing, and one person is stuck in making a statement because it requires the other person's name which he or she doesn't know.

A: Okay, so I'm reserving a room for two people in the name of Mr. ...
B: The name is Harris. Bob Harris.

It can also be used to give a correction:

A: So, Mr. Harolds, how do you like the room?
B: It's great, and the name is Harris by the way.
A: Ah, I'm sorry. Right, Mr. Harris.

This is a fairly abrupt way to correct someone, which we would use on someone in an inferior social position. It communicates the idea "you should have remembered my name" (perhaps because it's your job, or I am more important than you, and so on).
Suppose the speaker is a lowly clerk in the proverbial mail room of a big company, and the CEO happens to speak to him, and does not get the name right. It would be quite inappropriate for the speaker to respond with "the name is Harris", being seen as a challenge to the authority of the CEO and the relative rank between the two.
In the above conversation, Harris greatly softens the rebuke by first answering the question and complimenting the hotel room, and then adding "by the way" as if to say "this is just a small, unimportant side note that I'm adding".
Outside of this type of context, if it just used "out of the blue", an introduction like "the name is Harris" roughly means something like, "there is naturally an expectation in the air that you (or everyone present whose attention is riveted on me) want to know who I am, and so I'm dropping it on you: the name you anxiously want to know is Harris."
Nitin Varp aptly remarks in the comment, "it sounds good in movies". The reason is that it's used by confident male characters, and the remark in Arun Raj's answer is also basically correct: it is not good manners, because it conveys the presumption that the other people are eager to know the speaker's name.
In the first A/B example the situation is different because A shows signs of requiring the name, and B essentially completes the sentence that A started. Moreover, A never asked the question "what is your name?". In that particular conversation, it is even possible that the person making the reservation isn't actually Bob Harris.
Answer: First one is right. Second one is not wrong but this is not good for manners.
Comment: Because it sounds like the person you say it to is an idiot for not getting your name the first time your said it.
Answer: They are both correct. The name is jay by the way.
(My second sentence is just an example of how your second sentence could be used.)


Is it self-plagiarism to reuse sources?

Question: I've taken two classes in a row that require research papers to be written as an assignment, and since the second one has had a similar criteria for which topics are allowed, I decided to continue researching the same topic. However, after checking with the school's plagiarism checker, it flagged me for roughly half of my 2nd paper's sources being reused. Is this something I should be concerned about? The rest of the paper is completely original and not copy-pasted from my first one at all, plus all of my sources are cited correctly.
Comment: I don't see why self-plagiarism should be an issue dealing with exercises. You are not a researcher submitting to a peer reviewed journal instead of being a student whose work should be evaluated by teachers not peers, and possibly not only by automated process. And perfectly with a real interaction. I always smile when students are concerned with self-plagiarism. Go discuss with the instructors. Ok now I see sevensevens Answer. Plus 1.
Answer: In general, no (and how did you get access to your school's plagiarism checker)
If the papers are related they should share sources.  From a published peer-reviewed standpoint, I'd bet several papers reuse half their sources.
This sounds like a paper for a grade though.  In which case you actually have a 3rd option.  Talk to the professor or TA.  Bring the first paper and this paper with you and let them make a decision.  Assuming you didn't plagiarize, they'll see the content is different.
Remember, part of taking a university course is to learn how to write papers with novel ideas.  The professor and TAs are there to help you learn how to present your ideas without plagiarizing sources.  Especially coming before the paper is due shows a good-faith effort.
Comment: @Nimbus125 - don't forget to tell us how it turned out.
Comment: This is a paper submitted via blackboard, and before we are allowed to fully submit the paper, it has to go through a plagiarism checker called SafeAssign where it marks every possible instance of plagiarism for you to review before submitting the final version.
Also thanks for the advice, I'll go talk to him tomorrow then. The works cited page(s) were the only spots that actually really got flagged hard, the rest was relatively okay
Comment: the professor said it would be fine, thanks for the advice!
Answer: Self plagiarism is reusing your old work and representing it as new. You avoid it by citing the old work within the new, just as you would the work of any other author.
If I read your question correctly, you copied something like the bibliography of the old work, and maybe a section on "prior work" into the new paper from the old. The checker looked for identical sections of text and found these.
I don't actually see much of an issue with that, actually. There is a principle that applies and it shows up a lot in math and sometimes in CS. Often there is only one way to correctly say something. In math, the definition of the derivative is pretty standardized, for example, so every book and paper that repeats it has essentially the same text. A bibliography is like that. It uses a standard format and ordering and the items in it have a standard form. So two papers on the same topic will have large overlapping areas of the bibliography. That doesn't mean they are plagiarized.
A section on prior work might be a bit more problematic. You can avoid a charge of self plagiarism if you just state in the new paper that the prior work is the same as for the previous one and is repeated here only for the reader's convenience. Since there is a citation to the old work, there is no self plagiarism. But an automated plagiarism checker will probably still flag it.
The reason to avoid self plagiarism is that a reader of the new work wants a complete context of the ideas presented. The old paper establishes a certain relevant context with its citations and bibliography and if the new work doesn't point to the old one then the reader might miss that important context. So, we cite, letting the reader go back for more context as needed. But nothing you describe here seems to indicate an issue with this, as long as your new paper cites the old one.
Keep all of this in mind and be prepared to use it if you go see your professor as sevensevens suggests. At the most, you might have to make some minor changes to the text and add a citation or two for clarity. But make it the professor, not the TA, you speak to. Oddly, the professor will probably be less pedantic about such things and is the final authority over what you are permitted.

A final note: Often rephrasing something you wrote earlier to avoid automated checking is worse than just copying it and giving a citation. This is because it can seem to imply an intent to disguise. Copying large sections is probably not a good practice, but if it makes things clearer to a reader it may be better for shorter passages. But give the citation and state that the section is "repeated for convenience of the reader". Then it is clear.

Is it self-plagiarism to reuse sources?


Which is better platform for large scale database

Question: Between Mysql and PostgreSQL,which is suite for very large scale of data..for example, millions of record...i think,i should use PostgreSQL...any suggestion guys?
Answer: I've used both in similar situations, and sheer size of the DB doesn't seem to affect their scaling in substantially different ways. PostgreSQL is much more complete and solid, and will much better support complex queries and their optimization, while MySQL may shine in terms of retrieval speed for extremely simple queries; but these aspects are independent of the sheer size issue.
Answer: I think it depends a lot on what you mean by "better". You should probably
identify your needs before choosing one or the other.
Faster? More reliable? Allows replication? Can do more complex queries?
Is your application amenable to "sharding" in which case you probably
want a database which can cluster and be administered more easily, or
do you need everything in one massive set of linked tables, in which case you
probably want good support for many cores and large memory. Do you have
a complex authentication set up or is it a simple "one user" web application?
Is the bulk of the data in binary objects, or is it simple numbers and strings?
How will you do your backups?
MySQL and PostgreSQL both seem to be very capable databases, and both
have been used successfully at large scale, so I'd suggest you need to
identify the specific needs of your application first.
My inclination would be towards PostgreSQL, but that's mainly because I had
a few disasters with MySQL losing data a few years ago and I haven't come
to trust it again. PostgreSQL has been very nice in terms of being able
to make backups easily.
Comment: sorry because i didn't told you about the needs...of course it must be reliable and faster...the purpose is for reporting system,but it plays with million of record..
Comment: Interesting story about MySQL.  Can you expand on your disaster stories?
Comment: it was a while ago (MySQL 4 maybe?) and we had a UPS fail on us, crashing the database server. Our PostgreSQL database on the same machine was absolutely fine, but the MySQL one was unrecoverable. (yes we had backups but still lost about 23 hours of data)
Answer: Postgres has a richer set of abilities and a better optimizer; its ability to do hash joins often makes it much faster than MySQL for joins. MySQL is rumored to be faster for simple table scans. The storage engine you use underneath matters a lot, as well.
At some point, scaling becomes a choice between two options: scale by buying bigger hardware, or scale by introducing new machines (which you can shard the data to, use as slave replicas, or try a master-master setup -- both Posgres and MySQL have solutions of various levels of quality for these sorts of things).
A few million rows of table data fit in a standard server's memory these days; if that's all you are doing, you don't need to worry about this stuff -- just optimize whatever database you are most comfortable with, to ensure the proper indexes are created, everything is cached (and something like memchached is used where appropriate), and so on.
People mention that Facebook uses MySQL; that's kind of true. Kind of because what they are actually doing is using hundreds (thousands now?) of mysql databases, all of them responsible for their own little cross-section of the data. If you think you can load facebook into a MySQL (or postgres, or oracle) instance... well, they'd probably love to hear from you ;-).
Once you get into the terabyte land, things get difficult. There are specialized solutions like Vertica, Greenplum, Aster Data. There are the various "nosql" datastores like Cassandra, Voldemort, and HBase. But I doubt you need to go to such an extreme.  Just buy a bit more RAM.
Answer: Well, it ultimately depends on what you are most comfortable with.  According to MySQL, there is no imposed theoretical limit on the size of the database...it depends on the capability of the hardware supporting it.  With the number of rows, using InnoDB, the theoretical limit is 256 terabytes.  The reason I keep throwing out theoretical is that, there is probably a very small chance that you could possibly index 256 terabytes of data, so that is what they are approximating might be a limit.  If you hit that max, you got bigger problems.  Current users of MySQL in production, that I can think of, are YouTube and Facebook.  Those are probably the two largest...and it appears that they are faring well.
But once again, as I stated above. It is whatever you are most comfortable with.


How to understand google search results?

Question: If you search in Google with keywords "cyprus hotels" the first in results are www.cyprushotels.com with rank 2 and 2 links to this site. And second place is www.cyprus-hotels.com with rank 5 and milions link to that site. Why is it like that?
Comment: @user5481: I understand that English may not be your first language but in future, please try and write in proper sentences instead of text-speak. Just makes it easier for everyone to understand, thanks :)
Answer: You need to understand that it's quality, not always quantity that is the ruling factor in these ranking comparisons.
See http://www.opensiteexplorer.org/www.cyprushotels.com/www.cyprus-hotels.com/a!comparison for a better indication of why, cyprus-hotels.com has more back-links, the cyprushotels.com site has higher value back-links.
Lastly, the PageRank (what I believe you were referring to when you mentioned "rank 5") has very little to do with where a site will rank for particular keywords. Also be reminded that the rankings you see are most likely tailored to you.
Answer: Seriocomic posted almost exactly what I was about to write but I will add a few more points:
First, you have a lot of text on the home page and from a brief glance it looks very keyword stuffed. Obviously you need keywords on the page, but putting "Cyprus Hotels" in every sentence makes it look like spam. Just write naturally!
Second, most of the links to your site come from other sites you own and cross-link on every page. It's easy for Google to see these sites are very closely related and thus will lower the impact those links have. You need to try and get varied back links from external sites.


How according QM do permanent magnets rotate?

Question: When two magnets are placed close to each other they turn and orient parallel. I suppose this is due mostly to spin of the unpaired electrons. But in QM a spin just orients up or down. 1. How are these two pictures compatible? If the spin is closer to up projection the magnet shoud first turn up say 25 degrees and then turn 180 if it flips to down) 2. Where from takes the smaller (unfixed) magnet energy to rotate? (I cannot see how energy is taken from the magnets as they are permanent and stay so for many decades)
Comment: The sentence "but in QM spins just orient up or down" is plain wrong. When measuring the projection of spin $1/2$ along *any* axis, you only get two possible values. But you can choose the axis of measurement as you wish (which just corresponds to a rotation of the basis in which you represent the spin).
Comment: orient mean ecxactly this. I can not choose another axis as there are just the two magnets.
Comment: In fact I have chosen the axis by puttting the fixed magnet in the fixed direction.
Answer: Your question about QM is not clear at all and I won't try to answer it.
But the part about, where does the magnet find the energy to rotate: if it is now in a position that is not the lowest energy one, someone, the experimenter, you for instance, put it there. It took that person some work to put it there the way it is. This work has been stored as potential energy. When freed, the magnet lowered its potential energy by rotating. Note that if there is no dissipation, the rotational kinetic energy will make it overshoot the equilibrium energy and keep oscillating. Dissipation will change this energy to heat and eventually the magnet will stop at the equilibrium position.
Answer: IMO when the spins are more antiparallel than parallel e.g in the second or third quadrant of the circle they project ac. to QM antiparallel to B. As it is in Einstein de Haas experiment the body receives a rotating momentum and is about to rotate in direction where the small magnet and the external magnet creating B will be south-south or nord-nord. But because of the inertia this does not happen immediately. Then the spins flip to parallel because this is the more energetically low  state. So before the inertia lets the body rotate it receives a new opposite momentum and rotates now in the direction where everyone observes it e.g south-nord. It is interesting that this can be confirmed (namely my guess about the reason of the observed rotation - inertia) with an experiment like Einstein de Haas with a rapidly changing direction of B. I suppose the body won't rotate at all because due to inertia it can not follow B (whereas the spins can ac. to QM).
Comment: I saw the same question asked in: Don't the magnets slip and turn in Stern-Gerlach experiment, if their orientation is not aligned with the applied magnetic field? There's no answer too.


Twig Filters and Text Format Filters

Question: I've implemented a custom Twig filter that wraps certain character sequences with a span. The span element didn't show up in the front end until I allowed it in the text format for the field in question (via Limit allowed HTML tags...), so it seems that Twig filters are applied before text format filters. For my current use case, it seems like it would make more sense to run Twig filters after text format filters. Assuming I'm understanding this correctly, is there a reason this is the intended behavior? And if so, is there a way to change when Twig filters are applied to a field/format?
Comment: I do not at all think that these two things are related. So it might be some caching?
Comment: It's definitely not related to caching, and while the two types of text filtering and different, they're clearly related. I've confirmed that the `Limit allowed HTML tags` filter is applied after the Twig filter. While there are probably circumstances where that's desirable, it would be nice to be able to change the order.
Answer: I ended up solving this by running the field through the render filter first, then my custom filter. The text format filters are applied at the render stage, so now the custom filter runs after them. The finished order is:
{{ field | render | custom_filter }}

Twig Filters and Text Format Filters


Do I need a property release to sell a stock image of an object when the location is not identifiable?

Question: Can I sell a stock image taken on private property for which I don't have a property release but of which is not recognizable and has been edited? Nobody on the property has technically told me I couldn't take photos, then again, no one really knew I was. Additionally, I there are no trademarks or logos visible in the photos, the subject is clearly an object (not a room) and the photos have been edited. I guess I'm more curious to learn whether editing a photo enables me to sell stock without property releases.
Comment: How are the property owners going to come after you if they can't recognize the property?
Comment: This is likely to vary by jurisdiction. Also, was this _your_ private property, and if it wasn't, did you have permission to be there, or were you trespassing? And was it just something like a neighbors yard, or something with posted "Private Property" or "No Trespassing" or other indicators (fences, gates, security guards, security cameras, ...) that you might possibly be forcibly ejected if you were found there?
Answer: You don't need a property release in order to sell the image as a stock photo. If a property release is required; it is required by the end user, not you.
With stock photography they are unlikely to accept an image w/o release even if the end use doesn't actually require it... part of that is because they don't know what the end use will be when accepting images, and as a general (over)protection policy.
If the image is rather generic, they may accept it w/o a release.
The other implied part of your question is "was it legal for me to take, and now posses/sell, the picture?" I can't answer that definitively... but if you were not doing something you believe/knew to be illegal (against policy/etc) then it was/is probably fine.
You said the subject of your photo is clearly "an object." If that object is also a piece of creative work (i.e. a statue/painting) then your photo could be in violation of someone else's copyrights (varies by region and installation).
Comment: Thanks, Steven!


How to use tiles in subpage?

Question: I've created a tile overview in my SiteCollection that links to pages within subpages. When I chose to insert webparts I don't see webparts from the parent page. Is there a way to use those tiles as an overview in the subpage as well?
Comment: I think there isn't any way to do this. So the only solution I can think about is using e. g. a migrating tool for duplicating this Web Part and put it on your subsite as well.
Comment: There most probably is a way: I had the tiles from the parent page in a subpage (my former colleague must've done this but I have no idea how he did and I don't have his contact unfortunately).
Answer: When you develop a web part, you can Export it and then Import it so it becomes available when you go to the Add Web Part menu.
With your page in Edit Mode, click the little arrow in the top-right corner of your web part and click Export. You'll download a file that'll contain your web part's contents.
Now navigate to your destination page (the page you'd like the web part to be on) and enter Edit mode. Go to the Add Web Part menu like normal, but look in the bottom left corner for the "Upload a Web Part" link.  Use the browse and upload buttons to upload the file you downloaded during the Export process.
Your custom web part should now be listed under the category Imported Web Parts.
For more info and screenshots: Exporting and Importing web parts in SharePoint 2013

How to use tiles in subpage?


How to estimate GridSearchCV computing time?

Question: If I know the time of a given validation with set values, can I estimate the time GridSearchCV will take for n values I want to cross-validate?
Answer: You could fit your model/pipeline (with default parameters) to your data once and see how long it takes to train. Then you would multiply that by how many times you want to train the model through grid search.
E.g. suppose you want to use a grid search to select the hyperparameters a, b and c of your pipeline.
params = {'a': [1, 2, 3, 4, 5],
          'b': [1, 2, 3, 4],
          'c': [1, 2, 3]}

cv = GridSearchCV(pipeline, params)

By default this should run a search for a grid of $5 \cdot 4 \cdot 3 = 60$ different parameter combinations. The default cross-validation is a 3-fold cv so the above code should train your model $60 \cdot 3 = 180$ times. By default GridSearch runs parallel on your processors, so depending on your hardware you should divide the number of iterations by the number of processing units available. Let's say for example I have 4 processors available, each processor should fit the model $ 180 / 4 = 45$ times. Now, if on average my model takes $10 sec$ to train, I'm estimating around $45 \cdot 10 / 60 = 7.5min$ training time. In practice it should be closer to $8min$ due to overhead.
Finally, because some parameters heavily affect the training time of that algorithm, I would suggest using the max_iter argument whenever available so that your estimation doesn't fall far off.
Please note :
As of July 2021, the default folds is 5.
From sklearn documentation :
Changed in version 0.22: cv default value if None changed from 3-fold to 5-fold.
Comment: Probably some combination of parameters severely slows down your computation. You can try setting `verbose=1` so that it prints your progress.
Comment: thanks ! I'll try that out and see how long it takes. I think the average time was 0.4s that I had to run some thousands of time so it did take quite some time. I'll be able to estimate it better :)
Comment: By default number of jobs (n_jobs) that GridSearchCV runs is 1. In case you want to use more one CPU at a time you should set n_jobs=-1 or n_jobs=. This may need extra memory as per documentation if the dataset is big and you may have to use pre_dispatch parameter.
Comment: I have 3 parameters with 10 levels to scan and the time for a run is about 19 seconds. Hence, 10*3*19=570/60=~10 minutes. But I definitely have to wait about 35-45 minutes. What am I doing wrong (either in time calculation or in scanning params?)
Answer: Let the search complete and then you can use cv_results_ attribute to compute the elapsed time as given below.
mean_fit_time= search_cv.cv_results_['mean_fit_time']
mean_score_time= search_cv.cv_results_['mean_score_time']
n_splits  = search_cv.n_splits_ #number of splits of training data
n_iter = pd.DataFrame(search_cv.cv_results_).shape[0] #Iterations per split

print(np.mean(mean_fit_time + mean_score_time) * n_splits * n_iter)

Comment: This solution is elegant and intuitive and leverages built in return attributes of GridSearchCV.
Answer: Here is a little function I made to estimate the GridSearchCV time, though I think it could be improved by @Naveen Vuppula's comment.
import timeit

def esitmate_gridsearch_time(model, param_grid:dict, cv:int=5, processors:int=6):
    times = []
    for _ in range(5):
        start = timeit.default_timer()
        model.fit(X_train, y_train)
        model.score(X_train, y_train)
        times.append(timeit.default_timer() - start)

    single_train_time = np.array(times).mean() # seconds

    combos = 1
    for vals in param_grid.values():
        combos *= len(vals)

    num_models = combos * cv / processors
    seconds = num_models * single_train_time
    minutes = seconds / 60
    hours = minutes / 60

    print(hours, minutes, seconds)


How to find the inverse Z transform of this function in z domain?

Question: i have a function
$$F(z)=\frac{z-0.4}{z^2+z+2}$$ i need to find the inverse z transform of it , i have tried it with residues but the roots are too much ugly and it involves lots of messy calculations , is there any other way to proceed ?
Comment: the easier way for rational functions is using partial fraction expansion.
Comment: yeah i used that but the roots are way to ugly that's why it's making a mess , any other ways ? @MohammadMohammadi
Answer: I think you are using the partial fraction expansion in wrong way. You have to know for $z$ transform we expand it as a function of $z^{-1}$ and not $z$. for your special problem factor out  $z^2$ from denominator then divide the nominator by that.
Then you could factor your polynomial over a real field or complex field. This means after factorization over complex field you may obtain polynomials with complex coefficient but factorization over a real field you obtain polynomials with real coefficients. so for your case the denominator is irreducible over real field but we could factor it over a complex field, which lead to a pair of conjugate poles (roots). Now you could easily obtain the inverse using the inverse of a single pole (don't worry about the complex numbers, after summing response of 2 conjugate pole the complex parts will cancel out each other and only a real part remain).
Also I have to say, for your case you will reach 2 answer considering the region of convergence (RoC) in $z$ space.


Is the redox method applicable to all chemical reactions?

Question: Is it possible that some chemical reactions can't be balanced through the redox method? Because it seems to me that the elements on the reactants side have the same oxidation states with the product side.
Comment: Of course the method is only applicable for reactions where the oxidation states actually change. A typical example where this would not be the case are acid/base-reactions. To improve your question, it would be good if you could add which "elements on the Reactants side" you are referring to.
Answer: Sometimes you aren't able to use the redox method to balance a chemical equation. This is because the redox method is only used to balanced an equation where a element gets oxidised or reduced. However if there is a chemical equation where no element is getting oxidised or reduced, then you won't be able to use the redox method to balance the equation. However, fortunately most of the time these type of equations can be easily balanced. Consider the following unbalanced equation: $$\ce{Ba(OH)2.8H2O (s) + NH4SCN (s) -> Ba(SCN)2 (s) +  H2O (l) + NH3 (g)}$$
Here none of the elements are reduced or oxidised, hence you would not be able to balance this equation using the redox method.


CART on Timeseries Forecasting

Question: I've read in a few articles where it was talked about using CART for timeseries forecasting and anomaly detection. However, I would want to remove the Seasonal and Trend noise in my temporal data. I've seen people using STL decomposition to this and use the residual data for any processing.Going by this approach, I's assume this residual data (for every feature) would become the input features to the CART. While this is the case, how can I use the CART for forecasting? How can I STL decompose a single data point (based on what data I have) and then feed the residue to the CART for prediction. Do I have to STL decompose the entire dataset again? That looks to be a fundamentally flawed approach to me. Am I trying to use two mutually exclusive techniques and feed one to another? Need some advice.
Comment: What do you mean by "How can I STL decompose a single data point (based on what data I have)"? STL decomposition always works on entire time series.
Comment: I meant when I'm forecasting Y for given inputs (X1, X2, X3) for a specific time t1. How will I do that?
Comment: My model will be built based on Residual data. But the input data to forecast is not the residual data it is the raw data.
Answer:
STL decompose your historical time series. This will give you a Seasonal, a Trend and a Remainder component.
Forecast the Seasonal component. By construction, this is a periodic series, so the only useful forecast is the Seasonal Naive one; that is, take the Seasonal component entry corresponding to the period you want to forecast.
Forecast the Trend component. This is a series with a nonconstant trend. You will need to pick a method for forecasting it. A good choice is trended exponential smoothing.
Model the Remainder component, by feeding it into your CART, along with any time-varying explanatory variables.
Forecast the Remainder component from your CART model, by feeding in the future values of the explanatory variables.
Add up the three forecasts.

CART on Timeseries Forecasting


how to use different template file for category magento 2

Question: I want to customize the design of the catalog list page. I want to use different layout and design for each product category. For that, I am calling different phtml files from static block. using a static block I am calling another phtml file but still in product list page default Magento list.phtml files are load. I don't know what actually issue please help me!
I am using Magento 2.1.1 version
Comment: Did you get solution?
Answer: You need to create a xml file catalog_category_view_id_{{id}}.xml under your theme > Magento_Catalog > layout and change list file.
For detail :
http://sumankc.com/2016/12/10/different-template-for-different-categories-in-magento-2-category_id-layout-handle-in-m2/
Comment: hi Bhudiya, Could you please how you achieved ? I want to create different templates for different category top menu
Comment: Can we create xml file by category url key?
Answer: Created customlist.phtml from list.phtml or copied the code of list.phtml and create
Assign customlist.phtml in admin side (admin → category → Layout section)
<referenceContainer name="content">
    <referenceBlock name="category.products">
        <block name="product_list" class="Magento\Catalog\Block\Product\ListProduct">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Magento_Catalog::product/customlist.phtml</argument>
            </action>
        </block>
    </referenceBlock>
</referenceContainer>

Answer: I'm unable to add a comment so I'm going to post an answer.
catalog_catalog_view.xml has a block with the product list template in there. If you didn't remove it from that xml file, then it will always display in all the other product category.
Is the list.phtml suppose to only load on certain pages?
If so, then in admin > products > categories > you product category, under design, you can add the below code to update the layout and have the list.phtml removed from that category page.
<block name="category.products.list" remove="true"/>

Let me know if this is what you were looking to do.


Loading JSON with PHP

Question: I've been using PHP for too long, but I'm new to JavaScript integration in some places.
I'm trying to find the fastest way to pass database information into a page where it can be modified and displayed dynamically in JavaScript.
Right now, I'm looking at loading a JSON with PHP echo statements because it's fast and effective, but I saw that I could use PHP's JSON library (PHP 5.2).
Has anybody tried the new JSON library, and is it better than my earlier method?
Answer: Use the library. If you try to generate it manually, I predict with 99% certainty that the resulting text will be invalid in some way. Especially with more esoteric features like Unicode strings or exponential notation.
Answer: the json_encode and json_decode methods work perfectly. Just pass them an object or an array that you want to encode and it recursively encodes them to JSON.
Make sure that you give it UTF-8 encoded data!
Answer: Library has worked great for me.  FWIW I needed to do this on a project with earlier version of PHP lacking JSON support.  Function below worked as a granted risky version of "json_encode" for arrays of strings.
<code>function my_json_encode($row) {
    $json = "{";
        $keys = array_keys($row);
        $i=1;
        foreach ($keys as $key) {
            if ($i>1) $json .= ',';
            $json .= '"'.addslashes($key).'":"'.addslashes($row[$key]).'"';
            $i++;
        }
    $json .= "}";
    return $json;
}
</code>

Loading JSON with PHP


How to make a "rope" like object with even width throughout the whole object? (image inside)

Question: I'm modeling a cord, but I've run into a problem. Basically I modeled it by starting with a cylinder and rotating the final edge, then extruding that to the next sequence. However, this will cause the width to shrink where the edge turns. It's only by a little, but I would like even width throughout. Truth be told, when I add the subdivision surface modifier it becomes indistinguishable to the naked eye, but I would still like to do things "the right way" if there is such a way.Here's an image of my cord minus sub surf modifier.
Comment: I just recently created shoelaces for a project that were round and made of 3 twisted smaller threads. I used a short mesh with an array mod and a curve mod. The end caps were the shoelace ends. Would something like that do what you want. I didn't measure the thickness but it looks good to me. They look like this: https://www.etsy.com/ca/listing/191378052/3-pairs-twisted-cotton-rope-shoelaces
Comment: Maybe this tutorial wil help you
[tutorial by reynante martinez](http://www.reynantemartinez.com/how-to-model-a-rope-in-blender.html)
Answer: Probably the most common solution to this problem is to create a Bezier curve and use another Bezier curve (often a circle) as the Bevel Object (in the Bezier > Geometry properties).

https://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Bevelling_a_Curve has detailed documentation.
Your question is almost a duplicate of Make a 3D tube with a Bézier curve? .
Answer: You can also use the "spin" tool.
After selecting the vertices you want to extend, place the 3D cursor at the point that you want them to spin around. Angle your view to define the plane that the verts will be spun on and hit Alt+R. Tons of other handy options can be found in the tool bar.
Answer: One way to do this is rather than modeling the segments of the cord, to model the joints between the segments, and fill in between the joints by bridging the edge loops at the joints. Suppose the goal is a cord of 16 cylinders. Create an open circle with 16 vertices, and the desired radius, then adjust it to the desired orientation. Then pick one vertex, and extrude it away from the circle. The result looks like this:

Now to make your cord, make sure "Mesh:Loop tools" is activated, and set the pivot point to "active element". Duplicate the cord tool, and rotate it about the anchor point. When you get the two instances of the cord tool where you want them to be relative to location and rotation, as, for ecample in

select the vertices of the circles on both cord tools and from the edges menu (CTRL-Ekey), select the "bridge edge loops option.
This is the result.

Now the diameters of the places where the cylinders meet are all the same.
If the overall appearance of the cylindrical object is not quite what you would like, one easy way to adjust this is to add another circle at the point where it is least satisfactory.
Sometimes on an object like this, I'll make it away from the point which is its intended final location. Making use of this method means I can select all of the anchor points, and conveniently move the entire assembly to where I want it to go. After the I'm done with the assembly, I delete the anchor points.
Another technique is to make a short section of your cylinder, but instead of extruding the end, duplicate (SHFT-Dkey the section, and move it to the position of the second segment. Now add an empty object at the location of the center of the arc formed by the two segments, plus the intervening empty section. Rotate the inside ends of the two cylinder segments slightly, and again use the bridge loop to make the segment joining the two.
One common factor in both of these techniques is to keep the sections of the cord short, and the angles of the joint between the two as close to perpendicular to both of the axes of the cylinders as possible.


Contacting space agencies PAO (public affairs' offices)?

Question: Yes, I do know about the premature attempt to contact NASA when the site was in Area 51 (sigh). However, now things are different, and it may be much more suitable (and safe :( ) for Public Affairs offices of NASA, ESA, and other space agencies to extend their outreach to one more space-related site.
Answer: A bit of background: This was a rumour that I've somehow missed, but I've asked in The Pod Bay and apparently (according to @JohnB, but I have no reasons to doubt his take), the proposal was made to the members of the NASA Spaceflight Forum, and not to NASA's PAOs directly:

JohnB in The Pod Bay:
  that's actually kind of a rumor ^ it wasn't NASA, but a NASA fan
  forum or something but they already said it was NASA in the
  official SE podcast so it's pretty much fact by now ;P this was
  the forum: forum.nasaspaceflight.com

My take: By all means. If we're to gain reputation as a credible source, we'll need all the help from the already established names within the space science and industry. The sooner such names are involved with our efforts, the better, so they can also help with the fine-grained definition of Space Exploration, participate in the moderator elections process, and other Meta topics. On top of increasing the value of our Q&A.
So the question is, when is the best moment? Impatience could be seen as obnoxious, repeating same invitations over and over again, and only having a bit more to show for each time we try. And waiting too long can be seen as arrogance, as if we can do without them. I believe that now is the best time to start with invitations. We're out of private beta, and the community democratic processes has begun. We have something to show for, but obviously require input from the best of them. I think it's important to forward invitations ASAP, so they can partake in this process from the very beginning, and peer-review our already existing Q&A while it's not too overwhelming in numbers.
Answer: I think this is a great idea. I suspect the best thing to do would be to ask specific programs about questions relating to their program. IE, pass HiRISE questions to the HiRISE Team, Rosetta to the Rosetta, etc. Get them interested in a specific good question, and let them try to answer it better than us. Once they've answered a single question, I bet we'll suck alot of them in, including more than just the PO people. Twitter might be a good way to accomplish this.
Also, there's a site that I know is known to have lurkers around that have NASA connections, http://www.unmannedspaceflight.com . Check it out, you might get lucky.
Another good person to talk with if you can is Emily Lakdawalla of the Planetary Society. I'll see if I can dig up any other good people as well.


Microsoft Excel to SQL using Pentaho: syntax error in 'OPTION SQL_SELECT_LIMIT=DEFAULT'

Question: I've been using Pentaho Kettle version 5.1 to transfer Excel data to SQL by following these steps (answered by Edgar):

Launch Pentaho Kettle.
(Typically) click on 'No Repository'.
Create a new transformation.
On the left side you will see several 'blocks'. In this case, drag an 'Excel Input' block from the 'Input' category into your transformation file.
Double-click on the block you just dragged. The next steps refer to this block:

Click 'Browse' and select the Excel file you want to import.
Click on 'Add' (located to the left of the 'Browse' button). You should see the file listed on the 'Selected Files' list underneath.
Now go to the '!Sheets' tab (should be the second tab) and select the worksheet with the data you want to import into your database.
Finally, go the '!Fields' tab (should be the last to the right), click on the button labeled 'Get fields from header row...' and change the different datatypes accordingly.
Click on the button labeled 'Preview rows' to make sure everything is OK.

Now, let's move this data to your SQL database. For simplicity, I'm going to describe how to create a new table on the database. However, notice that Kettle provide blocks for handling updates and 'insert/update' tasks.
Once again, drag a block from the left hand side. This time go to the 'Output' section and select 'Table Output'.
Connect the two blocks by holding the Shift key and dragging the mouse pointer from the from the Excel to the 'Table Output' block. The next steps are related to the 'Table Output' block.

First, we need to build a connection to the database. To do this, click on the button labeled 'New...' next to the 'Connection' drop-down box.
On the 'Connection Type' list, select 'MySQL' (as you can see, Kettle allows you to connect with a vast number of different databases). Fill all of the appropriate fields and remember to click on 'Test' to ensure the communication is working.
Enter the name of the table.
Go the tab labeled 'Database fields' and select 'Enter field mapping'. From here make sure you map all of the Excel columns in the stream to the appropriate MySQL fields and click 'OK'. (If the names in Excel match your table you can simply click on 'Guess' to get you close.)

Finally, Save your transformation and run it by selecting the 'Transformation>Run' menu. If everything goes well you should see a message that says 'Transformation Finished' on the execution box under the 'Logging' tab.

Good Luck!

However, I cannot accomplish step 8 because of this error message:

I was unable to connect to the database to verify the status of the
  table: Unable to close prepared statement after determining SQL
  layout. You have an error in you SQL syntax; check the manual that
  corresponds to your MySQL server version for the right syntax to use
  near 'OPTION SQL_SELECT_LIMIT=DEFAULT' at line 1

I'm currently using MySQL Server version 5.6 and MySQL workbench version 6.1. How can I solve this error? I can't move on with our thesis because of this problem.
Answer: The problem you facing is your using mismatched (or) older MySQL Connector/J,
Check are you using latest mysql-connector-java-x.x.xx-bin.jar?
In my case I was using MySQL Server 5.6 and MySQL connector was 'mysql-connector-java-5.1.42-bin.jar'

Download the Latest MySQL Java Connector / Driver
Unzip the zip file
copy the .jar file and paste it in your Lib folder:

PC: C:\Program Files\pentaho\design-tools\data-integration\lib
Mac: /Applications/data-integration/lib
Restart Pentaho (Data Integration) and run you transformation.


What are the hot dev positions in game industry?

Question: What are the hot postions which are hard to get in game industry?
Client/Server/Game Engine/Networking and database or else?
Comment: ....hard to get when looking for a job, or hard to fill when you're a company?
Comment: This is something that's going to change over time, due to simple supply and demand, so be aware any answer of what's "hot" right now might be completely invalid in six months.
Answer: Technical artists are rare as hens teeth. That is, someone who is primarily an artist, but who can also script/code and understands the shader tech underpinning the art stuff.
Also, good shader graphics programmers are still pretty rare, i.e. someone who can create some of the more impressive visual effects, and optimise the rendering performance.
Comment: Don't forget that you should enjoy working as well - if shader programming isn't your thing you'll most likely get miserable after a while. Money isn't everything!
Comment: @Zolomon - Doubly true in the game development world, since if you're good enough to be a game developer, you could probably make twice as much with half the stress being a web developer or something.
Comment: Hehe. I changed from working towards the goal of being a video game artist to video game programmer at age 19.  I still have some art skillz though. You think an artistic programmer can be as useful as a programming artist?
Comment: Probably. Depends on the art skills I suppose, there's a whole spectrum between "has-trouble-drawing-stick-men" (like me), through "can-make-something-that-doesn't-offend-the-eyes" to "wow-that's pretty". Generally you'd have to be at the top end to be a professional artist, and while a technical artist could get away with being lower down the scale, it wouldn't be by much. If your skills are more programmery than arty, then shader programmer is probably a better bet.
Answer: Good audio programmers seem quite rare.  However this may not be a hard job to get because most game studios undervalue audio.
Answer: Any programmer who knows that this is not a const pointer:
<code>const MyClass* myObject = getObject();
</code>
Is a hot property.
Seriously: good programmers are hard to come by and there's a lot of inexperienced guys in the videogames industry.
Comment: I do agree with you, but IMO the differences between a const pointer vs a pointer to const are subtle but very learnable by a good developer.  Finding the developer who can learn but doesn't know yet is hard...
Comment: Good point nicely put, Rick.  Unfortunately a lot of devs spend too much time crunching for deadlines to spare any for mentoring.  We can definitely do better.
Answer: I say the hottest and hardest is to be a Studio founder, and to be a successful one at that.
Comment: "Just create ONE successful game" ... easier said than done.
Comment: Just create ONE successful game, improve and extend it in the next two versions and then, bring out a new version every year, that is just a assembly of the features of the first three ones.
Comment: @Dave O The first million is the easiest, right? :-)
Answer: Coding positions seem to be becoming less exciting/creative and less respected with each passing year and increase in team size :(
For each 'exciting' dev position (e.g cutting-edge graphics, or gameplay coding on a big title), there's about 10 coders needed to to fairly dull work (front end, TRC/TCR compliance, tools, porting to the lesser platforms)
You won't make big money coding games unless you really get lucky (right place at the right time). The only real money is in founding a studio and selling up to a megapublisher. Or creating an unexpected big hit with a very small team.
As a career, games programming seems somewhat dead-end unless you have what it takes to start a studio of your own, or are willing to give up coding and aim for a management role...
Answer: I would say that that the "Hot position" when it comes to programmers is probably Lead Architect, Lead Engine, or any other name to the same job. Essentially the guy who gets to decide what to implement and how. It's often a person with very good knowledge regarding programming, someone who probably has one of the best overviews of the code in the company. I don't think that it's something that you often get recruited to externally, but instead most likely internally. It requires a lot of experience and often have a tendency to be the best "general" programmers that make it there.
Comment: In addition I hear CEO and CTO are great positions, but also hard to get.
Comment: @Joe Wreschnig: Indeed. The CTO is sometimes the position I'm trying to point out - not always or neccessary though.
Answer: I think, that it is any dev position with good project profit share :)...
Answer: a person who's got patience and the quest to learn when new technologies arrive.. he'd get the job  he always wanted..be it a game graphics programmer or game programmer lead. i believe u can build a house only after u've bought the first brick :)
going up is a slow and very much desired process.