Can you plant white walnuts in summer?

Question: Bought a house in Dayton, Ohio, and want to plant some white walnut trees.  (Temperatures: I've seen it get down to like -5F, a few years ago, but looks like it rarely gets below 15F.)  I've found a source of nuts that MIGHT be plantable (though I'm not sure how they've been keeping the seeds), but I'd likely need to stratify them, which would take a few months and then we'd be into summer.  Can you still plant white walnuts in the summer, or would that mess with their growth somehow?
Comment: I had butternuts growing wild in zone 4 Wisconsin. You should be fine in Ohio. I'd skip the seeds and buy the trees directly from a nursery. The species is definitely available in the nursery trade - probably mail-order, though. Search for nurseries that offer trees and shrubs that produce food for wildlife.
Comment: Having not heard about white walnuts I looked it up and find that they are also known as butternuts.
Comment: @kevinsky Yeah - I've been sticking with "white walnuts" since otherwise it gets a little confusing with butternut squash.  Maybe that's more just a problem when googling, though.  Species is Juglans cinera.)
Comment: Knowing your location and minimum winter temperatures would help.  Can you edit your question and add this? Thanks
Comment: @kevinsky Oh, duh.  I've added the info.
Comment: If you don't want to wait several years , Hazel nut trees from a nursery will bear much sooner.
Comment: Well, I'd go for nursery trees, except I'm planting like 30 of them, which adds up real fast.  And I'm partly growing the walnut trees for their large eventual size, so hazelnuts are out.  (The tall forms of hazelnut trees are apparently not native to Ohio, and I'm trying to grow specifically native plants, so.)
Answer: It depends on how do you plant it.
If you buy it in a pot, and you can plant without touching much the roots, it doesn't matter so much the period you plant it. But if you get with bare roots, fall/winter/spring (depending on your zone, the plant, and wild life around you) is way better.
But: all potted plants could suffer when planted outside. Usually trees are keep outside, so not much a temperature shock, but sun could be a problem if the tree was keep in shadow and you plant it in full sun on most sunny and warm days of summer. I would put the pots near the final location for one week, and if there is no sunburn (but check daily), I would plant them without much worries. Else I would move them to a half-shadow and then from time to time into a more sunny place until you can plant them.
My major worry is about transporting such plants. My experience tell me that branches are often damaged, and this is more difficult to recover.
Answer: In case you're not aware, the butternut tree is endangered in Ohio due to its high susceptibility to the non-native disease, butternut canker. Researchers are still searching for disease-resistant varieties, but at the moment there are none commercially available. If you plant nuts from a surviving butternut tree, you may end up finding such a variety and helping to save the species, which would be wonderful. But you should go into it knowing that the most likely outcome is that your butternut tree(s) will not survive for more than ten years.
Apparently free-standing trees are somewhat less susceptible to butternut canker, so you're more likely to have success if grow your butternuts in full sun, away from other trees. If you can get saplings or seeds that are hybrids between butternut and Japanese walnut, those are supposed to be resistant to butternut canker.
Black walnut, on the other hand, is quite resistant to this disease. This is why black walnuts are still quite common in native Ohio forests, while you very rarely see butternut trees.
A good place to get advice on how to grow butternuts from seed would be a native tree nursery that sells them. You might think they wouldn't give advice that would help you not buy their product, but many of these places are happy to help anyone who is interested in growing native plant species. Here's a list of Ohio native plant nurseries that grow trees. Of those, Riverside Native Trees and Scioto Gardens definitely grow butternut trees.
If your potential source of butternut seeds doesn't work out, you might be able to gather some in the wild. According to iNaturalist, there might be a butternut growing on public property in Taylorsville Metropark. It's not a confirmed ID, but the person who posted it is a naturalist and seems to have a pretty decent track record at ID-ing plants. The actual nuts of the butternut are quite large and relatively easy to spot on the ground (speaking from personal experience).

Can you plant white walnuts in summer?


Issue in wallpapermanager in kotlin

Question: I am using a button with id home_screen to set up an image in the framelayout fl_iv as homescreen wallpaper. But when i click on that, it sets up the image as both homescreen wallpaper and lockscreen wallpaper. How to make it just change the home wallpaper? The code goes as:
home_screen.setOnClickListener {
            Toast.makeText(this@SetWallpaperActivity, "Please Wait. Setting Up", Toast.LENGTH_SHORT).show()

                val result: Bitmap = fl_iv.drawToBitmap()

                val wallpaperManager = WallpaperManager.getInstance(this)

                try {
                    wallpaperManager.setBitmap(result)

                } catch (ex: IOException) {
                    ex.printStackTrace()
                }
                Toast.makeText(this@SetWallpaperActivity, "All Done :)", Toast.LENGTH_SHORT).show()

        }

Answer: Try specifying FLAG_SYSTEM in your wallpaper manager
wallpaperManager.setBitmap(result, null, true, WallpaperManager.FLAG_SYSTEM)
Comment: I tried that but it says that it requires android api level 24 to call this funtion but the minimum set is 22. i was previously using wallpaperManager.setBitmap(result) , it managed to change both home screen and lock screen as low as api 22, so i think there should be a way to a home screen change alone in api 22 and above

Issue in wallpapermanager in kotlin


Disable Ripple on ListView

Question: In Android 5.0, my ListView produces a ripple effect when clicking a list item. Is there a way to disable this effect? Looking at the docs, I don't see any way (https://developer.android.com/reference/android/widget/ListView.html)
Answer: You can remove or replace the list selector using the android:listSelector property. The default list selector under Material is ?android:attr/selectableItemBackground which is a bounded ripple.
<ListView
    ...
    android:listSelector="@drawable/my_list_selector" />

To completely disable selector, you can use a @null or @android:color/transparent (works better for some Android versions) value as following:
<ListView
    ...
    android:listSelector="@android:color/transparent" />

Comment: this removed the ripple but instead gave me a yellow background instead. I used this instead: `android:listSelector="@android:color/transparent"`
Answer: Try:
<ListView
...
    android:listSelector="@android:color/transparent" />

This will disable any visual effect of touching. Not very good for the user, but might be useful in special circumstances.
Answer: Yes, you can create custom list items with their layout, in which you have to change the android:background with a drawable without ripple.
Comment: That only covers the ripple... which works most of the time, unless you need a semi-transparent background for your list items

Disable Ripple on ListView


Are analytic solutions of differential equations realistic?

Question: I'm studying ordinary differential equations and learned some methods to solve linear ones. I'm definitely a novice. Well I think I can follow the procedures and math behind it. However, I'm not sure that differential equations actually model realistic phenomena. For example, a car reduces its speed continuously and finally stops in real world. Let's denote the velocity of the car as $v(t)$ which is a function of time $t$. And let $\tau$ be the time when the car stops. Then $v$ is not an analytic function. It is singular at $\tau$. We may assume that $v$ is infinitely differentiable at $\tau$ but anyway it is not analytic there. Can we model this movement of the car with a differential equation? All solutions of the differential equations I have learned were analytic. I think the equations themselves don't put such restrictions. But I don't get why the solutions are all analytic. Are there special methods to obtain non-analytic solutions? Or should the solutions of differential equations be analytic? If so, how can we model the movement of the car with differential equations? I have navigated my textbook but found no clue (The book may be too elementary).
Comment: If you have non-analytic coefficients or inputs you can have non-analytic solutions. Does your differential equations textbook have a chapter on step functions and impulse functions?
Comment: @bof I think it does not have. Should we allow the coefficient or input to be singular to model realistic phenomena?
Comment: Actually, even things like step functions are idealizations: the point however is that you can model interesting phenomena and the solutions can be used to gain insight, even if they don't correspond to reality exactly (e.g. the simulations that car companies do to test car components). But within the limitations of the model, there are situations where the solutions are very accurate representations of reality (e.g. the calculation of the energy eigenstates of the hydrogen atom, including very small corrections from QED)
Comment: Yes, I think that for many applications you will have to have non-analytic (in fact discontinuous, or generalized) functions in the equation. If your book has problems with step functions and impulses, they are probably right after the section on Laplace transforms.
Answer: First of all don't confuse the possibility of modeling something with a differential equation with whether a particular differential equation models something. Basically what you have is a differential equation that doesn't capture some of the aspects of reality very well, this cannot be taken as argument that these aspects can't be modeled using a(nother) differential equation.
Note that most models are meant to be mere approximations, they will therefore in some cases deviate significantly from reality in some cases or at some aspects.
Also there's no real requirement that the functions in a differential equation is analytic, obviously there's no reason to assume that the solution is either. However it's often so in physics that one assumes that one can differentiate all functions, but strictly that might not be required anyway in the normal sense (one can use so called distribution to get around some situations where the function is apparently non-differentiable).
As for the stopping car, there's no actual reason to believe that the movement of it isn't differentiable. Even if it looks like it comes to a sudden stop it could be that it's just that we don't look close enough, maybe the deceleration decreases quickly instead of just transiting directly to zero?
If we're to use the model that the braking force is constant whenever the car is in motion the solution for $v(t)$ would have a corner-point where it comes to a stop, but the model would as a differential equation be $v'(t)=F_0\operatorname{sgn}(v)/m$. We can handle this in various way, one is to rewrite it as an integral equation instead $v(t) = \int F_0\operatorname{sgn}(v) dt/m$ which won't be hindered by the corner-point. Another way is to use distributions where $v$ would be differentiable anyway. A third approach is to allow non-differentiability at isolated points where other requirements governs the solution (for example allowing $v(t)$ do be non-differentiable at isolated points given it's at least continuous there).
Comment: For the first approach, $v$ exponentially decreases, but never vanishes. The car never stops. I think the corner by $sgn$ does not matter in this case. Anyway accepting small enough velocity as zero may be a practical solution but are there really no better way? How can we measure how long does it take the car stop? For the second approach, I think I don't know what you mean.
Comment: For the third approach, I understand allowing non-analytic equations may allow non-analytic solutions. But is that the only way to obtain non-analytic solution? For example, can a second order linear ODE with continuous coefficients have non-analytic but second differentiable or smooth solution?
Comment: @LuianChu That the speed exponentially decreases is not a very realistic solution to a braking car, the model does not reflect normal reality well. Normally you would try to apply constant braking force to achieve constant retardation rate. With constant braking force the car actually gets to a full stop.
Comment: I would guess that you can't get a non-analytical solution out of an ODE with only analytic functions (but I don't have any evidence for it). The ODE given as a model obviously has a non-analytic function $\operatorname{sgn}$. OTOH if the functions in the ODE is only continuous I'd guess that one can find equations that has non-analytical solutions. Note that the solution has to be derivable somehow or one normally need to put other restrictions on the solution to handle these points.


