spark plug and generator storage

Question: I have a question regarding the DS4000S generator. Reading the manual on the how to storage paragraph, it says to drain the fuel and disconnect the spark plug. I am not sure if I should just loosen it, or completely remove it, leaving the hole open? Does the piston chamber seals itself when removing the plug? Should I cover the hole somehow? I am looking forward to your suggestions.
Answer: No, do not loosen or remove the spark plug. "Disconnect" when in reference to a spark plug means to pull the cap at the end of the spark plug wire until the cap pops off the spark plug's metal terminal. Don't pull the wire, pull the cap. When you re-connect it, you should feel a little internal snap as it makes full mechanical contact.
So if you want to follow their instructions, disconnect the spark plug.
Frankly, this is a stupid and pointless instruction, and is simply an example of Lawyers Gone Wild. This is a pull-start generator with no electric starter, and there is no way for it to start by itself. (Preventing automatic starting is a valid safety-related reason to disconnect a spark plug.)
And guess what? The generator came to you from warehouse storage with the spark plug attached. So everybody should disconnect the spark plug for storage except the manufacturer? Double stupid.
And furthermore: There is nothing in the starting instructions to inform you that you should re-connect the spark plug if you want to use the generator. Triple stupid.
And holy cow, in the troubleshooting section under "Generator won't start" there is nothing that says "Re-connect the spark plug that we told you to disconnect." Quadruple stupid.
Have I made my point? Do as you wish. It doesn't hurt anything to disconnect the spark plug, but there's no real reason to do so.
If you have already loosened or removed the spark plug, be sure to tighten it again before you put the generator in storage.
Comment: Thank you for not only explaining how to disconnect it, but also the logic (or lack of thereof) behind it. Funny thing is, I saw a youtube video by the manufacturer on how to prepare the generator for long term storage, and there was not mention on disconnecting the spark plug. Oh well.
Comment: @Max_IT Right, I guess the manufacturer didn't want to win the Stupid Video of the Month Award!! Good luck with your generator.

spark plug and generator storage


Sitecore 7.2 - Maintenance Mode setting

Question: We will be doing some site updates and testing in relation to an update to our AMS system, and would like to put our live SC site in Maintenance Mode, a setting we see under the site settings, while we update everything and test.  I can't find anything about the mode yet, though - how it works, how content authors can test, etc.  I tried setting our test site in Maintenance Mode, and it does not appear to make a difference; it still comes up as expected.  Are there any resources on this setting in SDN or other location?  Thanks in advance!
Comment: AFAIK, "maintenance mode" is not a native feature of Sitecore. Can you provide a list of modules that you are using, and/or search your `/sitecore/admin/ShowConfig.aspx` for the word "maintenance" and see what pops up?
Comment: Zachary - I checked ShowConfig.aspx, and all of the 'maintenance' references shown refer to ContentSearch - rebuilding indexes for the DBs, that kind of thing.
Comment: Interesting. How about if you search your solution? Is there anything in custom code that references it? Try searching the Sitecore Client, as well.
Comment: You are correct, Zach - it is a module inserted by our third party SC provider.  Working with them to suss out the functionality and such - it does work, after a fashion, once the internal config file for it is properly referenced.  Thanks for the help!  I found a reference to it while searching out a separate issue on too-long-file-names, with 'MaintenanceMode' popping up in a _upgradeHistory directory, and then backtracked it from there.  Much appreciated!
Answer: Zachary was correct - the Maintenance Mode function appearing in SC was part of the core installation done by our third-party SC provider. Still with them on full functionality, but it appears to be a good tool to have, just in case. Full reference to it was found in a subfolder under app_config.  Thanks!
Comment: No problem ;) Just be sure to accept your answer in a few days when the option becomes available.

Sitecore 7.2 - Maintenance Mode setting


How can I disable Auto-Sign on my Facebook app?

Question: Currently if I sign out of the Facebook app, sign in requires only that I press on my name. There is no password required.  How can I change this? I'd like to have to type in my password each time to login to the Facebook app?
Answer: If the app does not support it, you cannot change it.  I would recommend that you use an app locker.  I have always used one.  There are many around.  I currently use Kaspersky for anti-virus and it has this feature.  There are free ones around too.

After installation, you select which apps require more security.
You select what sort of security you want, I use a 6 digit pin or a fingerprint.
When you press on the app icon, the AppLocker will pop up and you can enter your pin or whatever.

I lock all my sensitive apps this way, this includes Banking, Social, Email,  Internet (browsers etc), and Play Store (so no one else can install another app).
Comment: Is there no way to completely sign out? There used to be a checkbox you could check or uncheck to select "Keep me logged in" (at least on the web version of FB)


Sampling from the von-Mises Fisher distribution?

Question: This topic has already been tackled on this website (here).
But, unfortunately, no clear cut answers were given.
In (Wood,1994), there is apparently a rejection algorithm for sampling from this distribution, but I can't find it on the web.
I am thus looking for a pseudo-code (I have not much experience with sampling random variables). Many thanks!
Answer: I finally put my hands on Directional Statistics (Mardia and Jupp, 1999) and on the Ulrich-Wood's algorithm for sampling. I post here what I understood from it, i.e. my code (in Python).
The rejection sampling scheme:
def rW(n,kappa,m):
dim = m-1
b = dim / (np.sqrt(4*kappa*kappa + dim*dim) + 2*kappa)
x = (1-b) / (1+b)
c = kappa*x + dim*np.log(1-x*x)

y = []
for i in range(0,n):
    done = False
    while not done:
        z = sc.stats.beta.rvs(dim/2,dim/2)
        w = (1 - (1+b)*z) / (1 - (1-b)*z)
        u = sc.stats.uniform.rvs()
        if kappa*w + dim*np.log(1-x*w) - c >= np.log(u):
            done = True
    y.append(w)
return y

Then, the desired sampling is $v \sqrt{1-w^2} + w  \mu$, where $w$ is the result from the rejection sampling scheme, and $v$ is uniformly sampled over the hypersphere.
def rvMF(n,theta):
dim = len(theta)
kappa = np.linalg.norm(theta)
mu = theta / kappa

result = []
for sample in range(0,n):
    w = rW(kappa,dim)
    v = np.random.randn(dim)
    v = v / np.linalg.norm(v)

    result.append(np.sqrt(1-w**2)*v + w*mu)

return result

And, for effectively sampling with this code, here is an example:
import numpy as np
import scipy as sc
import scipy.stats

n = 10
kappa = 100000
direction = np.array([1,-1,1])
direction = direction / np.linalg.norm(direction)

res_sampling = rvMF(n, kappa * direction)

Answer: Here you can find a relatively simple way to sample the von Mises-Fisher distribution. More specifically, on section 3:

Observe that the following random vector with mean direction $\mu = (0, 0, 1)$ is distributed according
  to $f_{\text{vMF}}$ [5]:
  $$\omega_{\kappa} = (\sqrt{1 − W^2} V, W)^T$$
  where $V$ and $W$ are independent random variables, $V \in \mathbb{R}^2$
  is a uniformly distributed vector on the unit circle, and $W \in [−1, 1]$ follows the density
  $$f_W (w) = \frac{\kappa}{ 2 \sinh \kappa} \exp(κw).$$
  All that is needed for a computer implementation is a way to generate realizations of $W$. Applying the inversion method results in $$F^{−1}_W (\xi) = \kappa^{-1}\log\left(\exp(−\kappa) +2 \xi \sinh \kappa\right)$$
  To handle other values of $\mu$, one can simply apply a rotation to directions obtained in this manner
Comment: Thanks. I was aware of this paper. But, to my understanding, it only concerns sampling over the sphere $S^2$ while I am interested in sampling over $S^d$ for arbitrary d > 2.
Comment: @mic Oh, I see. Nice that you put your implementation as a reference!
Answer: The above answer by @mic does not work if $\mu$ and $v$ are not orthogonal, because the resulting $v\sqrt{1 - w^2} + w \mu$ does not lie on the sphere in that case.
His procedure can be used with $\mu=(1,0,\ldots,0)$ and $v=(0, \tilde v)$ to enforce orthogonality, then the samples can be mapped around an arbitrary mean $\mu$ by applying a rotation matrix (this does not change the distribution).
For info, the sampling method is available in the open source Python package geomstats, and can be used with the following:
from geomstats.geometry.hypersphere import Hypersphere

sphere = Hypersphere(dim=4)

kappa = 10.
mean = sphere.random_uniform()

samples = sphere.random_von_mises_fisher(
    mu=mean, kappa=kappa, n_samples=1000)

The python code is available here.
Comment: Welcome to MSE. This should be a comment, not an answer.
Comment: I thought so, but don't have the reputation to comment sorry


I added the "Cross" Effect strip to two text strips and it's making the background image transparent

Question: I added the "Cross" effects strip to two text strips to create a fade-like transition. It worked but during the transition the background image becomes transparent.
before the effect
Comment: Not a VSE expert but I think that is expected behavior, that is how cross fading works, by varying alpha. I think you are supposed to overlap the fading strips one over the other in different channels for it to work properly.
Answer: The scene you have as the background clip is set to have a transparent background and in the sequencer preview you have enabled the alpha view.
You can turn off the scene background transparency in the render settings under Shading.

To not see the background transparency in the preview you can change to colour only display in the header.

Another option is to add another strip to use as the background, this can be a simple colour effect strip to have a solid colour behind everything.
Answer: In Compositing you need to change the Blend mode to Over Drop
Comment: Could show how to tweak these settings? Perhaps add a screenshot


Each user can only see what they have added in the Excel File