What's the difference between Azure Database Backup, Copy, and Export

Question: I tried searching online for an answer to the above question but all I see are the long documentations on performing these operations. What I'm looking for is a brief description of how do the following operations differ and when one is preferred (needed) over the other?
Answer: This Microsoft Azure blog post provides some information:
Backup: Provides database backups, including transactional consistent backups and supporting disaster recovery, but does not support on premise restores
Export: Makes a point in time copy of a database, can be restored on premise, was formerly used for backups before the Backup service was available. A copy is required before you can do the "backup."
Copy: Per this article, Copy does exactly what its name implies, making an exact copy of the database in question to either the same server or a different server.
Depending on your needs, you may be using some combination of all of the operations above. For example, if you need on premise backups, you would not use backup, you'd use a combination of Copy and Export. Talk to your system architect to get a better idea of which operations you should use.
Answer: This question will be helpful.
Copy database allows you to do the following :

Pick a source and destination server.
Select databases to move, copy
or upgrade.
Specify the file location for the databases.
Create
logins on the destination server.
Copy additional supporting objects,
jobs, user-defined stored procedures, and error messages.
Schedule
when to move or copy the databases.

In my own word, I would say that copy database allows you to easily move a database from an instance of SQL server to another one.
Export database save the database to a file in the OS file system (like a backup). You then can copy those files and import them whenever and wherever you want.
In my opinion, backing up your SQL Server database is essential for protecting your data. For database, there are many method, you could copy your data, like copy your instance, export all your database.
For Azure SQL database, Azure provides more backup options. More information please refer to this link and this link.


Access EMBED/Object tag using javascript

Question: Can i use javascript to check whether the video is running or stopped? I have to loop the video but putting loop='true' in the embed doesnt work out well. Is there a javascript method to check if the video is running or stopped?
Comment: Please show the code you are using to embed the video.
Comment:
Answer: It depends on what methods the particular object you are using exposes to the JavaScript.
You've tagged this as "flash" - even then it depends on the particular flash object you have, which has to explicitly expose things via the External Interface.


How can I find if I can buy shares of a specific company?

Question: I'm looking to buy shares through a stockbroker, but before I give them the order to purchase shares from the company I want to invest in, I want to check beforehand if that company is listed. How can I check this?
Comment: For information about buying stocks directly from a company, see [Can I buy stocks directly from a public company?](http://money.stackexchange.com/q/60864/10997) Note, however, that there are multiple answers that conflict with the accepted answer.
Comment: Do you want to buy the shares _from_ the company, that is, the _seller_ is the company itself, or do you want to buy shares _of_ the company, in which case the seller is whoever is currently offering to sell shares of that company at the price at which you are offering to buy?
Comment: The latter. If for instance, I wanted to invest in McDonald's, then I want to find out if I can buy shares from that company. I suppose that McDonalds is, of course, a listed company, but this was just an example. Imagine this applied to a small business.
Comment: The **latter** in my comment was the "buy from anybody" case, not the "buy from company directly" case but _your_ explanation of the "latter" is that you want to buy shares in McDonald's directly from McDonald's. Are you sure you understand exactly what you are trying to find out?
Comment: You're right; I didn't mean buying directly from McDonald's, I suppose that's not possible. So what I mean, is that I'll be buying shares through a company like IG or Clubfinance, and I want to check if I can buy shares from a particular business, e.g. McDonald's before I give the order to my stockbroker to purchase shares from that company.
Answer: A company whose stock is available for sale to the public is called a publicly-held or publicly-traded company.  A public company's stock is sold on a stock exchange, and anyone with money can buy shares through a stock broker.
This contrasts with a privately-held company, in which the shares are not traded on a stock exchange. In order to invest in a private company, you would need to talk directly to the current owners of the company.
Finding out if a company is public or private is fairly easy.  One way to check this is to look at the Wikipedia page for the company.  For example, if you take a look at the Apple page, on the right sidebar you'll see "Type: Public", followed by the stock exchange ticker symbol "AAPL".  Compare this to the page for Mars, Inc.; on that page, you'll see "Type: Private", and no stock ticker symbol listed.
Another way to tell: If you can find a quote for a share price on a financial site (such as Google Finance or Yahoo Finance), you can buy the stock.  You won't find a stock price for Mars, Inc. anywhere, because the stock is not publicly traded.
Answer: Hmm... Well there are several ways to do that:

Go to any bank (or at the very least major ones). They can assist you with buying and/or selling stocks/shares of any company on the financial market. They keep your shares safe at the bank and take care of them. The downside is that they will calculate fees for every single thing they do with your money or shares or whatever.
Go to any Financial broker/trader that deals with the stock market. Open an account and tell them to buy shares from company "X" and keep them. Meaning they won't trade with them if this is what you want.
Do the same as point 2, but on your own. Find a suitable broker with decent transaction fees, open an account, find the company's stock code and purchase the stocks via the platform the broker uses.
Comment: The OP has accepted this answer but it is not in fact an answer to what the OP actually wants to know: How can he find out if he can buy shares in a small company _directly_ from the company instead of from anybody who is offering shares for sale on a stock exchange?
Comment: Yes, you're right @DilipSarwate. Thanks for the help Emil, but I misunderstood the whole thing.
Comment: @DilipSarwate It looks like with the OPs recent edit and comment, he has changed his mind about what he is asking, making this a valid answer again.


Where is vertical axis of rotation when we observe car yaw?

Question: Where is located vertical axis of rotation when we observe only car yaw, is this axis  at different places for different angles of steering wheels?
Comment: if you think about it, the logical place is between the rear wheels ... unless the car has four wheel steering
Answer: I have been an Accident Reconstructionist for over 25 years and have been professionally accredited for 12. I also have a degree in mathematics with a concentration in physics.  Yes, The vertical Axis of rotation can and does translate during a real-world yaw event.  Not only that, but there is no assurance that the axis will be orthogonal to the ground plane.  It's location depends upon several factors, including weight distribution, the friction between the car and the surface at the contact points (typically at the tires), and the amount of lean a vehicle experiences during the yaw.
But your question is incomplete:  Are you asking about the center of rotation of the vehicle with respect to itself or with respect to the world?  A vehicle experiencing a yaw is, in fact, rotating about 2 vertical axes - the center of its turn and the center of its yaw.  An old-school critical speed analysis assumes that the only consideration is the center of the vehicle's rotation with respect to its intended path, not its yaw velocity.  But empirical testing has shown this type of analysis to be very imprecise.
In the real world, steering will influence the angle of the front wheels, which then affects the friction (and thus the cornering force) at the front tires.  When the tires are more parallel to the path of travel, they offer less cornering force than if they are turned sharply.  So the axis of rotation is definitely affected by the steering angle.  But can it be predicted by the steering angle alone?  Usually not.
Think of it like a pitcher throwing a curveball.  The ball has a lot of spin on it so that it will negotiate a curved path.  The ball is spinning about its central axis, but it is also traveling along a curved path toward home plate.  We can estimate the center of the ball's rotation about itself, but where its center of rotation with respect to the world is constantly changing.
In most cases during post-impact travel, a vehicle will tend to yaw about one of the ground contact points - especially if a particular wheel is experiencing greater friction than the others or there is a lot of weight shifted to one wheel.  In such a case, steering has no appreciable influence upon either center of rotation.
But in a steer-induced yaw, one of two things must happen.  On a high-friction surface, the steering circle can become smaller as the vehicle slows down until it slows enough to recover lateral stability and the yaw ends; or on something like ice, the steering circle becomes larger as the vehicle "wants" to travel in a straight line. In both of these cases, the steering angle can and does have an affect upon the center of rotation, but how much influence can be difficult to say.
Unfortunately, there are so many variables involved in a yawing vehicle, a precise estimate of the center of rotation almost always must be determined empirically or at least iteratively using very small time increments and a robust tire/vehicle mathematical model (this is how reconstruction programs do it).  Theoretically, we can pick a point to get past many problems, but we probably should recognize that our center of rotation is a potential source of error.
The best way to establish the center of rotation is good documentation of tire mark evidence and a scale model of the vehicle.  Using CAD or even paper and pencil (like we old guys used to do it), the vehicle can be plotted along the tire marks at incremental positions.  Given sufficient positions, the axes of rotation become more clear.  Steering angle is a poor predictor of the axis of rotation unless the vehicle is in a controlled turn.
Comment: **"the center of its turn and the center of its yaw"** But where is center of its yaw?
Comment: @user628075 I agree that your question is incomplete. When the car is turning it can be considered to be turning around the center of the turning arc or about the car's center of gravity. Which you use depends on what you are trying to do. It's really just a matter of referencing.
Comment: @user628075 The phrase "The vertical Axis of rotation can and does translate during a real-world yaw event." means that the "center of the car's yaw" (really, the yaw component of the axis of rotation) can be just about any place.  For a car that hasn't been skewered by an I-beam or something the center of rotation will probably be within the bounds of the car, but I'm sure that Mr. Eisenbeisz has seen _all sorts_ of exceptions to this.
Answer: If you have a "typical" car, with fixed rear wheels pointing straight ahead, "perfect" Ackermann steering, traveling on a perfectly flat smooth surface and traveling slowly enough that there's no tire scrub, then the axis of rotation in a turn from the point of view of the car will be normal to the support surface and extending up through the middle of a line between the rear wheels.
If the car isn't typical, or if it's moving in such a way that the tires are slipping, then the from the point of view of the car the axis of rotation will be, well, somewhere else.
From the point of view of an external viewer, with all of the above "typical slow car" conditions, the axis of rotation will be the center of the turn, and it will be on a line projected between the centers of the rear wheels.


Why does Inari keep her appearance?

Question: Uka gave Inari a part of her divine power because she couldn't transform Inari back after   she wished to look like Sumizome. However, after Inari gave the power back to Uka, Inari didn't turn back to Sumizome. How could she stay "Inari" without the divine power?
Answer: The rules of the god world are not very strict, as we see it proven throughout the series by Amaterasu-sama's careless acts and rash decisions.
Just like the gods didn't lock Inari out of human world for violating the trial rules (not to transform into another human) because that wasn't considered a harmful violation, Inari's "one-time only granted wish" effect of transformation probably wasn't so "one-time".
Or, if you will, it was just the mathematical result of all previous transformations. Because Inari last transformed back into her original form, no more transformations happened after she returned the divine power to Uka-sama. If anything, she would've been transformed back for free, as a gift from Amaterasu-sama for teaching Uka and others a valuable lesson, and to avoid confusion in the human world.
Comment: The (do not transform) trial was a prank. Amaterasu states to Uka shortly after, that the REAL trial was Uka not unleashing her rage on Inari for having used the transformation power (and thus forcing Uka to marry).
Answer: As it turns out, Inari hasn't really lost her powers after giving them back to Uka. Shortly after the point where the anime ends, Inari can see gods again and can use the divine powers again.

Why does Inari keep her appearance?


Why is time taken in hibernation included in system uptime?

Question: When i go into hibernation and resume then look at the result of running uptime , i note that the the hibernation duration is also included.
in pm-hibernate man pages. it states that: "During hibernate the system is fully powered off," .
shouldn't uptime be resetting to zero if the 'the system is fully powered off' or pausing because the system is hibernated hibernated, or is this a bug?
Comment: Uptime is measured from the time of boot - the OS isn't really booted during the time when you resume from hibernation - it's a restoration of a state, saved on the hard drive (where suspend is stored in RAM). So, uptime's not the best metric for determining the overall time the system has been on but, rather, is a metric to tell when the last reboot was.
Answer:
shouldn't uptime be resetting to zero if the 'the system is fully powered off'

suspend/hibernate are not considered "off". The last "wake up time" is stored in /var/log/pm-suspend.log.

or pausing because the system is hibernated

now that would be odd. How would one then know what the actual uptime is?

or is this a bug?

Uptime is the time since last (re)boot. Basically the system stores at boot time what the time is and "now" -/- that time is the uptime. So in that regard: no, not a bug.
The command predates notebooks and hibernate/suspend so maybe if you create a feature request someone decides it is a good feature to have. It  probably is a very easy addition:just update the time stored on disk. And I can not imagine it is a lot more than adding a call to the hibernation/suspend script. But it will also be difficult to get it happen :)


What does "run-time representation" means in programming languages"?

Question: I'm taking a "Programming Languages: Design and Implementation" course and want to know what "run-time representation" means in programming languages?
Comment: Could you be more specific? Run-time representation of what? In what context is the phrase used, and what exactly is it that you don't understand about it?
Comment: @svick It's also referred to as implementation or run-time representation of constructs or also storage representation, I'm not sure, that's why I'm asking. It's used in studying programming languages: design and implementation. I don't understand what it stands for exactly and its meaning.
Answer: To understand it, you need to remember that (contemporary) computers only know integral numbers (in various lengths: 1, 2, 4 or 8 bytes), IEEE floating point numbers (4 or 8 bytes) and memory addresses (pointers, 4 or 8 bytes).
Thus when you want to have a list, for example, you (or, at least the compiler writer of the language you are using) need to think about how  lists will be represented (!) in memory at runtime.
One possible representation for elements of singly linked lists:
<code>|________|________|
DataPtr   NextPtr
</code>
The list node takes two adjacent pointer sized memory words, the first one points to the actual data, the second word points to the next list node.
There are two things to note here:

The representation is quite arbitrary. For example, we could switch the data and the next pointer, and this would be another representation that is as good as the former one.
Consider the run-time representation of a tuple or pair. It could be:
|________|________|
PtrFirst  PtrSecond
that is, two memory words that hold pointers to the first and second component, respectively. Sounds familiar?
Well, how can we tell whether two subsequent words that hold pointers represent a pair or a list element? We can't! Many of our data abstraction will end up using the same run-time representation.


Windows Server 2012 R2 Secure / authenticated (i.e. using MD5 signed packets) NTP implementation (client) with an external (non AD) Time Server

Question: I would like to ask if Windows Server 2012 R2 is able to authenticated NTP  implementation (acting as a client) and using a defined (not Kerberos or AD related) symmetric key for authenticating and exchanging the NTP packets.
Comment: The NTP protocol defines the use of an MD5 hash for validating the authentication of NTP from a server. There is no need to encrypt NTP, but there may be a need for a client to verify the server. As @Marc-Antoine Favreau points out, SNTP is something different.
Answer: To my knowledge SNTP means "Simple Net Time Protocle" and not "Secure". Also, the Windows NTP service can only use Kerberos as a mean of authentication.

The Simple Network Time Protocol (SNTP) is a simplified time protocol that is intended for servers and clients that do not require the degree of accuracy that NTP provides. SNTP, a more rudimentary version of NTP, is the primary time protocol that is used in Windows 2000. Because the network packet formats of SNTP and NTP are identical, the two protocols are interoperable. The primary difference between the two is that SNTP does not have the error management and complex filtering systems that NTP provides. For more information about the Simple Network Time Protocol, see RFC 1769 in the IETF RFC Database.