Question: I'm controlling the sharepoint site for my work group and we have a shared excel doc that everyone uses daily but it doesn't have any privacy ( all information each person adds will be visible to everyone else who uses the doc ). all users have to log into the site individually. is there any way for me to set that document up so that each user can only see what they have added and it all compiles on the back end?
Answer: Unfortunately, you can't manage the users' permission on the document content. but, you can manage the permission per document where specific users can see a specific document based on the assigned permission!
If you can divide this Excel file to separate files, you will be able to assign permission for each file for the users who should see the file content!
For more details check User permissions and permission levels in SharePoint
Comment: @dave you are welcome, Please don't forget to mark & upvote the correct answer as accepted in case it helped you, also please have a tour to get an informed badge at https://sharepoint.stackexchange.com/tour  Thanks!
Answer: If the content of the Excel file is formatted as a table, and you don't have much formulas in the Excel document, consider importing the Excel table into a SharePoint list, then have users interact with the SharePoint list. You can set permissions in the list settings page.
Comment: I agree - it's better to use a Sharepoint List instead of an Excel file, unless there is a good reason not to.  Then you can make use of Sharepoint's useful features - for instance you build up a history of each line item, every time a user changes something.  You can also manage security better - split users in to 'read-only' and 'read/write' groups.
Answer: You may also wish to activate Versioning, this will keep track of who has edited the document and build up a history.  Go in: Document Settings>Versioning Settings>Document Version History (choose 'Major' or 'Major and Minor' versions).
You can also configure whether or not users can see previous versions of the file from the version history.


Vtiger Custom Module : "Sorry! Attempt to access restricted file."

Question: I have created a test module name Mytest. While saving values from the module, I am getting a blank page and it saying "Sorry! Attempt to access restricted file. " . Do anyone know, why this happening. Any help on this is really appreciating.
Answer: The most likely cause for the vTiger error "Sorry! Attempt to access restricted file." is the $root_directory value in the 'config.inc.php' is incorrect or misspelled.
In order to correct it follow the steps below:
Go to your vTigerCRM directory
Open "config.inc.php" with your favorite text editor
Go to line 86 and adjust $root_directory value to correct vTiger
directory. Note, that the directory must end with /. It should look
something like this – $root_directory = '/var/www/vtigercrm/';

Also there is a problem with cache memory. So do check your cache file for template files. For that go to your vTigerCRM directory.
Then Go to Smarty->templates_c.
Here you will get list of cache files. Delete this file and check weather your problem is solved or not.
Don't worry about deletion of this file.
Answer: When trying to include files from your custom module, you will get these messages because Vtiger thinks you are including these files from a location they find rather unsafe.
To avoid this error you could use the standard way a module is used in Vtiger by navigating to it like so: ......./index.php?module=Mytest&action=index. Vtiger will include your module and now there is no need for you to include CRMEntity and other data or utils related files. It should all be available this way but make sure you are using the global statement for $current_user, $current_module etc though.
Another way is to edit the following functions located in utils/CommonUtils.php:
heckFileAccessForInclusion() and checkFileAccess()
Remove or comment out the die() in these functions to fix it.
Answer: In Save.php file, just add a line.
$focus->column_fields['assigned_user_id'] = '';

before the
if($_REQUEST['assigntype'] == 'U') {
$focus->column_fields['assigned_user_id'] = $_REQUEST['assigned_user_id'];
} elseif($_REQUEST['assigntype'] == 'T') {
$focus->column_fields['assigned_user_id'] = $_REQUEST['assigned_group_id'];
}

Answer: To second what caspersky said:
Go to /include/database/PearDatabase.php and add
$adb->setDebug(true); right after $adb->connect();
I just wrote a module and received this error and it was because the record could not save because I left out:
$moduleInstance->setEntityIdentifier($fieldInstance);
Answer: Check out file permissions and file path it's trying to refer.
If you want to debug more set $adb->setDebug(true) in your index file and checkout for the errors.
Comment: It was enabled in the system. Not seeing any fatal errors on that,
Comment: Debug these functions checkFileAccessForInclusion,checkFileAccess in utils/CommonUtils.php .
Comment: the issue is there, its always returning false and die with "Sorry! Attempt to access restricted file." function
Answer: A couple of things spring to mind:

Have you actually created the modules/CustomeModule directory and populated
it? (Using the template in vtlib/ModuleDir/5.4.0 and then editing the
filenames and class of CustomeModule.php)
Check the case of your module class definition, e.g. class CustomeModule
vs. class Customemodule
If you are using any version control or symlinks in the development
of your modules/Mytest code then this can trigger the "Sorry! Attempt
to access restricted file." messages.
In module setup script make sure you have added this lines.

$module->initTables();
$module->initWebservice();
Answer: It seems you did not set write permission for Smarty folder
Answer: Check that all language files exist.
The user module allows the admin user to configure a user's language even though the language file is not present on disk.
To quickly verify this is indeed the issue :-
- Edit the include/utils/CommonUtils.php and print the $realfilepath variable ,and comment out the die();
- In the database, "select distinct language from xxx_users";
You can fix this by downloading the required files.
As a quick fix (read:hack):-
- go to the include/language directory
- copy an existing language file as the required one. (may not always work - for example en_us to en_gb is great, but en_us to sp_es is not)
Answer: Probably a file is missing in your vtiger install.
To find out which one is mission you would need to edit the include/utils/CommonUtils.php file. Open it with a text editor, go around line 2755 and add the following
echo "REAL: $realfilepath, ROOT: $rootdirpath";
Before die(Sorry....)
This would print on the screen which one is the missing file.
Answer: Sometimes this error is caused by an nonexistent module, what I mean here is that vtiger thinks you have a module but the files are not in there (might be caused by a bad migration to a new server).

Disable some modules and try again until you find which module is broken.

In my case the broken module was VGS.
Answer: I solved this on vtiger 7.3.. (maybe it works for other vesion)
I went to users permission on vtiger inside configuration settings and update tham all again with the same settings .. and got them to a more default settings .. them all users appeared back and I was able to create new users ..change password again.
I suggest logging out and maybe forcing refresh and waiting a little to make it work .


"She does what she wants" Is this sentence correct?

Question: As with 'does' the 's' with verb infinitive is removed,so it should be 'want' at the end, but I am confused if 'what' changes the rule here and the sentence is correct...
Comment: It's correct.  "What she wants" is what she does.
Answer: You may be referring to the change from
She wants something.. to
She does want something.
When "does" is added to the expression, the plain form (infinitive) "want" is used along with it, because there can be only one conjugated verb in a clause. "Does" in that sentence is an auxiliary verb.
In your example sentence "She does what she wants.", there are two different clauses, "She does + complement", and the complement clause "what she wants". Since there are two different clauses, there are two different conjugated verbs, so the sentence is correct. "Does" in that sentence is not an auxiliary, but the main verb.


SharePoint Migration from Dev to Live

Question: I am going to be in the process of taking my dev site and putting it on live. Just wondering if there is anything I need to be aware of or any tips/software to do so?
Comment: Are we talking artifacts or content?
Comment: Its not a big surprise to me that you would advocate the developer-centric approach (http://technet.microsoft.com/en-us/library/cc262251.aspx) ;-)
Another good reason to deploy to root folder is caching. Document libraries does not set correct age in headers, causing browser to do bundles of requests to server (304 not modified).
More on this issue http://www.kindohm.com/archive/2008/06/20/eliminating-quot304quot-status-codes-with-sharepoint-web-folder-resources.aspx
Comment: What type of site is it? Team Site, Publishing Site? Are you using content deployment or just backup/restore?
Answer: Features, features, and more features. And solutions. Everything (and I do mean everything) I do is done in dev but then packaged into a feature for deployment to test/staging then production. This includes anything from page layouts, master pages, CEWP web parts, to full blown solutions with web parts, receivers and custom code.
Seriously it takes 2 minutes to slam together the feature code around whatever solution you may have. Take the wsp and deploy.
Advantages are
a) The deployment will handle pushing out all changes to all web front ends
b) You can easily pull it back if you need to
c) It can be upgraded (although it's not pretty, it is simple)
d) You take the exact same WSP and deploy to production.
An added bonus would be to get the SharePoint Installer project from CodePlex to turn your wsp into an exe you can just hand off to your network guys and let them install it.
Comment: 'Everything (and I do mean everything) I do is done in dev' - what tool do you use to "do" everything?  Directly on the site, using SP Designer, Visual Studio?
Comment: @BlueChippy Various tools but everything is packaged into a solution in Visual Studio. For example I'll create a feature for a master page with CSS, deply the feature, edit the files in SPD and fold them back into the solution for deployment to an environment.
Answer: There are tools and techniques depending on what (code, content, configuration) you are trying to promote from development to production. Tell us a bit more at what your trying to accomplish and we can point you in the right direction.

SharePoint Migration from Dev to Live


How helpful is knowing lambda calculus?

Question: To all the people who know lambda calculus: What benefit has it bought you, regarding programming? Would you recommend that people learn it?
Comment: Sorry about the edit, thought math + maths was a duplicate tag.
Answer: The benefit of lambda calculus is that it's an extremely simple model of computation that is equivalent to a Turing machine.  But while a Turing machine is more like assembly language, lambda calculus is more a like a high-level language.  And if you learn Church encodings that will help you learn the programming technique called continuation-passing style, which is quite useful for implementing backtracking search and other neat tricks.
The main use of lambda calculus in practice is that it is a great laboratory tool for studying new programming-language ideas.  If you have an idea for a new language feature, you can add the new feature to the lambda calculus and you get something that is expressive enough to program while being simple enough to study very thoroughly.  This use is really more for language designers and theorists than for programmers.
Lambda calculus is also just very cool in its own right: just like knowing assembly language, it will deepen your understanding of computation.  It's especially fun to program a universal turing machine in the lambda calculus.  But this is foundational mathematics, not practical programming.
Comment: I don't see the connection between Church encodings and CPS.
Answer: If you want to program in any functional programming language, it's essential.  I mean, how useful is it to know about Turing machines?  Well, if you write C, the language paradigm is quite close to Turing machines -- you have an instruction pointer and a current instruction, and the machine takes some action in the current state, and then ambles along to the next instruction.
In a functional language, you simply can't think like that -- that's not the language paradigm.  You have to think back to lambda calculus, and how terms are evaluated there.  It will be much harder for you to be effective in a functional language if you don't know lambda calculus.
Comment: I sincerely doubt it is essential for functional programming (as I noted in my own answer). Also, Turing machines are practically never (if ever) used to understand imperative programming.
Comment: I think this is a matter of "those who do not understand LISP are doomed to reinvent it", where even though I imagine vast majority of programmers come from heavy imperative backgrounds where the notion of loops for summation is common, and the idea of array reduction didn't exist. In turn we all kind of try to gain more control and discipline over our computations and the only reasonable direction to go is the direction of lambda calculus, in turn reinventing it, or digesting it from programming languages that don't teach you lambda calculus but you just "get" a lot of it.
Comment: @Dmitry I mean, the idea of lambda is so convenient that many of us tend to just "reinvent it", ESPECIALLY if you are a meta-programmer that writes preprocessors for their code to turn "for" loops into "for in" loops via simple transformations, or come to think of it, lambda calculus in general addresses many things you think about while writing preprocessors naturally, as all you think about is transformations and how to chain them as long as possible, preferably to the very end. Without lambdas, you simply get overwhelmed by complexity and everything falls apart, or is unmanagable.
Answer: To be honest, learning lambda calculus before functional programming has made me realize that the two are as unrelated as C is to any imperative programming.
Lambda calculus is a functional programming language, an esoteric one, a Turing tarpit if you like; accidentally it's also the first.
The majority of functional programming languages at all do not require you to 'learn' lambda calculus, whatever that would mean, lambda calculus is insanely minimal, you can 'learn' its axioms in an under an hour. To know the results from it, like the fixedpoint theorem, the Church-Rosser Theorem et cetera is just irrelevant to functional programming.
Also, lambda-abstractions are often held to be 'functions', I disagree with that, they are algorithms, not functions, a minor difference, most 'functional languages' treat their functions more in the way classical mathematics does.
However, to for instance effectively use Haskell you do need to understand certain type systems, that's irrespective of lambda calculus, the System F type system can be applied to all 'functions' and requires no lambda abstractions at all. Commonly in maths we say f : R^2 -> R : f (x) = x^2. We could've said: f (x) = x^2 :: R -> R -> R. In fact, Haskell comes pretty close to this notation.
Lambda calculus is a theoretical formalism, Haskell's functions are really no more 'lambda abstractions' than f : f(x) = x^2 really, what makes lambda abstractions interesting is that it enables us to define what are normally seen as 'constants' as 'functions', no functional language does that because of the huge computational overhead. Haskell and alike is just a restricted form of System F's type system applied to functions as used in everyday classical maths. Functions in Haskell are certainly not the anonymous formally symbolic reduction-applicants as they are in lambda-calculus. Most functional programming languages are not symbolic reduction-based re-writing systems. Lisps are to some degree but that's a paradigm on its own and its 'lambda keyword' really doesn't satisfy calling it lambda calculus.
Comment: I agree with the point: you want to learn *typed* lambda calculi. It is insanely important in eg. Haskell.
Answer: I think the use of lambda calculus with respect to programming in practice is that it is a quite minimal system that captures the essence of abstraction (or "anonymous functions" or closures, if you will). Other than that I don't think it is generally essential except when you need to implement abstraction yourself (as Tetha (114646) mentioned).
I also completely disagree with Denis Bueno (114701) who says that it is essential for functional programming. It is perfectly well possible to define, use or understand a functional language without any lambda calculus at all. In order to understand the evaluation of terms in functional languages (which, in my opinion, somewhat contradicts the use of a functional language) you will most likely be better of learning about term rewrite systems.
Answer: I agree with those that say it is theoretically possible to learn functional programming without learning the lambda calculus—but what's the advantage of not learning the lambda calculus?  It's not as if it takes a big investment of time.
Most likely, it will help you understand functional programming better.  But even if it doesn't, it's still a cool thing worth learning.  The Y-combinator is a thing of beauty.
Comment: +1 for being the only answer to mention the word "beauty." The practicality debate aside, it is possibly the most beautiful field of mathematics I have yet studied.
Comment: The lambda calculus is without any doubt a wonderful thing well worth learning. However, it truly surprises me to read these claims that it is helpful (or even essential) in understanding functional programming. I have a hard time figuring out how it would help. Am I missing something here?
Answer: If you only want to be a technician and write programs to do things, then you don't really need to know lambda-calculus, finite-state machines, pushdown automata, regular expressions, context-free grammar, discrete mathematics, etc.
But if you have curiosity about the deeper mysteries underlying this stuff, you can start to wonder how these questions might be answered. The concepts are beautiful and will expand your imagination. I also think they, incidentally, make one a better practicioner.
What got me hooked was Minsky's book Computation: Finite and Infinite Machines.
Comment: You do not **have** to know "finite-state machines, regular expressions, context-free grammar", but these are very useful in many programing tasks. I would be 1/100 effective without these. E.g. don't you use GREP?
Comment: I suggest you revisiting REGEXPs, e.g. in Java. That is a very expressive thing and if used wisely, a big timesaver. By the way, you can use GREP on Windows with Cygwin or compile it with MinGW. And if you have a bit more time, understanding e.g. ANTLR is a huge jump in development power. You can generate parsers for a large set of languages... So you can replace manual input parsing and validation.
Comment: @TFuto: I'm on windows. I *used* to have grep, but with these infernal upgrades, stuff that used to work doesn't any longer :) Also, those formal concepts are more on the inventive side of C.S., as opposed to the conformist side. They get me in trouble, [*like here*](http://stackoverflow.com/a/24875909/23771).
Answer: The lambda calculus is a computational model, just like the turing machine. Thus, it is useful if you need to implement a certain evaluator for a language based on this model, however, in practice, you just need the basic idea (uh. place argument semantically correct in the body of a function?) and that's about it.
Answer: One posible way to learn lambda calculus is
http://en.wikipedia.org/wiki/Lambda_Calculus
Or, if you want more, here is my blog dedicated to lambda calculus and stuff like that
http://weblogs.manas.com.ar/lziliani/
As every abstraction of computations, with lambda calculus you can model stuff used in most programming languages, like subtyping. For more about this, one of the best books with practical uses of lambda calculus in this sense is
http://www.amazon.com/Types-Programming-Languages-Benjamin-Pierce/dp/0262162091/ref=sr_1_1?ie=UTF8&s=books&qid=1222088714&sr=8-1
Comment: For me the book [Introduction to Functional Programming through Lambda Calculus](http://www.amazon.com/Introduction-Functional-Programming-Calculus-Mathematics/dp/0486478831/ref=pd_sim_b_1) is the best starting place.
Answer: I found that the Lambda calculus was useful for understand how functional programming worked on a deeper level. Especially how to implement functional languages.
It has made it easier for me to understand advanced concepts like type-systems and evaluations strategies (e.g. call by name versus call by value).
I don't think one needs to know anything about the Lambda calculus to use basic functional programming techniques. However understanding the lambda calculus makes it easier to learn advanced programming theory.
Answer: I'd also like to mention that if you're doing anything in the area of NLP, lambda calculus is at the foundation of a massive body of work in compositional semantics.
Answer: The benefits for me is a more compact synergistic programming.  Stuff tends to flow horizontally more than vertically.  Plus it is very useful for prototyping simple algorithms.  Don't know if I am using it to its full potential but I find it very useful.

How helpful is knowing lambda calculus?


Holder inequality with respect to convex function

Question: Given $a, T>0$, by Holder's inequality we have
$$
\int_T^{T+a}f(s)ds\leq \left(\int_0^{T+a}|f(s)|^2ds\right)^{1/2}\cdot\sqrt{a}.
$$
Do we have similar result if we replace $|x|^2$ by some convex function? That is, let $\Psi$ be a convex function such that $\Psi(x)/|x|\to\infty$ as $|x|\to\infty$, do we have
$$
\int_T^{T+a}f(s)ds\leq \int_0^T\Psi(f(s))ds\cdot\Phi(a),
$$
where $\Phi(a)$ goes to 0 as $a\to0$?
Comment: Jensen's inequality.
Comment: is everything correct with the limits of integration in right hand side guys? Should not they be $\int_T^{T+a}$ in both inequalities?
Comment: Could you please provide more details? Jensen's inequality seems not work. Thanks.
Comment: Just a typo report: in the last line of your question it should be $\Phi(a)$, not $Phi(a)$.
Answer: Yes, this is known as Young's (or Hölder's) inequality for Orlicz spaces, and one should take for $\Phi$ the (Legendre) convex conjugate
$$
\Phi(y)=\Psi^*(y)=\sup_x \{ xy-\Psi(x) \}
$$


Integer encoding and weighing when one feature consists of more names

Question: Hello I am trying to make a content based movie recommendation system and one feature is genre of the movie. I will give an integer number to each genre randomly. However, some movies are of more than 1 genre. I will use tf-idf for weigthing these features. However, I am very confused that what to do when a movie is horror and action and comedy movie at the same time. Should I multiply or add these weighted features, I have no idea. Also I do not know why we use weighting in the first place at all. Can you help me get through this? By the way, let me say that each movie will be regarded as a document and then tf-idf calculation is done on them.
Answer: That's a good question. This task would be referred to as multi-label encoding. Bascially if a movie belongs to several genres, you one hot-encode each genre and add the vectors.
If there were only 6 genres (horror, romance, action, adventure, comedy, fantasy)
For instance a movie that is horror, action and comedy (The Dead don't Die?):

horror = [1, 0, 0, 0, 0, 0]
action = [0, 0, 1, 0, 0, 0]
comedy = [0, 0, 0, 0, 1, 0]

So a movie that belongs to all three would be encoded as: [1, 0, 1, 0, 1, 0]. A movie that only has a category then its encoding is a one-hot encoded label.
You can perform this task in scikit-learn with a multi label binarizer
Comment: so a movie vector is consisting of genre/release date interval/director/main actor in my design. so it will be like 40D or something like that if there are 10 distinct directors and 20 main actors and 4 release date intervals(2000-2005,2006-2011 etc.) and the vector will be sparse right? I think it is not important the order of features I believe.
Comment: by the way is it correct my approach to weigh features?
Comment: That's fine actually, because recommendation will be based on distances and there are distance adapted for sparse data and this will make the computations faster. You are right, the order is not important as long as it remains consistent. Your idea to add some nlp in there is good, you can try with and without and compare the results.


Communication with Windows Guest OS run in Qemu

Question: Using a headless Ubuntu 14.04 server, I'm running a Windows 7 guest in Qemu to which I am passing through the GPU (for performance). I am writing an application for which part will be running in Linux, and part will be running in the Windows guest, and I need communication between the two. Researching this has led me to believe my best option would be using Virtio-serial drivers so I can simply communicate between the two as if they had a serial connection; this sounds fabulous, but I can't for the life of me figure out how to get it working.  I've found a few resources which detail the necessary Qemu command line options, such as here, but I've failed to find any resources on how to initiate communication from the Guest's side.  It seems most people doing this type of thing are doing so with Linux guest OSes, which I'm sure greatly simplifies things.
Network communication may not be an option, as we will most likely be passing the NIC through to the Guest OS as well (again, performance is critical for the guest OS). Even if not, that seems like an unnecessarily heavy option for simple communication between applications.
I have also considered creating an SMB share, and storing a database there that can be connected to from multiple hosts, then running mysql on the host and guest. But this also seems far less than ideal... Does anyone have any experience with this, or maybe an obvious suggestion I'm missing?
Edit:
I meant to include my qemu shell script:
<code>sudo qemu-system-x86_64 -enable-kvm -M q35 -m 3072 -cpu host -smp 4
-bios /usr/share/qemu/bios.bin -vga none -nographic -serial mon:stdio
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1
-device vfio-pci,host=00:01.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on
-device vfio-pci,host=00:01.1,bus=root.1,addr=00.1
-device virtio-scsi-pci,id=scsi
-drive file=/utils/WES7.img,id=disk,format=raw,if=none -device ide-hd,drive=disk
-drive file=/home/mvsuser/virtio-win-0.1-100.iso,id=virtiocd,if=none -device ide-cd,bus=ide.1,drive=virtiocd
-usb -usbdevice host:046d:C52B
-net bridge -net nic,model=virtio
-chardev socket,path=/tmp/port0,server,nowait,id=port0-char
-device virtio-serial
-device virtserialport,id=port1,name=vioserial,chardev=port0-char
</code>
Answer: The page you refer to includes a link to the API to use from Windows guests (as well as Linux guests). I believe this is what you're looking for.
Also, the QEMU Guest Agent source code has a working example of how the qemu guest agent uses virtio-serial within Windows.


Why does hibernation require a swap space to be roughly equal in size to total system RAM when we have file mapping and demand paging?

Question: It is my understanding that pages in memory containing things like program text and shared libraries that have associated real world files will actually map to that associated file instead of swap (i.e. map to something like a segment of /usr/bin/ls). Therefore when the kernel frees up memory it doesn't need to copy those pages to swap since they can be copied back into memory from the associated file when a page fault occurs.
As a result we only use swap space for anonymous pages (i.e. pages in memory that are not associated with some real world file). Given this fact, I would assume a large portion of memory pages will never need to be copied to swap space because they are just copied into memory directly from the associated real world file as needed. So, my question is this: why does hibernation require a swap space roughly equal to our total system memory when a large portion of those memory pages don't map to swap space at all?
Answer: It doesn't. The default goal for hibernation images (see the image_size setting) is approximately 2/5 of the amount of installed memory.
Comment: *"installed memory"* of which up to a half could be consumed in tmpfs. So wouldn't it be safer to assume 1/2+2/5=0,7 ?
Comment: Why half? tmpfs has a default maximum size of half of memory per file system, but it's just a default. As far as hibernation is concerned, most of the gains come from compression, not just skipping file-backed pages. My point was really that hibernation doesn't need as much room as installed memory, that's all.


Experimental verification for the de-Broglie - Einstein relation $E= h \nu$ for a particle

Question: Is there any experiment that confirms the relation $E=h \nu$ for material(I mean the matter waves) objects? I mean, from the photo electric effect experiment, we came to know that photon carries energy $E= h\nu$ for a given frequency, but how did they verify it for a particle ?
Comment: https://en.wikipedia.org/wiki/Davisson%E2%80%93Germer_experiment
Comment: @hyportnex There's an argument to be made that Davisson-Germer interference experiments only measure the wavelength, not the frequency, of matter waves. Akaash points specifically to the de Broglie-Einstein relation, which to my mind implies that they're asking for the $E=h\nu$ connection, not the pure de Broglie $p=h/\lambda$ version, which is the one that involves the wavelength.
Answer: The most striking experiment [1] I know of consist in diffracting fullerenes molecules, formula $\text{C}_{60}$, the famous buckyballs. The de Broglie wavelength is about 400 times smaller than the actual diameter of the molecule. Here is how the calculation goes: the average speed of the molecules was $v=220\  \mathrm{m/s}$, determined by a time-of-flight method; the mass of one molecule is $m=1.2\times 10^{-21}\ \mathrm{g}$, resulting in a momentum $p=\gamma m v\approx mv=2.6\times 10^{-19}\ \mathrm{gm/s}$, and therefore in a de Broglie wavelength $\lambda=h/p=2.5\times 10^{-12}\ \mathrm{m}$. From that value, one can predict the diffraction pattern and check it compares well with the experimental measurement, which it does according to the article.
What about the other de Broglie relation you were interested in then? $E=\gamma m c^2$ but $\gamma\approx 1$ here (I already used that in the computation of the momentum $p$), i.e. only the rest energy matters, and we get $E=6.7\times 10^{11}\ \mathrm{eV}$, which is way higher than the electromagnetic binding energies, so we are ok with just using the bare mass of the 60 Carbon atoms. That gives $\nu=1.6\times 10^{26}\ \mathrm{Hz}$. But none of that was measured as the diffraction patterns depends on the wavelength.
Moreover this molecule is a very complex object with many internal degrees of vibrations and a lot of very close energy levels. Thus it can be argued that this is as close to a classical object as we can get for this type of experiment.
[1] Markus Arndt, Olaf Nairz, Julian Vos-Andreae, Claudia Keller, Gerbrand van der Zouw, and Anton Zeilinger, Wave-particle duality of c60 molecules, Nature 401 (1999), 680--682
Comment: So from the above procedure I get the momentum and hence the wavelength from the de-Broglie relation. So we can calculate the energy(by using E=hv). So the obtained value of E must tally with the experimental value of the energy right? How was this done? E=hv gives me an energy of 7.956 10^{-14} . But if I use 0.5  mv^2 , I get a different answer.
Comment: I got it till the part where you obtain the frequency. But after this if i again use the relation c/v(frequency) , I get a different wavelength than the one mentioned above (2.5 * 10^-12 ).
Comment: That relation is only valid for a wave propagating at the speed of light, which is not the case here. The equivalent relation would be $\lambda\nu=E/p$.
Comment: Yes,I got it now. So basically,  we find the calculated wavelength agrees with the value of the wavelength obtained experimentally. And then we use "Debroglie-Einstein" relation to calculate the energy from which we calculate the frequency. So now we check whether the frequency and wavelength agree with each other through the above mentioned equation. Did I get that right?
Comment: Well, yes, but note that $p=h/\lambda$ and $E=h\nu$ imply $\lambda\nu=E/p$.
Answer: The clearest examples of this are various forms of the photoelectric effect, either in ionization from solids, ionization of atoms and molecules in the gas phase, or in excitation and de-excitation of bound-bound transitions in the gas phase.
If you buy into the matter-wave hypothesis from the beginning, then it is clear that these phenomena couple the frequency of the matter wave to that of the incoming electromagnetic radiation. There's a number of ways you can do this, depending on exactly what you're looking for, but they all play with the same set of fundamental ideas.
As an example, you can take a sample of hydrogen atoms at rest and bombard them with electrons with a narrowband tunable kinetic energy, and then observe for fluorescence from the gas; you will find that there are certain specific regions of the bombardment energy that produce a much higher fluorescence, and that each of them produces a different colour in the fluorescence.
It is always a bit tricky to distinguish between experiments that couple to the wavelength (like the double-slit interference experiments in Luc and anna's answers) and experiments that couple directly to the frequency, but for experiments in the gas phase it is very hard to see how the wavelength of the light can be relevant for the coupling (since it's much longer than the size of each atom) so the only way the atomic dynamics can couple to the light is through its frequency.
Here, if you buy into wave mechanics, the connection is clear: you have formed a superposition of atomic states which oscillate at different frequencies, and their interference couples to the EM field, to a first approximation as I described here.
If you don't really buy the wave mechanics and you're looking for evidence to convince you, then it gets a bit tricky - ultimately, the reason we buy the wave mechanics isn't because of a single experiment but because of the full edifices of experiment and theory and how they interact with each other - but you nevertheless have a phenomenon that (i) clearly depends on the supplied mechanical energy, (ii) is clearly resonant, as a confined wave would, together with a Lorentzian lineshape if your experiment is precise enough, and (iii) its effects wind up imprinted in the temporal frequency of an external system.
Answer: That the electron trajectories obey a  wave probability is shown clearly in this accumulation of single electrons scattering on two slits.

Results of a double-slit-experiment performed by Dr. Tonomura showing the build-up of an interference pattern of single electrons. Numbers of electrons are 11 (a), 200 (b), 6000 (c), 40000 (d), 140000 (e).

From top to bottom, where the footprint of the single electrons are detected , the accumulation of the distribution of the scattered electrons ( a probability distribution) shows the interference pattern of wave nature.
The wavelength is consistent with the quantum mechanical predictions. (original paper copies in pdf exist when searching  title and author , where the experiment is described and the conclusions drawn.
Comment: The above image is the result of exposing the screen to electron beams for a very long time right? So we get the wavelength and try matching it with our calculated debroglie wavelength to verify the result.  But how do we match the experimental energy of the electron and the theoretical value of the electron(E=hv) ?
Comment: Can't an argument be made that the interference pattern is set by synchrotron radiation from the electrons? The radiation between the slit and detection screen form the familiar interference pattern on the screen but is not seen as visible light. Then as the electrons travels through the slit their trajectories are continuously affected by the reflecting radiation set in the pattern. The electrons are guided and corralled into certain location and on impact create more synchrotron radiation which reflects back-and-forth between the walls maintaining the original photon fringe pattern.
Comment: @BillAlsept  There is no synchrotron radiation, only a single scatter from the slits.  The word "synchrotron itsself denotes multiple scatters  or radial acceleration:  https://en.wikipedia.org/wiki/Synchrotron_radiationReflecting from what?
Comment: I thought accelerated electrons would emit radiation
Comment: These electrons are a beam with no acceleration. And anyway they come one by one, a very weak beam.
Comment: There are three ways the electrons will create radiation. When they are fired, if they impact the edge of the slits, and definitely when they impact the detection screen.
Comment: @BillAlsept  . They are accelerated up to some ev, then the beam is steady. Then they impinge on a double slit, where they may scatter  emitting or not a photon, but that will have an angle  and will be only one photon.  The screen detects electrons, not photons. At the screen the energy of the electron is given to ionization of the spot.
Comment: When electrons or any charged particle is accelerated in anyway it emits radiation and not just one photon. probably billions.
Comment: @BillAlsept  You are correct for continuous acceleration because it means continuous interactions with the fields.  You are not correct for one fixed momentum electron scattering off anything. A Feynman diagram can be written which has single particles.
Comment: as soon as any radiation is emitted, the light speed of the reflections will continually interact with the electron as it continues. This constant interaction  will vary depending on its location relative to the reflecting surfaces of the detection screen and the back of the slit screen.
Comment: Try Measuring the spacing of the fringes. Now based on the size and separation of the slits, along with their distance to the screen you can calculate the frequency of the radiation being emitted from the electrons.
Comment: @AkaashSrikanth the de broglie λ=h/p, and p is the momentum of the beam of electrons from the fringes to be compared with the p which is known by the construction of the beam. See the paper itself https://www.google.gr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0ahUKEwjauOTPluzUAhVDC8AKHXrBCXAQFggtMAE&url=https%3A%2F%2Fcanvas.harvard.edu%2Ffiles%2F3486763%2Fdownload%3Fdownload_frd%3D1%26verifier%3DqRAG5jUIbng83WzEl8BnQQop9GgeXfw0hCkeMYiJ&usg=AFQjCNFAu7WTgG_PYNWbwOetB1tS2o7rmw&cad=rja


How to set up a raspberry pi to shutodown and boot based on whether UPS it is plugged in or not

Question: I am building a golf cart and want to install a raspberry PI as dashboard computer for it. For this purpose I am using a Raspberry Pi 4 model B and I have a RPi UPSPack V3 for a ups. I have it wired up so that when I power on the golf cart the UPS gets power and when I  turn off the golf cart the power to the UPS gets cut.
I would like to set it up now so that the raspberry boots when the UPS gets power and shuts down when the power is disconnected from the UPS (just like a dashboard computer in a car).
I'm kind of new to the subjects of UPS so any suggestions would be great.
Comment: it's not really about UPS ... it is about doing actions when signals are received
Comment: Abandoned post by Unregistered user.
Answer: Have a look at the github repository you posted. At the end it starts talking about connecting the raspberry pi with the UPS via serial. My Chinese are not up to speed unfortunately :)
If you open up the 2 .py files in the UPSPACK_V3/UPS_GUI_py/ you can get an idea on how to use their library and how to tell if the power is connected to the UPS.
Line 14
version,vin,batcap,vout = test.decode_uart()
You are interested in the vin variable. If you know that then you can tell the raspberry when to power off...


Is it possible to make agile work for platform development?

Question: Is it possible to make agile work for platform development? Picture a set of dev pods each responsible for a unique functional area of a platform. Now picture 2-4 app dev teams that use the platform to build software apps to the public. How do you make agile work in this scenario?
Answer: I think it depends on how you define agile. Agile is an umbrella term for a bunch of methodologies and practices.
In Wikipedia it is defined as such:

Agile methods generally promote a
  disciplined project management process
  that encourages frequent inspection
  and adaptation, a leadership
  philosophy that encourages teamwork,
  self-organization and accountability
  [...].

We practice an agile approach where I work, where the architecture team works in a pretty non-specified agile way and the feature teams use Scrum. By non-specified I mean that there are no strict rules as to how the process is but we use several agile principles. Most importantly development is not done the waterfall way, but iteratively.
Throughout the core software development department we use continuous integration and a lot of automated testing. Daily stand-ups are by definition a practice used by the feature teams, but also sometimes for the platform team, depending on the situation. The platform team has an open weekly presentation of what they did. Also, user stories are not only used for the feature teams, but also sometimes for the platform team, when responsibilities overlap and a product requirement turns out to be a more general platform requirement.
So, yes, I think agile is possible for platform teams, as long as the circumstances (i.e. management and/or product requirements) allow it. What you use and how you use it is up to you.
Answer: Agile can work in platform development for the same reasons that it can work in application development, and it can fail in both cases for the same fundamental reasons.
Agile processes, by definition, adapt to their environment. Usually it is the people using the process who adapt it, in order that it remains fit for the purpose of the task that is is being applied to. This adaptability makes agile processes inherently robust, provided that process adaptability can be tolerated in the work environment.
In platform development the release schedules are often further apart and more stable than they are in application development. At first sight, this means that delivering increments of functionality is less useful, and does not provide the same feedback loop as you would get by delivering a usable increment of functionality to a customer. On closer inspection, this is only true if nobody is waiting for the functionality that is being produced, or if it is only the complete deliverable that is of any value.
On the one hand the environment is more conducive to success; on the other hand one of the essential mechanisms for an agile process is missing. As long as the process can be adapted to compensate for the missing mechanism - e.g. by having testers or application developers use the interim deliverables - then the adapted process should still be fit for purpose.
In terms of software design and construction, the software (including specifications) is written in more-or-less the same way: one line at a time, and by more-or-less the same sort of people: software developers; with more-or less the same characteristics in terms of motivation and attention span. The scope of the new functionality might be larger, and the goal defined with a longer term schedule, but it still has to be reached in steps, and those steps can be defined to fit into iterations with some sort of demonstration of progress at the end. Development managers often think in terms of milestones as well as deliverables, so this might only be an evolution from the current practice.
I have seen the Scrum process used by different teams for both platform and application development. The teams implement the process in different ways according to their different needs and different understandings of the process, however the main success factors are the capabilities of the teams (and the individuals within them) and the capabilities of the teams' management.


Can I export Quick Favorites from 2.82 to 2.83

Question: With all the back and forth between 2.82 and 2.83 daily releases, I was wondering if there was a way to export your 2.82 quick favorites menus to use them in the 2.83 beta?
Answer: Quick Favorites are part of user preferences and saved along them in the preferences file.
Copying this file from one installation to another should bring Quick Favorites with it.
Beware that this file saves most Blender settings along with it, so overwriting with an older one may unintentionally change other preferences you may have already configured. It may also cause unforeseen issues when things change between Blender versions, so use with caution and take care to make backups beforehand.
This file is usually saved under C:\Users\<UserName>\AppData\Roaming\Blender Foundation\Blender\<VersionNumber>\config for Windows OS. After installing a new version you should have two different <VersionNumber>, so copy it from the relevant one to the new one.


What's the minimum transaction with nxt?

Question: Currently the minimum transaction on Bitcoin is 5430 Satoshi, and what about NXT?
Answer: There is no minimum other than the smallest unit of NXT 0.00000001 NXT. This represents 0,00000000000072 BTC.
The issue is that the minimum fee of 1 NXT is still required for such a transaction.
Answer: Currently the minimum transaction fee is 1 NXT. There are talks about lowering the 1nxt fee, to increase the usage of certain nxt services like messaging. It wouldn't be ideal to cost 5-10cents every time you sent a message.
Right now the fees are as follows:
All NXT transactions cost 1 NXT
Except for when issuing an Asset, which cost: 1000 NXT - which is about $50 USD which greatly prevents asset spam.


How do you convince your customers that your machine learning model is correct

Question: Suppose you need to give a talk about your final model for a machine learning project to the project partner. Take for example that you used a random forest model/neural network, where you cannot really interpret any coefficients. What can/should/should not/is great to present in such a talk? All i can think of is the features used and the test error?
Comment: Results from validation on a hold-out sample, together with crossvalidation results.  Maybe also show results from some simpler, interpretable model and show with plots/visualizations how that model have problems with the fit, and how your complex model handles that.
Answer: It depends on the context. Usually, a machine learning project does not stand by itself but is integrated in some kind of operational context. What are they trying to find out and why? One first part of the presentation should probably show that the model is really able to solve this exact question and can be used for this exact task that is needed for operationalization (best on a holdout sample or cross-validation set).
If you can try to give some indication of the business value your model provides. If your model is trying to get new customers (e.g. predict items to recommend), show how many more sales may be expected and why this model increases that number. It may be good to be conservative here, though, since overconfidence can lead to expectations that cannot be met.
Often, however, this also depends on the audience. For more technical oriented audience, test scores etc are just fine. For more business-oriented audiences the actual business value is much more convincing.


Is 1024x1024 a widely supported OpenGL maximum texture size on the desktop?

Question: I am creating a sprite engine that uses the concept of "graphics banks" to speed up rendering using batches.  I was wondering if anyone knows if 1024x1024 textures are widely supported enough these days to "count on", and/or if there is a way to find out how far back there has been support for 1024x0124 in terms of graphics chipsets / cards, like a chart or something, and from that decide based on estimated compatibility % if I should go with 1024x1024 or limit banks to 512x512 (which I have a feeling is more widely supported, if you count integrated accelerators)
Comment: You could support both. Check for `GL_MAX_TEXTURE_SIZE` and scale the textures down programatically before uploading them. Dividing the resolution by half is very easy if you use power-of-two widths and heights, the new pixel in the smaller image is the average of four pixels in your original image.
Comment: Yes, I thought about this.  Scaling down has two big counts against it; 1) My sprite engine will use 4-bit paletted graphics, with 4 palettes pre-calculated within each bank (each quadrant uses a different palette, to avoid having to rely on pixel shader support) so the pixelated style will be ruined by the filtering; 2) this may not be worth the cost in code complexity and maintenance; i'd rather keep it simple and depend on the smaller size (or let the driver do any downscaling) - or outright refuse to run if the max texture size isn't supported.  don't want to waste my life writing glue...
Comment: Yes, 1024 is a common desktop size. OpenGL 3.0 implementations are _required_ to support this resolution at the minimum. A huge leap from OpenGL 2.0, which only required 64x64 texel textures :) Most desktop GPUs support 4096-16384, and with sparse textures in 4.x, the maximum supported texture dimensions will be almost meaningless.
Comment: Thanks for the reply.  I wouldn't say maximum texture size will be almost, or even nearly meaningless.  I just read up on it and sparse textures will be blurry when there's a cache miss
Comment: What I meant by that was that the addressable texel range will be so large that you will not have to worry. Sparse textures aren't about cache efficiency, they are about defining behavior when part of a texture that's not been loaded yet are loaded for the first time. Think of the situation like a page fault in traditional virtual memory, latency has to be introduced to service the fault, but you can have an application that uses resources far greater than could ever fit into memory all at once. T
Answer: According to this SO answer "what is the max size of the texture iphone can support?" the iPhone 3g can support 1024x1024 texture sizes.  That phone was released in 2008, which leads me to believe that most desktop would be able to support the same 5 years ago.
The GL_MAX_TEXTURE_SIZE is defined by the implementation.  Wild Fire Games has also been kind enough to offer their OpenGL capabilities report which has max texture sizes from their data set.  As of writing this, only 18 out of 33085 (0.05%) users have reported to not have the ability to render a GL_MAX_TEXTURE_SIZE 1024 or more.
Comment: Thank you for the link to the study; also, that title is better.