How the Windows Time Service Works
Answer: No.  Microsoft has a custom authentication mechanism in their NTP implementation of the Windows Time Service, but not as you describe. It's also used only for authentication.  The Authenticator and ExtendedAuthenticator extensions are published here:
[MS-SNTP]: Network Time Protocol (NTP) Authentication Extensions
https://msdn.microsoft.com/en-us/library/cc246877.aspx
Comment: Thank you for your comment - I edited the question accordingly. Could someone please clarify if if would be possible to configure the built in Windows Server NTP client (actually the SNTP client) to perform authentication against an external NTP server (accessible over the Internet and not part of any client-side known AD Domain), providing NTP authentication based services (i.e MD5 hashing using a pre-defined symmetric key) ?


Prevent Silverlight 3 from caching while debugging

Question: I'm assuming the issue I'm having is related to caching. Code changes I make are not getting picked up when I debug. Most times I get served a previous version of the app. How do I prevent this from happening?
Comment: Hello, is this mic on??  ...   You have 4 upvotes on this question but you haven't responded to my questions above nor have you responded to any of those who have taken the time to attempt to answer your question.
Comment: How are you debugging, running in Visual Studio? Do you have a test web site in the solution? What browser are you hosting the SL in?
Answer: Try to add to the page that hosts Silverlight application on Page_Load:
      Response.Cache.SetExpires(DateTime.Now.AddSeconds(-100));
      Response.Cache.SetCacheability(HttpCacheability.NoCache);

Answer: Ctrl+F5 is an easy way to refresh a page and clear the cache of that page at the same time - it may help :)
Answer: Append a "version" querystring to your XAP Url, something like:
http://localhost:1234/ClientBin/my_silverlight_app.xap?v=1.0.287.5361

This will trick the browser (and many web servers) to think that this is a different file. And when the cache problem appears again, increase the number.
If you then want to employ proper caching, do it on the server-side with OutputCache directives.
Answer: In Firefox, I use the 'web developer' plugin and simply select to 'disable cache'. Works fine.
Comment: I cannot tell this to every user of my website, so I have a better solution for everyone.
Comment: This is for debugging only. You don't need to tell every user of your website, it also breaks the cache implementation for the rest of your users.
Comment: Well we do not want caching of old version when we release new version, there is no question of breaking.
Answer: As far as I see, this seems to be a problem with Firefox - when I used IE8, this didn't happen to me (I realize this may open its own can of worms, but at least for debugging and testing Silverlight, IE is much better)
Answer: I have not had any issues with Silverlight assemblies getting cached - you might want to try debugging the HTTP requests that go back and forth, to see if maybe your server is instead returning incorrect information to the browser (e.g. a "not modified" response).
For general no-cache behavior, the only reliable method I have found is to turn off caching in the browser.
For IE, this has been the only reliable option - otherwise, even if proper no-cache headers are sent, certain things are still cached (specifically, dynamically loaded resources which are accessed via Javascript XmlHttpRequest). I have not specifically had issues with Silverlight getting cached when it should not, though - IE has always loaded the latest updates even if cache is enabled.
Firefox has been much more problematic - even when disabling cache, it still sometimes caches XmlHttpRequest-loaded resources. Manually hitting Refresh a few times has been the only solution in such a case. Once again, I have had no issues with Silverlight assembles, even if cache is turned on.
Answer: Firefox 3.5 under Tools has the option for Private Browsing. Click that to disable caching.
Answer: Here is how I have done it for flex/flash and silverlight and it works.
Code Behind ASPX or CSHTML
string slUrl = "/ClientBin/MySilverlight.xap";

string filePath = Server.MapPath(slUrl);

FileInfo info = new FileInfo(filePath);

// this will force browser to
// re download file if file was
// updated
slUrl += "?t=" + info.FileWriteTime.Ticks;

ASPX or CSHTML
<embed ....
   src="<%= slUrl %>"
   ..
/>

Trick is you have to change url by adding something after ? and make a new arbitrary random query string or use file write time, and for browser, something?t=1 and something?t=2 are two urls and it will not pickup cache if t changes.
Instead of write time, you can also choose any standard config value or you can even simply hardcode your ASPX or HTML and append something after ? that will force browsers to download silverlight xap file again.
<embed ....
   src="/ClientBin/MySilverlight.xap?something-different-each-time"
   ...
   />


12 balls weighing puzzle

Question: In an article describing the twelve balls weighing problem, the author mentions a solution that involves the finite projective plane of order 3, discovered by Rick Wilson.  Does anyone know what this solution could have been?
Comment: Interestingly, Problem 20K in van Lint and Wilson's "A Course in Combinatorics" is a generalization of the 12 balls problem to the problem of finding the counterfeit coin among (3^r-1)/2 - 1 coins in r weighings.  Their solution appears to be similar to the one in the article you link to.  They make no explicit mention of the projective plane of order 3, but since the problem is posed immediately after their discussion of how codes were used to rule out the existence of the plane of order 10, there may be some connection with the ternary code of the plane that I'm not seeing immediately.
Answer: Will Orrick is right, the problem is solved by exhibiting a matrix $3\times 12$ with entries in $\{-1,0,1\}$ where all columns are pairwise independent and the row sums are zero, as mentioned in Wilson's book.
In general you can solve the $\frac{3^r-1}{2}-1$ coin problem using $r$ weighings. You need to use one of the generator matrices of the simplex code, so the columns are given by the points in the projective space $P(r-1,3)$ (you throw out the point at infinity) and by induction show that the choices can be made to arrange the zero sum rows. For the case of 12 coins it suffices to consider the projective plane, and you get a constant weight code and thus end up weighing groups of 4 coins each time.

12 balls weighing puzzle


Arduino USB Power vs External Power Supply

Question: Why is the Arduino able to accept ~5V from the USB, but requires a min of 7V when using an external power supply?
Answer: The design assumes USB provides a regulated 5v so no further regulation is necessary. The power connecter is meant to accept a wider range of voltage and regulate it to 5v, and the kind of regulators used on the Arduino board need that much higher voltage to provide regulation. If you already have a regulated +5v source you can supply it to the 5v pin. You'll bypass the on-board regulator this way, so just know that it will then be up to you to provide clean power.
Comment: Brilliant answer without getting into technical details that can confuse members that are not experienced in electronics.
Answer:
Above is an AA Battery voltage curve. Many people assume that 5* 1.5V AA batterys would be enough to power the Arduino. As you can see the 1.5 is the maximum voltage and it quickly drops. Different brands have different values and sometimes this can drop below the value of the voltage regulator input. I usually tend to aim between 7 and 9 Volts for  running from batteries, ie the nominal voltage of the batteries, eg 6 x 1.5V = 9V.
For wall socket charges, Buy a cheap one and hook it up to a volt meter, Many that say 5V actually have a range of values. Raspberry Pi users often have problems with power caused by manufacturers saying its 5v and it actually delivering something like 4.85 and fluctuating beacuse of the power demand of the pi
Comment: If you want to run from batteries, using the built-in voltage regulator is a really bad idea. Best case you are dropping 2.5V when the batteries are fresh - at 0.5A this is 1.25W wasted. The regulator will start to drop out at 6V, which is 1.2V per battery. This isn't very far into the discharge at all. Bypass the regulator and design the system to deal with varying voltage, or use a good boost converter.
Comment: I've edited your text to clarify that you mean to aim for a nominal* voltage between 7 and 9V. I assume thats what you meant?


Keyboard layout settings conflicting