I'm skeptical about the study; "wildfiregames" makes me think that their sample is largely made up of "hardcore" gamers.
Comment: @RogerLevy - Looking at the vendors list, the only ones who have less than 1024 are powered by the open source MESA library.  I don't think you are going to find many systems that use such a configuration.  It seems most integrated GPUs can handle 1024.
Comment: ok.  thank you, that helped convince me.  it will really be great if i can make the banks larger and run on 99% of my potential audience's machines; the penalty for switching textures is lousy.


Electric potential in a cicuit

Question: Look at the image at (http://sub.allaboutcircuits.com/images/00082.png).
Ignoring all the resistors in the diagram and assuming that the charged
particles flow as arrows show, why does the electric potential/voltage
decrease from point 4 to 3 to 2 to 1? I thought that the electric
potential/voltage will be higher at point 3 than point 4 as the distance
between the positive end of the battery and point 3 is further than the
distance between the positive end of the battery and point 4?
Comment: allaboutcircuits doesn't seem to have adopted the same convention on current flow as the rest of the world.
Answer:

simulate this circuit – Schematic created using CircuitLab
Figure 1. Circuit.

Yes, electron flow is from the negative terminal. However, conventional current flow was established well before the discovery of the electron (by J.J.Thomson discovered in 1897) as from + to - and we still use this for practical applications while keeping the true charge flow in the back of our minds. Current flow is in the direction of the red arrow on Figure 1.
We need to take some point as reference on our circuit. Battery negative is the usual choice.
The point of maximum potential is node 1.
The potential decreases from 1 to 2, from 2 to 3 and from 3 to 4 as per resistor ratio. For example, if R1 = R2 and R3 = R1 + R2 then the potential at node 3 = Vbat/2 and potential at node 2 = 3/4 Vbat.

So your understanding is correct apart from conventional current flow. Without a link to the article it's difficult to know what caused your confusion.
Comment: Thanks for the help. However I apologize for not stating my question properly. I know that in static electricity the potential depends on the distance between 2 electric charges. In the circuit above, node 2 is further away in length from the negative end of the battery compared to node 3. So shouldnt the charge at node 2 have a higher potential? Thank you for helping
Comment: Static electricity is quite different to an electrical circuit such as the one in your question. In static there is an imbalance in charge and an object can hold this because there are insulators. In the circuit there is no net charge at any point. i.e., at Node 2 there are no missing or extra electrons. There _is_ a difference in potential between 2 and 3 and, yes, 2 is higher but there is no 'charge' there.

Electric potential in a cicuit


Spotify play/pause controlling from cmd

Question: How can I control Spotify using command line in windows xp? I know how to do it in dbus on linux, but I have no idea how to do it in windows. You can show me universal command for stopping any music player. Thanks a lot
Comment: Music players are not so standardised that there is one command that will stop all of them. The closest you can get is the mute button.
Answer: This might help :
Spotify command line
Comment: Works on Windows, but only for playpause/next/forward.

The volume and status controls do not work.  :(
Comment: Compiles but fails to attach to spotify; ERROR  Can not find spotify, is it running?

Spotify play/pause controlling from cmd


Could you theoretically sell financial assets in the US without coming under the jurisdiction of the federal government?

Question: So let's say you were some financial market that operated solely in a US state so all of your transactions never crossed state lines. Would federal government agencies like the Commodities Future Trading Commission be able to regulate you? As far as I understand it, it shouldn't because it's not interstate commerce, right?
Comment: I'm fairly sure the US claims sovereignty for any transaction undertaken in dollars regardless of location in the world, just a note
Answer: No.
Imagine, for instance, that you're a dairy and poultry farmer in Ohio. You grow a small crop of wheat every year to feed your animals. From whatever is leftover, you take enough to make flour for yourself and your family. After that, you sell whatever is left to someone locally.
You could argue that your wheat-related activities would not be interstate, that they would not be commerce, and that they would have at most indirect effects on interstate commerce.
But the Supreme Court would reject that argument, as it did in Wickard v. Filburn, 317 U.S. 111 (1942).

Even if appellee's activity be local, and though it may not be regarded as commerce, it may still, whatever its nature, be reached by Congress if it exerts a substantial economic effect on interstate commerce, and this irrespective of whether such effect is what might at some earlier time have been defined as "direct" or "indirect."

So the general rule is that any activity that has a "substantial economic effect" on interstate commerce -- by reducing demand, for instance -- is within the reach of the federal government's authority to regulate.
While there continues to be controversy over this broad interpretation of Commerce Clause authority, it's a well-settled principle, and everyone recognizes that practically speaking, there's virtually no commercial activity that Congress cannot regulate.
Comment: To be clear, U.S. securities laws do contain an express statutory intrastate commerce exception which is broader than it is constitutionally required to be. But, the statutory intrastate commerce exceptions in the securities acts are nonetheless narrow and very difficult to qualify for in any economically meaningful way not already exempt on other grounds (and still do not escape state securities regulations which closely parallel the federal ones in most states). So, as a practical matter, issuers predominantly use exceptions to the federal securities laws other than the intrastate exception.
Comment: A recent case affirming the broad scope of the commerce clause is *Taylor v. United States*, U.S. (June 20, 2016). https://www.supremecourt.gov/opinions/15pdf/14-6166_o7jp.pdf *See also Gonzales v. Raich*, 545 U. S. 1 (2005).
Comment: And for discussions on the limitations of Commerce Clause authority, see United States v. Morrison, 529 U.S. 598 (2000) https://www.law.cornell.edu/supct/html/99-5.ZS.html; and National Federation of Independent Business v. Sebelius, 567 U.S. 519 (2012) https://supreme.justia.com/cases/federal/us/567/519/.


Query on UK visa options for South African postdoc at Birkbeck University funded by a South African organisation

Question: I am from South Africa, and have been awarded a freestanding post-doctoral fellowship award that I am expected to take up at Birkbeck University in London. The fellowship award is from a South African based funding organisation (NRF). The funding is valued at $26000 per annum which amounts to 18 000 British pounds. I realise that this amount does not qualify me for a tier two visa. I was wondering if I could get any assistance on what other options I have to qualify for a UK visa.
Comment: You might want to consider asking the [expats](http://expatriates.stackexchange.com/) stack exchange. Hopefully I am wrong about this situation being intractable.
Answer: Unfortunately, short of marrying an EU national, you likely do not qualify for a UK visa and there is nothing that can be done about this. This document contains the information about salary thresholds. These apply strictly, there are no exceptions. Even if your position fulfils a shortage occupation the salary threshold still applies. You will need to find some more funding, or give up on taking up the fellowship in the UK. You may also consider contacting the university to see if there is anything that can be done to help your situation.


What does the geometry of a compactified dimension impact?

Question: In Kaluza's original work, he didn't compactify the fifth dimension, rather imposed the "cylindrical condition" where none of the components in the 4D metric depended on the 5th dimension. It wasn't until Klein that the fifth dimension was compactified to a circle, but as far as I've seen the result is the same, with the same resultant metric, vector and scalar. What does it matter, the geometry of the compactified dimension, in the context of Kaluza Klein theory?
Answer: The significance of the compactified circle as opposed to having a non-compact fifth dimension is that a compact dimension produces the discrete "Kaluza-Klein tower of states" in the effective four-dimensional theory - due to the scalar field then having a discrete Fourier series in the fifth coordinate, which, for small radii of the circle, produces one massless mode and a tower of fields with mass $\propto \frac{n}{R}$ where $n$ is the $n$th mode and $R$ the radius of the circle.
If the circle is very small, this makes it possible that we only see the lowest - i.e. massless - stage of this tower, which is the only way the quantized KK theory can even remotely be hoped to fit to observation. In the non-compact case, there is no such sensible interpretation for the scalar field. Additionally, since the conserved momentum in the fifth direction corresponds to the 4D electric charge, a compact fifth dimension naturally explains charge quantization in this model, since the allowed momenta in a compact dimension (in this case on a closed string, effectively) are discrete.
Furthermore, choosing the dimension compact makes the 5D Kaluza-Klein spacetime a $\mathrm{U}(1)$-principal bundle over the 4D "actual" spacetime, explaining the appearance of the $\mathrm{U}(1)$-gauge field in a naturally geometric way, since the modern geometrical formulation of gauge theory models the gauge field as a connection on such principal bundles.
Answer: The main consideration for the internal space, called a Calabi-Yau manifold, in a Kaluza-Klein (KK) theory is that it be Ricci flat. The reason for this is that if there is a nonzero Ricci tensor then a string that is wound on the internal space will grow in size. This has something to do with the Hamilton equations
$$
\frac{dg_{ab}}{dt}~=~-2R_{ab}
$$
The string will tend to spread over the space as this first order differential equation is not time reverse invariant. This leads to a divergence of the string densely filling the space.
So the internal space must be Ricci flat. As with Klein's suggestion that the cyclicity condition means there is an internal space of a circle, for six dimensions we can propose that the internal space be a 6-torus. A torus appears to have curvature, but this is really extrinsic curvature for how it is embedded in a high dimension. A video game where an object leaves to top or bottom to emerge at the bottom or top and similarly with the sides is a 2-torus. It is also flat.
The 6-torus turns out not to work out very well. So one makes some additional requirements that the internal space reflect holomorphic conditions on the field equations. This then means the internal space is somewhat more exotic, such as the $K3\times K3$ space for $K3$ standing for Kummer, Kähler and Kodaira, the mathematicians who studied this and related spaces.
The general reason that the geometry and also topology matters is that for a string wound around this space a gauge flux will be incident on the string or the area it encloses in its winding in different ways. It is in a way similar to the equations for magnetic flux and Faraday's equations. Different windings of a string on an internal space, which can be dependent on the geometry and topology of that space, influences the eigenmodes of the string. It is almost a bit like computing EMF for a magnetic field through a conducting loop. Because of that the nature of the particle physics world is then dependent on the shapes of these Calabi-Yau spaces
Comment: Hmmm... that's not a bad idea... let students study the behavior of different  windings on magnetic cores with different genus hands on... that ought to teach something about how topology matters.
Comment: 1. The "internal space" is not "called a Calabi-Yau manifold". It is the case that in string theory internal spaces that are CY are of particular interest, but in general dimensional reduction of field theories there is no requirement on the compactified space to be CY. 2. The question is explicitly talking about *Kaluza-Klein theory*, why are you talking about strings? 3. $K_3$ surfaces are 2D complex manifolds, so $K_3\times K_3$ would be an internal space of 8 real dimensions, hence not a replacement for the 6-torus.


Is it permitted to create a revolution?

Question: if the presidents of my country steal money and I make a revolution where people will die to destroy thieves in the government, will I be a sinner or vice versa the savior of the country?
Answer: It depends. Rebelling against a righteous Muslim ruler is haram - even if you dislike him.  As for a ruler who really is wrongdoer then such behavior of a ruler might fall into either kufr or fisq.
Kufr
If the ruler commits kufr then he is no longer eligible to rule and it is obligatory to depose him and to appoint a Muslim ruler.
The evidence of deposing him includes:

لا يتخذ المؤمنون الكافرين أولياء
Let not believers take disbelievers as allies
— Quran 3:28

The ruler is a type of ally/guardian. A disbeliever can not be a guardian and hence can not be a ruler.  Hence it is prescribed to rebel against him and depose him.

ولن يجعل الله للكافرين على المؤمنين سبيلا
Never will Allah give the disbelievers over the believers a way [to overcome them]
— Quran 4:141

A ruler tends to have great authority over the Muslims, so it is contrary to Islamic goals to retain a ruler who has disbelieved. None of the laws on obedience to the ruler apply to a disbelieving ruler because of this.

وأن لا ننازع الأمر أهله، إلا أن تروا كفرا بواحا، عندكم من الله فيه برهان
And to not to fight against the ruler unless we noticed him having open Kufr (disbelief) for which we would have a proof with us from Allah.
— Bukhari

 قيل يا رسول الله أفلا ننابذهم بالسيف فقال لا ما أقاموا فيكم الصلاة
It was asked (by those present): Shouldn't we overthrow them with the help of the sword? He said: No, as long as they establish prayer among you.
— Muslim

These ahadith clearly allow fighting against a ruler when he commits kufr or abandons prayer (which is an example of kufr).

Fisq
Other times the wrongdoing of a ruler might come under fisq. In this case firstly attempts should be made to correct his behavior via advice. However if that is not effective then is it prescribed to depose him by an armed rebellion?
There is difference of opinion among the scholars on this.
Most of the scholars have held that righteousness is a condition for the initial appointment of a ruler, however it is not a condition for retaining him. Hence they have stated that it is haram to rebel against a ruler even if he becomes unjust. The evidence of this includes:

يكون بعدي أئمة لا يهتدون بهداى ولا يستنون بسنتي وسيقوم فيهم رجال قلوبهم قلوب الشياطين في جثمان إنس  قال قلت كيف أصنع يا رسول الله إن أدركت ذلك قال تسمع وتطيع للأمير وإن ضرب ظهرك وأخذ مالك فاسمع وأطع
There will be leaders who will not be led by my guidance and who will not adopt my ways. There will be among them men who will have the hearts of devils in the bodies of human beings. I said: What should I do O Messenger of Allah, if I (happen) to live in that time? He replied: You will listen to the Amir and carry out his orders; even if your back is flogged and your wealth is snatched, you should listen and obey.
— Muslim

إنه يستعمل عليكم أمراء فتعرفون وتنكرون فمن كره فقد برئ ومن أنكر فقد سلم ولكن من رضي وتابع قالوا يا رسول الله ألا نقاتلهم قال لا ما صلوا
Amirs (rulers) will be appointed over you, and you will find them doing good as well as bad deeds. One who hates their bad deeds is absolved from blame. One who disapproves of their bad deeds is (also) safe (so far as Divine wrath is concerned). But one who approves of their bad deeds and imitates them (is doomed). People asked: Messenger of Allah, shouldn't we fight against them? He replied: No, as long as they say their prayer.
— Muslim

Rebellion weakens and disunites the Muslim state which can be more harmful than showing patience to the unjust ruler.

Others scholars have held that it is obligatory or at least permitted to depose an unjust ruler, and some of them have conditioned this to having enough power, safety from fitnah or the existence of an alternate good Imam who can be given support against the evildoer. Their evidence includes:

قال إني جاعلك للناس إماما قال ومن ذريتي قال لا ينال عهدي الظالمين
[Allah] said, "Indeed, I will make you a leader for the people." [Abraham] said, "And of my descendants?" [Allah] said, "My covenant does not include the wrongdoers."
— Quran 2:124

This verse implies that a wrongdoer can not be an Imam (leader) in the sight of Allah. When he is no longer legitimate it is permitted to depose him.

فإن بغت إحداهما على الأخرى فقاتلوا التي تبغي حتى تفيء إلى أمر الله
But if one of them oppresses the other, then fight against the one that oppresses until it returns to the ordinance of Allah.
— Quran 49:9

This verse commands fighting the Muslims who oppress other Muslims. Unjust rulers would by default be included in its meaning as it is general.

ثم إنها تخلف من بعدهم خلوف يقولون ما لا يفعلون ويفعلون ما لا يؤمرون فمن جاهدهم بيده فهو مؤمن ومن جاهدهم بلسانه فهو مؤمن ومن جاهدهم بقلبه فهو مؤمن وليس وراء ذلك من الإيمان حبة خردل
Then there came after them their successors who said whatever they did not practice, and practiced whatever they were not commanded to do. He who strove against them with his hand was a believer: he who strove against them with his tongue was a believer, and he who strove against them with his heart was a believer and beyond that there is no faith even to the extent of a mustard seed.
— Muslim

This and other texts on Nahi 'an al-Munkar are general and hence include correcting the ruler when he is oppressive. And fighting is the last resort method of changing wrongdoing by one's hand.

Some of the sahaba and those who came later are known to have rebelled or fought against the Umayyads. Examples include Hussain ibn Ali and Abdullah ibn Zubair, and the rebellion of the people of Medinah and Iraq etc.

Ref: Mawsoo'ah al-Fiqhiyyah and Fiqh al-Islami wa Adillatuhu.
Answer: Rulers in Islam are not supposed to act arbitrarily. They should respect Sharia, and accept judgement by knowledgeable judges.
Muhammad (p.b.u.h) who was not only prophet, but in his later time also governor and judge, in spite of being a prophet who received guidance from God, already established a council that should prevent him from going into the trap to act arbitrarily, and established  Shura.
Islamic scholars teach to follow the rulers as long as you are not forced to break Islamic Law. Then you should respect the Law of God more than the ruler, and disobey the ruler. A revolution is not recommended, but rather peaceful passive resistance hanafi scholar's opinion. This is mainly based on the hadith in Sunan an-Nasa'i 4206:

The Messenger of Allah said: 'The Muslim must hear and obey whether he likes it or not, unless he is commanded to commit an act of disobedience. If he is commanded to commit an act of disobedience, then he is not required to hear and obey.'

also found in Jami at-Tirmidi and others, (graded Sahih by Darussalam)
However, other versions nourish some doubts whether the obediance really concerned a ruler. Sahih Muslim 648c
My friend (the Holy Prophet) bade me to hear and obey even if he is a slave having his feet and arms cut off, and observe prayer at its prescribed time. (And further said): It you find people having observed the prayer, you in fact saved your prayer, otherwise (if you join with them) that would be a Nafl prayer for you.
The translation on Sunnah.com adds and obey (aruler) even if he is a slave having his feet and arms cut off. This does not make sense. The ruler is not a slave.
Muslim 1835a
Whoso obeys me obeys God, and whoso disobeys me disobeys God. Whoso obeys the commander (appointed by me) obeys me, and whoso disobeys the commander disobeys me. The same tradition transmitted by different persons omits the portion: And whose disobeys the commander disobeys me.
So, the authentic core of the Hadith is probably only

Whoso obeys me obeys God; and whose disobeys me disobeys God.

Nevertheless, the authentic commandment (Bukhari 7076 and many other passages) that it is not allowed to kill a Muslim must be considered in this context. An armed revolution will result in a war against other Muslim (more but not only in a Muslim-majority state). This is haram and kufr (on both sides, of course), although it happened very early in history until now.
In the light of this, peaceful resistance is the preferable way. If you follow my doubt on the reliability of the Sunan an-Nasa'i 4206 version of the hadith, resistance may well go beyond the refusal to obey the ruler more than God, but waging an armed revolution will inevitably lead to sin, and the outcome of the revolutions in the youngest history in Islam-majority states showed that revolutions against unjust rulers unfortunately often fail to save the country.

Is it permitted to create a revolution?


WSUS WARNING: CSerializationHelper:: InitSerialize failed : 0x80070002

Question: have recently set up WSUS in a server 2008 R2 / Windows 8.1 environment. WSUS 3.0 SP2, everything appears to be working. GPO is working, client devices are reporting to WSUS server, but for some reason, will not install updates.
In the log file, all client machines search for relevant updates, get ready to install them, then produce the following warning/error. Have done some googling but i cant find a solid answer as to why, anyone know?
Always the same error for every device...
     964    1c14    EP  Got WSUS Client/Server URL:
     964    1c14    EP  Got WSUS Reporting URL:
     964    1c14    Report  OpenReportingWebServiceConnection,     reporting URL =
     964    1c14    Report  Uploading 2 events using cached     cookie.
     964    1c14    Report  Reporter successfully uploaded 2     events.
     964    e50 Report  WARNING: CSerializationHelper::     InitSerialize failed : 0x80070002
     964    e50 Report  WARNING: CSerializationHelper:: InitSerialize failed : 0x80070002
     964    e50 AU  ###########  AU: Uninitializing Automatic     Updates  ###########
     964    e50 WuTask  Uninit WU Task Manager
     964    e50 Service *********
     964    e50 Service **  END  **  Service: Service exit     [Exit code = 0x240001]

Answer: You might also notice that the OS is showing Windows Server 2003 on your WSUS server. Have you tried installing KB2734608 on your WSUS server? You'll also want to make sure to run the post commands on each of your Windows 8 and Windows Server 2012 servers.
Net stop wuauserv

rd /s %windir%\softwaredistribution\

Net start wuauserv

Comment: Thanks mate. I probably should have posted that i resolved this installing KB2734608, did it a while ago and everything is all good now. Also pushed out a batch via PDQ to remove the SoftwareDistribution folder and stop/start WSUS service on the client machine.
Answer: Kind of a weird fix but this worked for me:
net stop wuauserv
rd /S /Q c:\windows\SoftwareDistribution
reg ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /d 0 /t REG_DWORD /f
reg ADD "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" /v AUOptions /d 3 /t REG_DWORD /f
reg ADD "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" /v AutoInstallMinorUpdates /d 1 /t REG_DWORD /f
reg DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /f
net start wuauserv
reg ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v EnableFeaturedSoftware /t REG_DWORD /d 0 /f
reg ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v IncludeRecommendedUpdates /t REG_DWORD /d 0 /f
reg ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 3 /f
reg ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate" /v DisableWindowsUpdateAccess /t REG_DWORD /d 0 /f
net stop wuauserv
net start wuauserv
wuauclt /detectnow

Answer: We had the same issue which was resolved by doing the following:
Run these commands in an elevated command prompt:
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId /f

REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientIdValidation /f

net stop wuauserv

move %windir%\windowsupdate.log %windir%\windowsupdate.old.log

move %windir%\SoftwareDistribution %windir%\SoftwareDistributionold

regsvr32 /s atl.dll

regsvr32 /s wucltui.dll

regsvr32 /s wups.dll

regsvr32 /s wuaueng.dll

regsvr32 /s wuapi.dll

regsvr32 /s msxml3.dll

regsvr32 /s mssip32.dll

regsvr32 /s initpki.dll

regsvr32 /s softpub.dll

net start wuauserv

wuauclt /resetauthorization /detectnow

If Windows Update service fails to restart - then open services and manually restart it (our servers had that issue ion 2 of 30 servers)..
Run a gpudate /force
Now - Open Control panel and go to Windows Updates and check for new updates
You will see that systems administrator is the responsible party for updates
After the update check - go to your WSUS Management console
Refresh the list where your servers (or PC's) are supposed to register - you should now see your systems appear almost immediately
if you do not see some of them go back and restart the server or PC - as it most likely ran windows updates prior to being told it was being managed by WSUS (and therefore will require a reboot prior to being established as a managed server in WSUS)!
Hope this helps someone - this took 2 days of searching forums and putting together a bunch of other suggestions with a few modifications - but ultimately this solved our issue.


changing attribute table automatically in map composer

Question: I would like to add an attribute Table to the map composer, which so far is working, I also managed to display it as two coloums. I'm using QGIS 2.18.3 (Las Palmas) for a project where I have about 15-20 maps with the same extent, each displaying a different attribute though. I am able to use the atlas to create a seperate map for each of the 15-20 attributes (through visibility Presets), but I am not able to automatically change the attribute table accordingly in my map composer.
The maps composer switches through the different maps, but always displays the attribute table of the first map. I'm not sure where I'm going wrong.
Comment: What do you mean when you say that each map is displaying a different attribute? Does each map display the same layer, categorized by a different attribute? Or does each map display a different layer?
Comment: Yes, each map displays the same layer but always shows a different attribute (i.e. column of attribute table). Thus I would like the attribute table in the map composore to automatically update to the attribute its currently showing.
Answer: Use a data-defined expression to select the attribute table columns.

Click on your attribute table > Item Properties > Attributes... > Add a column > click on the epsilon button (see image below)

Now use the expression editor to select the appropriate attribute for each atlas page. For example, if your atlas page names are the same as the attributes, use the expression:

@atlas_pagename


How do I use a specific AMI for juju instances?

Question: I would like to use another AMI with juju instead of the default AMI, where do I specify this?
Answer: This used to be supported in ~/.juju/environments.yaml as default-image-id in older versions of Juju but is currently unimplemented in Juju 2.x.
According to this thread it just needs to be implemented:

https://lists.ubuntu.com/archives/juju/2013-April/002389.html
Comment: This answer is out-of-date now and refers to the Python version of juju, which is not supported anymore. juju-core (the Go version) supports an "instance-type" constraint (run `juju help constraints` for more info) to select e.g. "m1.small", but specifying an AMI to use is not supported.
Answer: If the image id is absolutely necessary for you, then this how you can get it working in precise.
Create a directory of your choice. cd into it and run:
bzr branch lp:juju/0.5

However before you can run from source, you need to make sure you have the dependencies installed.
sudo apt-get install python-zookeeper python-virtualenv python-yaml

Next cd into the 0.5 directory and run bzr revert -r479
Now run python setup.py develop inside the directory. Juju works great :)


Scala: fastest `remove(i: Int)` in mutable sequence

Question: Which implementation from scala.collection.mutable package should I take if I intend to do lots of by-index-deletions, like remove(i: Int), in a single-threaded environment? The most obvious choice, ListBuffer, says that it may take linear time depending on buffer size. Is there some collection with log(n) or even constant time for this operation?
Answer: Removal operators, including buf remove i, are not part of Seq, but it's actually part of Buffer trait under scala.mutable. (See Buffers)
See the first table on Performance Characteristics. I am guessing buf remove i has the same characteristic as insert, which are linear for both ArrayBuffer and ListBuffer.
As documented in Array Buffers, they use arrays internally, and Link Buffers use linked lists (that's still O(n) for remove).
As an alternative, immutable Vector may give you an effective constant time.

Vectors are represented as trees with a high branching factor. Every tree node contains up to 32 elements of the vector or contains up to 32 other tree nodes. [...] So for all vectors of reasonable size, an element selection involves up to 5 primitive array selections. This is what we meant when we wrote that element access is "effectively constant time".

scala> import scala.collection.immutable._
import scala.collection.immutable._

scala> def remove[A](xs: Vector[A], i: Int) = (xs take i) ++ (xs drop (i + 1))
remove: [A](xs: scala.collection.immutable.Vector[A],i: Int)scala.collection.immutable.Vector[A]

scala> val foo = Vector(1, 2, 3, 4, 5)
foo: scala.collection.immutable.Vector[Int] = Vector(1, 2, 3, 4, 5)

scala> remove(foo, 2)
res0: scala.collection.immutable.Vector[Int] = Vector(1, 2, 4, 5)

Note, however, a high constant time with lots of overhead may not win a quick linear access until the data size is significantly large.
Comment: there's no column in the first table for "remove"
Comment: That's why he says "I am guessing the indexed remove has the same characteristic as insert".
Comment: @Alexey Romanov I added most the answer above after @Ron pointed it out.
Comment: Thanks! Though an immutable vector is another trade-off for good old mutable implementation like [LinkedList](http://download.oracle.com/javase/6/docs/api/java/util/LinkedList.html). Apparently Scala's [LinkedList](http://www.scala-lang.org/api/current/scala/collection/mutable/LinkedList.html) does not handle deletions at all (I wonder, what does "mutable" mean then).
Comment: @incarnate — I suppose you know already, but anyway the LinkedList is mutable in the sense that `.next` can be modified, and there's an `update()` function. But [DoubleLinkedList](http://www.scala-lang.org/api/current/index.html#scala.collection.mutable.DoubleLinkedList) does have a `remove()` operation.
Comment: Please revise the formulate effective constant time. http://www.lihaoyi.com/post/ScalaVectoroperationsarentEffectivelyConstanttime.html
Answer: Depending on your exact use case, you may be able to use LinkedHashMap from scala.collection.mutable.
Although you cannot remove by index, you can remove by a unique key in constant time, and it maintains a deterministic ordering when you iterate.
scala> val foo = new scala.collection.mutable.LinkedHashMap[String,String]
foo: scala.collection.mutable.LinkedHashMap[String,String] = Map()

scala> foo += "A" -> "A"
res0: foo.type = Map((A,A))

scala> foo += "B" -> "B"
res1: foo.type = Map((A,A), (B,B))

scala> foo += "C" -> "C"
res2: foo.type = Map((A,A), (B,B), (C,C))

scala> foo -= "B"
res3: foo.type = Map((A,A), (C,C))

Comment: Yeap, thanks for great suggestion. However, this approach has its own limitations (lacks `index` and does not inherit from `Seq`). But it is nice.
Answer: Java's ArrayList effectively has constant time complexity if the last element is the one to be removed. Look at the following snippet copied from its source code,
        int numMoved = size - index - 1;
        if (numMoved > 0)
            System.arraycopy(elementData, index+1, elementData, index,
                             numMoved);
        elementData[--size] = null; // clear to let GC do its work

As you can see, if numMoved is equal to 0, remove will not shift and copy the array at all. This in some scenarios can be quite useful. For example, if you do not care about the ordering that much, to remove an element, you can always swap it with the last element, and then delete the last element from the ArrayList, which effectively makes the remove operation all the way constant time. I was hoping ArrayBuffer would do the same, unfortunately that is not the case.