Question: I just changed my keyboard to an Ergodox with a US layout (previously it was Portuguese)
I use Arch Linux with Gnome 3, so I went to the settings manager, and added US as the default keyboard layout. As it turns out, that didn't work
If I set the current layout as PT, it all works as expected. When I change it to US though, everything is messed up. Here's the output of me pressing Shift-2 for a couple of seconds:
"""@@"@@@""""@@""@"@@""@@"@"""@@""@""@@"@@@""""@"@""@
As you can see, something is conflicting with the definition of the current layout. I cant at any point have a fully US keyboard. I either have full PT, or just a mix that changes randomly
Again, this is only a problem outside of my terminal, where I can fix it with setxkbmap us.
I have tried setting this option in xinitrc, but that didn't work either
EDIT:
After some more debugging, I noticed this is probably cause by either tmux or X11.
The way I reproduce this:

Add the PT layout on Gnome Settings.
Remove the PT layout again, leaving only US
At this point, Chrome, Sublime and all regular apps seem to be stable at US layout
Alt-tab to a tmux window. It is still in US layout
Alt-tab back out. Now everything is in PT layout
Answer: I ended up fixing this just now.
I tried temporarily renaming my ~/.config directory so that it wasn't found. And that seemed to fix it. I then handpicked some of the config subdirectories I wanted to keep, copied those over to the newly created .config directory, and made sure everything was still working properly
I lost some useful configs, but at least now whatever was messing up my keyboard layout is gone for good.

Keyboard layout settings conflicting


Is it possible to use use a 4x3 monitor

Question: I have a 1280 x 1024 monitor I want to use as display. I have an HDMI to DVI adapter. What must I configure to make it work?
Comment: [Everything you wanted to know about video options in config.txt but were too afraid to search for](https://www.raspberrypi.org/documentation/configuration/config-txt/video.md)
Comment: A 4x3 is 4 pixels by 3 pixels, how small do you want this screen?
Comment: @BlackOps-9-Elite 4x3 is the _aspect ratio_ of the screen, not the pixels. In other words, the ratio of width to height.
Answer: You shouldn't need to configure anything. Because you said you have a HDMI to DVI adapter, I am assuming your monitor is DVI. So just plug the pi's HDMI into the monitor (using the adapter) before turning the pi on and then turn on the monitor and then the pi and it should work.
If it doesn't you may need to force the HDMI connection. Put the SD card in your computer and edit the config file in the boot partition, as described here.
More ways to edit the HDMI configuration can be found here. (Thanks, Jaromanda X.)
Comment: @JaromandaX Ok.
Comment: @DelDavidson Does it work know? If so please could you accept the answer? This will finish the question and show other users that it has a solution.
Comment: that's rather sparse info in that link ... https://www.raspberrypi.org/documentation/configuration/config-txt/video.md is where you get real information :p
Comment: Yep, monitor was not on first... Thanks, Del
Comment: @DelDavidson Please accept the answer by clicking the green check mark to the left of the answer.
Answer: 4:3 1280 x 1024 computer monitors will work because i have used my raspberry pi with a 4:3 1280 x 1024 computer monitor before and it works automatically with no configuration and i used a hdmi to vga adapter because my monitor was vga only
Comment: Agree. I use a screen with the same geometry and a simple HDMI to DVI cable

Is it possible to use use a 4x3 monitor


Rotation matrix in the EPSG

Question: I use Proj4j for a WebGIS and I have to create a new ESPG.
I tried on QGIS to convert coordinates from a local system (in Greece) to a world coordinates system.
First, I have to do a 2D transformation: 2 translations (Tx ans Ty) and a rotation (Rz) of about 0.58931 radians around the "z axis" (in the plane of the local system) between the local coordinates and the Greek coordinates (EGSA87).
So I think that the rotation matrix is: [cos(Rz),-sin(Rz);sin(Rz),cos(Rz)] and without the cos and sin I have [0.8313242,-0.5557878;0.5557878,0.8313242].
Then, I can reuse the parameters of the EPSG:2100 definition:
+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=-199.87,74.79,246.62,0,0,0,0 +units=m +no_defs

I think I can insert the translations (Tx and Ty) in the x_0 and y_0, but I don't know how to insert the rotation matrix. How can I insert a transformation with a matrix in a new EPSG?
I found on the internet that the +xform= command seems good, but I don't know how to use it. I tried:
+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=-869388.894 +y_0=-4260031.458 +xform=[0.8313242,-0.5557878,0.5557878,0.8313242] +ellps=GRS80 +towgs84=-199.87,74.79,246.62,0,0,0,0 +units=m +no_defs

But apparently it isn't a good solution. So, does anyone know how I can use this command in my new EPSG or where I can find the proj4 documentation?
Answer: You can set up a local oblique mercator projection to get the rotation, as I described in my answer here:
Using customized Coordinate System in ArcGIS Desktop?
Your rotation parameter +alpha would be 33.765 degrees. You have to expriment about the sign to be used.
The Proj.4 parameters are listed here: http://trac.osgeo.org/proj/wiki/GenParms, but xform is not included.

Rotation matrix in the EPSG


Command to 'gzip' a folder?

Question: I am new to Mac command prompt stuff. How do you create a gzip of a folder in Mac OS X? I was told by a few folks that if you want to create a gzip of a folder you should 'tar' it first and then 'gzip' it. Is this correct?
Comment: This isn't a programming question?  Your post is tagged with `objective-c` but you're asking about the command-line.
Answer: Tar is the archive tool and gzip is the compression tool. In order to compress a full directory, first you need to archive it to a single file. That's what the job is tar. and then you compress the archived file. You can do both task in a single tar command with proper option.
tar -czf folder_name.tar.gz folder_name/
If you don't want to make a tar archive (may be you want to compress just a single file), then you can use gzip command directly.
gzip file.txt
It will create a compressed file named file.txt.gz
Comment: It's worth mentioning what the options `-czf` after `tar` are for: `c` indicates that you want to create a tar archive, `z` applies `gzip` on the intermediate tar archive, and `f` is for the subsequent final file name `folder_name.tar.gz`.
Comment: Warning: `gzip file.txt` replaces the original file.
Comment: @Zoltán Use `gzip -k file.txt` to "keep" (don't delete) the input file.
Answer: If somebody is still finding this question when searching "gzip in Mac", I wrote a guide that it may be useful to somebody else. Here it goes:
Compressing
The most basic command will compress the file filename.ext and then replace it with filename.ext.gz in the same directory.
gzip filename.ext

If you don't want to lose your original file, then you need to pipe the output of gzip -c to a file.
gzip -c filename.ext > anotherfile.gz

We can also compress from standard input, so we can compress the output of other commands.
cat filename.ext | gzip > anotherfile.gz

OS X also comes with the compress and uncompress commands. They make for a "smarter" gzip, as it doesn't compress the file if it would grow after the compression process. The following command replaces filename.ext with filename.ext.Z in the same directory.
compress filename.ext

Decompressing
To restore a file to it's uncompressed natural state you can use gzip or other of the wrappers. The decompression mode of gzip is called with the -d flag. This mode will replace the file filename.ext.gz with filename.ext in the same directory. There's also a shortcut called gunzip that will do the same.
gzip -d filename.ext.gz
gunzip filename.ext.gz

We can also pipe the decompressed file to the standard output to save it to another file.
gzip -cd filename.ext.gz > anotherfile
gunzip -c filename.ext.gz > anotherfile

Another quick way of reading the content of a gzip to standard output is zcat, it's basically the same as calling gzip -cd but you can call multiple files and have them concatenated the same way as the cat command concats text files. The only drawback is that your files need to be suffixed with the .Z suffix for it to work...
zcat filename.ext.Z
zcat file_a.Z file_b.Z file_c.Z

But fear not! zcat it's still useful, because it can decompress from standard output. So you can basically pipe your files to zcat to have them decompressed on the terminal window.
cat filename.ext.gz | zcat

This is very useful if you need to check the content of a file really quick, and you can even save the output of zcat to a file, just as easy.
cat filename.ext.gz | zcat > anotherfile

The uncompress wrapper works like gzip -cd but it looks for files with the .Z extension to replace them in the current directory, so you only need to specify the file name you want to restore, but it's alright if you call it with the .Z extension, as the program will ignore it.
compress filename.ext
uncompress filename.ext

I hope you find my guide useful :)
Answer: MacOS X is Unix so this should work (this work on GNU/Linux)

tar czvf compressed.tar.gz folder
Answer: Yes, you have do tar the directory first. The tar-command can do both:
tar -czf archiv.tar.gz mydir/

extract your archiv:
tar -xzf archiv.tar.gz

Answer: To add to the answer by @taskinoor: if you use single file version, aka
gzip file.txt

be aware that the original file (file.txt) will be removed and you'll have only file.txt.gz
I would put this as comment but dont have enough karma to do that :=)
Comment: `gzip --keep file.txt` will keep the original and create `file.txt.gz`. See `gzip --help`.
Answer: Yes, this is correct. gzip can only compress a file. tar encodes the directory contents into a single file, which can be further compressed using gzip, bzip2, lzma or anything else.

Command to 'gzip' a folder?


Why use Singleton to manage db connection?

Question: I know this has been asked before here there and everywhere but i can't get a clear explanation so i'm going to pitch it again. So what is all of the fuss about using a singleton to control the db connection in your web app? Some like it some hate it i don't understand it. From what I've read, "it's to ensure that there is always only one active connection to your DB". I mean why is that a good thing? 1 active DB connection on a data driven web app processing multiple requests per second spells trouble doesn't it? For whatever reason nobody can properly explain this. I've been all over the web. I know i'm thick.
Answer: Assuming Java here, but is relevant to most other technologies as well.
I'm not sure whether you've confused the use of a plain singleton with a service locator. Both of them are design patterns. The service locator pattern is used by applications to ensure that there is a single class entrusted with the responsibility of obtaining and providing access to databases, files, JMS queues, etc.
Most service locators are implemented as singletons, since there is no need for multiple service locators to do the same job. Besides, it is useful to cache information obtained from the first lookup that can be later used by other clients of the service locator.
By the way, the argument about

"it's to ensure that there is always
  only one active connection to your DB"

is false and misleading. It is quite possible that the connection can be closed/reclaimed if left inactive for quite a long period of time. So caching a connection to the database is frowned upon. There is one deviation from this argument; "re-using" the connection obtained from the connection pool is encouraged as long as you do so with the same context, i.e. within the same HTTP request, or user request (whichever is applicable). This done obviously, from the point of view of performance, since establishing new connections can prove to be an expensive operation.
Answer: High-performance (or even medium-performance) web apps use database connection pooling, so one DB connection can be shared among many web requests. The singleton is usually the object which manages this pool. I think the motivation for using a singleton is to idiot-proof against maintenance programmers that might otherwise instantiate many of these objects needlessly.
Answer: "it's to ensure that there is always only one active connection to your DB." I think that would be better stated as to ensure each CLIENT has only one active connection to your DB. The reason why this is incredibly important is because you want to prevent deadlocks. If I have TWO open database connections (as a client) I might be updating on one connection, then I might try to update the same row in another connection. This will a deadlock which the database cannot detect. So, the idea of the singleton is basically to make sure that there is ONE object who is charge of handing out database connections to each client. Basically. You don't HAVE to have a singleton for this, but most people will tell you it just makes sense that the system only has one.
Answer: You're right--usually this isn't what you want.
However, there are plenty of cases where you need to throttle yourself down to a single connection. By serializing your access to the database through a singleton, you can address other issues or constraints like load, bandwidth, etc.
I've done something similar in the past for a bulk processing app. Instead, though, I used a semaphore to synchronize access to the database so I could allow n concurrent db operations.
Comment: Nice idea with the semaphore for throttling.
Answer: One might want to use a singleton due to database server constraints, for example, a server might limit the number of connections.
My main conscious reason is that you know what connections can be managed/closed etc., just makes things a bit more organised when you don't have unnecessary, redundant connections.
Answer: I don't think it's a simple answer.  For instance on ASP.NET, the platform implements connection pooling by default, so it will automatically adjust a "pool" of connections and re-use them so you're not constantly creating and destroying expensive objects.
However, let's say you were writing a data collection application that monitored 200 separate input sources.  Every time one of those inputs changed, you fire off a thread that records the event to the database.  I would say that could be a bad design if there's a chance that even a fraction of those could fire off at the same time.  Suddenly having 20 or 40 active database connections is inefficient.  It might be better to queue the updates, and as long as there are updates left in the queue, a singleton connection picks them off the queue and executes them on the server.   It's more efficient because you only have to negotiate the connection and authentication once.  Once there's no activity for a while you could choose to close down the connection.  This kind of behavior would be hard to implement without a central resource manager like a singleton.
Answer: "only one active connection" is a very narrow statement for illustration. It could just as well be a singleton managing a pool of connection. The point of a singleton for database connections is that you don't want every consumer making it's own connection or set of connections.
Answer: I think you might want to be more specific about, "using a singleton to control the db connection in your web app." Ideally, a java.sql.Connection object will not be thread safe, but your javax.sql.DataSource may want to pool connections, so you should go to a single instance of it to share the pooling.
Answer: you are more looking for one connection per request, not one connection for the entire application. you can still control access to it through a singleton though (storing the connection in the HttpContext.Items collection).
Answer: It guarantees that each client using your site only gets one connection to the db.
You really do not want a new connection being made everytime a user does an action that will create a db query. Not only for performance reasons with the connection handshaking involved, but to decrease load on the db server.
DB connections are a precious commodity, and this technique helps minimize the amount used at any given time.
Comment: I would assume that the alternative would be connection pooling, though I admit that is a lot to assume in some cases.
Comment: this was the light bulb answer for me - "one connection per client". Not per app. I know it was echoed by a few others below too. Lots of helpful responses here. Great crowd @ StackOverflow.
Comment: Well, this would work for applications that do not open too many connections to the database. That's when connection pools kick in. The 'one connection per client' doesn't play well with a scalable architecture.


Treating factorial design as complete randomized design

Question: Lets say I have 10 different treatments and these 10 treatments can be considered combinations of 2 factors - as in a factorial design experiment. What do I miss if I treat this data as coming from a complete randomized design instead of a factorial design? What will be the consequences?
Answer: The randomization in a completely randomized design refers to the fact that the experimental units are randomly assigned to treatments.  Even though a factorial design is very structured, you can still assign the experimental units to the levels randomly.  This prevents bias due to the differences in your experimental units from being confounded with effects you want to observe.  So, in answer to your question, there would be no consequences.
If you can't completely randomize the allocation of units to treatments but you can randomize it to some degree then there are sometimes ways to handle it in the analysis (see split-plot designs for example).  Otherwise you're in a bad spot, and reasonable people might hold that any inference from your experiment is invalid.
Comment: Hm, isn't the main problem the reduction of information you get depending on which treatment design you adhere to? What about if experimental units were randomly assigned to the 10 treatments. The treatment design could then either be considered as 10 separate treatments or as a combination of 2 factors as in a factorial design. Then I could run a ANOVA with either the 10 separate treatments or I could run a ANOVA with the two factors and the interaction, that is to say, the factorial design would yield information regarding the factors and information instead of just the treatments?
Comment: You're referring to two different ANOVA *models*.  You can fit the cell means model where each combination of treatments has its own mean, or you can fit a factor effects model with various levels of interactions.  But you're not losing information: the cell means will be the sum of the mean, factor effects, and interactions at the various levels.


Migrate Custom Links to Lightning Experience

Question: In classic left navigation bar, I have Custom Links on home tab under Useful Links section. These link connect to external application (something like http://Test.domain.com/createUserForm).
In Lightning experience, when I navigate to same Useful Links section, I do not see these custom links under Useful Links section. I think, may be because these links are not supposed to be available in Ligntning, as per my knowledge. Please correct me if I am wrong.
Now the question is, how do I convert these links so that they are available in both classic and lightning? Any links to blogs or examples appreciated.
Answer: Sidebar will not be available as Lightning Experience is based on mobile first design approach.
Possible solution is :
For Lightning Experience:

Put your custom links in one custom object
Create one lightning component and add this to all app pages/record pages/home pages.

For Classic:

Put your custom links in custom object
Create one home page component and add this to sidebar.
Comment: Thank you Himanshu for quick response. For classic I already have home page component with the links. As per your suggestion in #1, I will use that approach, just looking for some example as I have never worked with lightning components. Also one follow up question,  if the application is not using lightning components, will I be able to use the lightning component?
Answer: Seconding Himanshu's answer. Idea for the idea exchange for that is here: https://success.salesforce.com/ideaView?id=08730000000Dz41AAC
Comment: I agree with Himanshu's answer. However my ink is merely opening a jsp form in a new window. So instead of creating a lightning component for this purpose I added a Rich text area to Lightning experience home page and added my links in there. It's working as expected. If there are any red flags you experts see in this approach please let me know.


How to synchronize photos from MacBook to iPad without erasing photos in iPad?

Question: I used to synchronize photos between PC and iPad. Recently I have a new MacBook and I imported some new photos into iPhoto of the MacBook. Now I need to copy the new photos to the iPad. Can I do this via synchronization (or some other ways) without erasing contents in the iPad? Do I have to first copy the photos from iPad to Mac?
Answer: If you try to synch your iPad with the new iTunes on your new machine, your pictures on the iPad will be erased and replaced with the new pictures. You have to copy pictures from iPad to your MacBook then sync with it.
Comment: Do you know any convenient way to do it, if I don't have access to the old computer?
Comment: I also want to preserve the directory structure of the photos in the iPad.
Comment: If I were you and I have access to the old computer, I would export my photo Library and import it to the new computer then synch the iPad with the new computer.
Comment: There are several softwares like this one http://www.ipod-computer.net/guide/copy-photos-from-ipad-to-macbook.html, which you can transfer your photos from iPad directly to your new computer.


Why does Old Man Marley give creepy look if he's actually nice in Home Alone?

Question: If Old Man Marley from Home Alone is actually a nice man then why does he always give Kevin a cold and creepy stare (particularly when Kevin shouts that he's not afraid anymore)?
Answer: He doesn't give that cold and creepy stare, he looks like so.
Kevin's brother has told stories about that old man the he murdered his family with snow shovel. This is the reason why Kevin gets scared of him, shouts after seeing him and tells him that he is not scared.

Buzz: Check it out. Old man Marley.
Kevin's Cousin: Who is he?
Buzz: You ever hear of the South Bend Shovel Slayer?
Kevin's Cousin: No.
Buzz: That's him. Back in '58 he murdered his whole family and half
the people on the block with the snow shovel. Been hiding out in this
neighborhood ever since.

Certain people may appear creepy by their looks or because you might have heard stories about them, but you cannot know them if they're nice or not until you talk with them or see them doing things that may make you sure that they are not nice.
This was the same case for Kevin as well. Kevin is a kid and he is easily scared by the people appearing creepy just like that lady in Home Alone 2.
Comment: I agree with this answer. Also, certain scenes in that film are, at least initially, presented as Kevin sees them eg when he first goes into the cellar. Perhaps Mr Marley looks scary because Kevin expect him to.
Comment: And he expects him to be scary because of Buzz's stories.  Why wouldn't an old man with no wife or kids/grandkids around not be a little worrying?


Croatia to Ljubljana (Slovenia) for U.S. citizens ok?

Question: We are 2 middle aged couples traveling to Croatia in June 2015. We want to drive through Ljubljana (Slovenia) from Zagreb. We are U.S. Citizens, and of course we have passports. Is this an easy process? We will be headed to Pula.
Comment: Croatia is not yet part of the Schengen area, so it will be just another border crossing. Neither country requires US citizens to have a visa, for visits up to 90 days in a 180 day period.
Comment: @MichaelHampton actually because both countries are in the EU, I understand that they are consolidating their border posts, or at least some of them.  At these consolidated posts, one will need only to stop once rather than twice.  I haven't experienced this firsthand, however.
Comment: @phoog Right. Croatia is in the process of joining Schengen, so there may be reduced or no exit border controls here.
Comment: @phoog: I crossed back and forth between Slovenia and Croatia at the Kaštel  border crossing a few weeks ago and while the Croatian checkpoint has been closed, the Croatian border police has their own immigration check at the Slovenian checkpoint and you actually have to stop twice, once for Slovenian/Schengen exit control and once for Croatian immigration control. Even if both countries are in the EU, it is still an outer Schengen border and the passport control was relatively strict, even for me as a citizen of a Schengen country.
Comment: @Tor-EinarJarnbjo Interesting.  I crossed there a couple of summers ago, before Croatia joined the EU.  I don't remember the control being particularly rigorous.  If I recall correctly, I mistakenly showed my non-EU (US) passport to the Slovenian guards instead of my Schengen (NL) passport.  My wife showed her Croatian passport -- perhaps that was the reason for the relatively casual scrutiny.
Comment: @phoog Some crossings with Slovenia are joint, others not. The one on the road from Zagreb to Ljubljana is joint, while the one on the road from Zagreb to Maribor is not. Got fresh experience with both
Comment: @Crazydre I've only ever crossed that border on the Adriatic coast. Never been to Zagreb.
Answer: As said by Michael Hampton, no additional documents other than passports are necessary for you, so: Yes, unless you come with a truck etc. (content check), it´s as easy as it can get.
Take (one of) the correct lane(s) for normal, private cars (see the symbols above in the picture, all border points look similar); hand your passport through the window, get it back, and drive on.
Note that the queue of waiting cars can get a bit long, especially in summer.
[Unconfirmed if it's still valid: In theory, at least at some locations there is an exit check of one country and an entry check of the other, but in practice, one part will check the passport and on the other side some policeman will stand around and just look at the cars while they drive past him.]

(source: hudin.com)
Comment: This does not match my experience while crossing intra-EU, but outer Schengen borders several times within the last year. I have never managed to leave the Schengen area without proper exit controls, and it would be a severe violation of the Schengen regulations if one country would let people leave the Schengen area unaccounted for. It would also lead to definitive problems for all non-EU or non-EEC nationals leaving the Schengen area through these border crossings, since they would not have proper exit stamps to prove the time spent there.
Comment: @Tor-EinarJarnbjo I don´t fully understand what you´re getting at. Why do you think non-EU people won´t get stamps? About the rest, I didn´t mean that one country doesn´t care, but that the have some sort of agreement that one single person will do everything instead of one person of each country.
Comment: @Tor-EinarJarnbjo About your other comment above: Well, that´s interesting... actually, I wasn´t in Croatia for more than three years, so maybe the really got stricter.
Comment: I am getting at you mentioning only a theoretical possibility of an exit check. If you are e.g. leaving Slovenia and entering Croatia (as in this case), the Slovenian border police is bound by the Schengen agreement to perform a regular exit check. For the purpose of immigration control, it does not really matter that the destination country is another EU country if it is not a Schengen country. I would hardly doubt that the Schengen agreement allows the Croatian border police to perform the exit control, making two checks (exit SLO and entry HR) essential.
Comment: @Tor-EinarJarnbjo Well, I´m no lawyer or anything like that, and I´m not saying you´re wrong (not at all), but I´m as sure as I can get that it did happen in the past. Even if it was illegal. (Well...confirmed cases of lazy and corrupt border guards in several countries around here do exist, asking for money from clueless people). OP: You don´t need to pay anything for crossing the border itself :) (custom stuff is another thing, if you have something applicable)
Comment: And watch the signs; some borders will have separate lanes for non-EU/EEA/Switzerland passport holders.
Answer: Live 15 min from that border. There will be to lines. EU/EEA/CH and All other.
If you have EU/EEA/CH passport you have to get in the EU/EEA/CH line. You will need to show your passport of EU ID card. You will not be questioned, only your document will be checked if it is genuine. If you dont have EU/EEA/CH passport take "All others" and you will have to stop only on Slovenian side. (Croatian border does not operate). At Slovenian booth there will be Croatian officer who will take your passport and check it if you overstayed (etc) and you will get Croatian exit stamp (all non-EU/EEA/CH citizens get one). Then you will have to give your passport to a Slovenian border officer. He will check your passport and might question you why are you coming, do you have enough funds (etc) like all normal immigration controls. It my also happen that the officer dont ask you anything. If you satisfy immigration requirements you will get Entry Stamp.
As both countries are in the EU there will be no Customs Controls.


Meaning of the "but" in the sentence

Question: I'm trying to help my student to translate one of the manuals which she needs for work. There is a sentence that I don't understand completely:"For example, you might want to track the license number for automobiles, but the square footage for buildings". To be honest, I don't see a point of the "but" at all. It describes one of the functions of the program, so it's the main context here.
Please, can anyone explain what is this "but" for and how it changes the meaning of this sentence?
Thanks in advance.
Comment: Assuming the text is as given, it is contrasting the types of information in both clauses and the word *but* points out that they differ. In the first case, the software must handle car licence numbers, which (in the UK) can be alphanumeric, and in the second case, areas.
Comment: Likely a typo. *But* requires a contrast as in "You might **not** want to track the license number for automobiles, but [rather] the square footage for buildings.
Comment: Yeah, @Mick is probably right and this would be more obvious if you'd quote the preceding sentence or two...
Comment: "Descriptive flexfields allow you to collect and store additional information about your assets. For each asset category, you can set up a descriptive flexfield to prompt you for additional information based on the asset category you enter. For example, you might want to track the license number for automobiles, but the square footage for buildings. When you specify a category for a new asset, you can enter your information in a descriptive flexfield."
Comment: Insert 'on the other hand' after the 'but', then explain that it can be dropped. Or simplify: ' ... track _a_ in situation _A_, but _b_ in situation _B_.
Comment: This *clearly* looks like a typo to me.
Comment: @aparente001 Not at all, 'but' makes perfect sense in the given context.
Answer: As Mick notes in his astute comment, the use of the conjunction points up a contrast in the clauses.
To simplify the construction, let's reduce it to more common terms.

I drink coffee in the morning, but I drink wine at night.

or

I drink coffee in the morning but wine at night.

Here the speaker contrasts a morning beverage with an evening one. This emphasizes the uses for each: one for waking up, the other for winding down.
Note that a different conjunction can be used as well:

I drink coffee in the morning, and I drink wine at night.

or

I drink coffee in the morning and wine at night.

Here the contrast is allowed to emerge, if it can, from the organic elements of the sentence. If the terms have any natural contrast, as coffee and wine appear to, then a contrast is expressed whether or not it is emphasized by means of the conjunction.
Suppose there is no innate contrast in the terms.

I drink milk in the morning and fruit juice at night.

The statement becomes neutral, a distinction that relies merely on time expressions to set the terms apart. The beverages could be reversed without suggesting any intrinsic contrast between them, and the reader or listener could suppose that the choice is simply your custom. If the speaker uses but to coordinate the clauses, however, we are being asked to entertain the possibility that there is a reason for drawing the distinction:

I drink milk in the morning but fruit juice at night.

The distinction still may not be obvious (as it would be in the case of coffee and wine), but this sets up the contrast for further discussion:

I drink milk in the morning but fruit juice at night. Milk calms my stomach in the morning, while the sugars in the juice keep me from overeating at supper.

The reasons are unimportant, and and could well be used to coordinate the clauses here as well, but but takes us more firmly by the hand and leads us in that direction.

Meaning of the "but" in the sentence


$index of Object in Array while using ng-repeat and a filter

Question: Im fairly new to angular and have been able to get around somewhat. But I cant seem to find the answer to this scenario...
I have an array of objects, which I am pulling down from firebase. I am using an ng-repeat for the objects, then displaying data accordingly. I am trying to pass the index as a routeparam to an "edit" controller. In which case I would like to pull the object data as one would anticipate. However, when I filter the ng-repeat I am getting the index of the filtered content. where am I going wrong in finding the true index?
  .config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$routeProvider
  .when('/profiles/:index', {
    templateUrl: '../views/profile.html',
    controller: 'profileCtrl'
  });

Route is above, Controller is below
  .controller('profileCtrl', function( $scope, $routeParams ){

$scope.teamProfile = $scope.ourTeam[$routeParams.index];
    $scope.index = $routeParams.index;
});

And finally the snippet of html from within the repeat.

{{member.name}}{{member.handle}}

Comment: Did you mean `{{index}}` instead of `{{$index}}`?
Answer: Try this :

{{members.indexOf(member)}}

indexOf always returns the original index in an ng-repeat
Demo
Answer: Unfortunately $index is only the "iterator offset of the repeated element (0..length-1)"
If you want the original index you would have to add that to your collection before filtering, or simply not filter the elements at all.
One possible approach:
angular.forEach(members, function(member, index){
   //Just add the index to your item
   member.index = index;
});

Now, it also seems that this kind of information is really more like an ID than anything else. Hopefully that is already part of the record, and you can bind to that instead of using the index.
Comment: and what if you are iterating through array of strings? you will not able to add attribute to it (index).
Answer: You could use a function to return the index from the array

And the function
$scope.getPostIndex = function (post) {
    return $scope.posts.indexOf(post); //this will return the index from the array
}

On my example I have an array of objects called "posts", on which I use a filter to order them by one of their properties ("upvotes" property). Then, in the "href" attribute I call "getPostIndex" function by passing it by reference, the  current object.
The getPostIndex() function simply returns the index from the array by using Javascript array indexOf() method.
The nice thing about this is that this solution is not tied to a specific filter (like in @holographix answer) and will work for all of them.
Answer: I just stumbled across the same problem and I found this supertrick on the angular git issues
items.length - $index - 1

like

Original index: {{items.length - $index - 1}}, New index: {{$index}}

Original index: {{items.length - $index - 1}}, New index: {{$index}}

Original index: {{items.length - $index - 1}}, New index: {{$index}}

if you're in trouble like me give it a shot:
https://github.com/angular/angular.js/issues/4268
Comment: If your not using a filter this would be the best solution. The filter would screw up your index.
Answer: You can inject $route and use $route.current.params.index to get the value.
.controller('profileCtrl', function( $scope, $route ) {

     $scope.index = $route.current.params.index;

});


An infinite number of different decompositions $I = \cap_{i} q_i$ of ideal in polynomial ring $k[x, y, z]$ where $q_i$ are primary ideals

Question: Suppose we have an ideal $I \subset k[x, y, z]$ of a polynomial ring of three variables. Can i have an infinite number of different decompositions $I = \cap_{i} q_i$ where $q_i$ are primary ideals, which are associated with $p_i \in \text{Ass}_I(A/I)$? I couldn't find an example, so may be it's impossible, but i couldn't prove it.
Answer: The standard example is $I=(x^2,xy)\subseteq k[x,y,z]$. Given $n\geq 1$, we can write
$$I=(x)\cap (x^2,xy,y^n).$$
See Atiyah-MacDonald, Exercise 8.1 for more theory.


Sending to subscribers that are not in Salesforce SalesCloud

Question: We are currently using Marketing Cloud Connect to connect with SalesCloud, our Subscriber Key being the SalesCloud Contact ID. We sometimes receive lists of email addresses we need to send to that may not be in SalesCloud, so no Contact ID to use as the Subscriber Key. What are the cons of sending to these lists? Would the ramifications be anything worse than possible duplicate contacts/messy data?
Answer: It's a classic conundrum unfortunately. There are several issues to consider:

Duplicate/messy data (as you've already noted)
Compliance - you'll need an additional process in place to ensure an unsubscribe is honoured across multiple subscriber keys in the event you have duplicate email addresses (this is straightforward to do but needs to be done)
Cost - you'll be paying for each subscriber you store in Marketing Cloud
Tracking - once you have duplicates, you'll have differing engagement history stored against each subscriber
Archiving/removal - you'll need to factor in that there may be multiple subscriber keys associated with a single email address, so will need to adapt your process

However, in many organisations it's simply not practical to import all data into Sales/Service Cloud. I'm assuming that you/your organisation don't want these extra email addresses stored in Sales Cloud? If so, then as long as you have remedial action ready for the above considerations, you should be clear to send from Marketing Cloud.
Answer: What is the reason for not storing them in your Sales Cloud?
Do you have MDM in place?
I would personally never recommend a customer to upload customers through csv file in SFMC if there is a CRM available, mostly for all of the reasons Antonio already mentioned. However, I would also say that SFMC is not a mailchimp, it's too expensive toy to manage your database through csv when you have CRM available.
I am speaking from experience. Once you have thousands of duplicated records your job will get harder as Antonio mentioned and if you are on a budget SF will charge you double for duplicate contacts.
If customer A exits in Sales Cloud with COntact ID, you get charge for him. If you bring him to SFMC with some other SK, once you send him first email, from SFMC perspective he is recognised as other customer because SFMC is looking at SK, not email address.
A bit more information on your data strategy and reason why those customers are in csv and not in Sales Cloud would help us to give you strategic recommendation as well.
Comment: the reason for not storing in our SalesCloud is because the SalesCloud has a specific purpose and contacts/leads are loaded with specific criteria. The lists we get for some sends don't meet these criteria.


presentModalViewController: Differences

Question: What is the difference between:
[self.navigationController presentModalViewController:nav animated:YES];

and
[self presentModalViewController:nav animated:YES];

Where self is a subclass of UIViewController.
Along with that, does it matter how I dismiss the modal view?
Example:
[self dismissModalViewControllerAnimated:YES];

or
[self.navigationController dismissModalViewControllerAnimated:YES];

If a modalView is presented by self.navigationController, will it be dismissed if called on self, and vice versa?
I know that apple recommends using a protocol and delegate in actual implementation, but I am just trying to find out if the behavior "under the hood" is the same or not.
I have been looking around to try and find an answer to this but I haven't found anything yet, so if this is a duplicate I apologize before hand.
Thanks
Answer: what kind of class are you calling this from (ie what is self). if you are you calling it from a view controller then the difference is that your view controller is presenting the modalviewcontroller instead of the view controller's navigationcontroller presenting the modal view
if you use self.navigationcontroller you can interact with self.navigationitem which a view controller doesn't have.
EDIT:
Yes, it gives you the ability to push additional ViewControllers onto the self.navigationController.ViewControllers array and then use the navigationBar to move from ViewController to ViewController.
As an example you could do [self.navigationController presentModalViewController:nav animated:YES]; and then if a user clicks a button you could push a ViewController [self.navigationController pushViewController:vc animated:YES];  Then a new View Controller/View would be presented inside of the ModalView. When you dismissed the ModalViewController you would still be transported back to your original view controller.
To answer your second question: You should dismiss the modal view the same way you presented it. So if you use self.navigationController to present, use self.navigationController to dismiss.
Comment: So does interacting with self.navigationItem give me something that presenting it without that does not?

presentModalViewController: Differences


How to save images with Node.js

Question: The further I go with my blog the more problems I hit :) Can anyone tell me what is the best way to save images. I store the data in mongodb, should I save images in there as well or should I use local file system? Thank you
Answer: use file system to store images, free up db resources to serve data. for bigger site images should really use CDN.
Answer: Store them in MongoDB using GridFS.  That way you're not limited by file size, the images are easily shared between multiple app servers, and the images are naturally backed up with the rest of your MongoDB data.

How to save images with Node.js