summary
stringlengths
15
147
text
stringlengths
1
19.3k
answer
stringlengths
32
22.6k
labels
float64
0.33
1
answer_summary
stringlengths
5
164
Strategy for hosting 700+ domains names, each with a static HTML site
I have a portfolio of more than 700 domain names, and ideally I'd like to put up a single-page HTML/CSS/JavaScript webpage for each domain. Is there a system/strategy/workflow that will allow me to: Automate the deployment of new websites, quickly and easily without having to manually initiate each new website in an admin panel. For instance, I've seen dropbox-based solutions that claim to make it simple to setup new websites on your dropbox account, but you still have to set each one up in an admin interface first. It would be so much easier to have a folder naming convention that allowed the user to easily clone/copy/duplicate sites inside their Dropbox App folder (https://www.dropbox.com/developers/blog/23) to create new ones. Sounds interesting, however... It's easy to manage CNAMEs on the registrar-side, but is there a way to quickly associate CNAMEs with new websites (on the hosting side), maybe using the method offered by gh-pages-style (https://help.github.com/articles/setting-up-a-custom-domain-with-pages)? With GitHub's gh-pages, all you have to do is drop a file called CNAME into your repo, with the domain name you want associated with the repo inside the file. gh-pages isn't a good solution for what I'm doing though unfortunately. I'm also a front-end developer, specializing in rapid web development and "front-end build systems", so I building and maintaining static assets for hundreds of sites is no problem. It's the hosting-side that I really struggle with. Any suggestions? Edit: I should also mention that managing my own servers is not an option. As a last resort I might look to build a 3rd party service on top of AWS, Azure etc. but managing servers directly is exactly what I'm trying to get away from.
@jonschlinkert setting up CNAMES has nothing to do with adding a single HTML page to 700 domains. CNAME's won't help any with SEO. If you're creating a single HTML page for each of your domains why not build an HTML template. I don't think you'll find any good method of inserting the copy into each page since you'll have to write the content at some point you may as well do it into the HTML pages themselves. There are a few applications which let you manage multiple WordPress sites from a single dashboard that my be useful to you.
0.777778
How to add a single HTML page to 700 domains?
Error extends AccountController.php in magento
I'm trying to extend the core AccountController.php -> app/code/core/Mage/Customer copied it to app/code/local/Mage/ and add a log to see which extends properly. In the file AccountController.php (app/code/local/Mage/Customer/controllers) ... ... public function createPostAction() { Mage::log('In app/code/local/Mage/', null, 'test.log', true); ... ... AND CORE (only test) In the file AccountController.php (app/code/core/Mage/Customer/controllers) ... ... public function createPostAction() { Mage::log('In app/code/core/Mage/', null, 'test.log', true); ... ... And does not go through code/local/ Mage but by CORE. I need to configure something or it fails? So I created a separate module following this tutorial: http:// aqpredict.com/blog/overriding-account-contoller-magento/ does not work. anyone has an example of this, thanks.
I answered this question of yours over at StackOverflow: The logic through which controller class definitions are loaded builds the path to the file above the explicit include paths on which the autoloader relies. This means no local vs. core precedence. You need to creat a controller rewrite by specifying a directory under the xpath frontend/routers/customer/args/modules/your_module The latter node needs the before attribute set to Mage_Customer and you will need to create an AccountController.php with a createPostAction() method. Depending on your needs you may or may not need to extend from and require the core account controller class.
0.888889
How to build a controller rewrite by specifying a directory under the xpath frontend?
How to remove a directory and its contents using NSFileManager
New to Objective C. I have created a few directories which contain pdf files for an iPhone app. How can I delete a directory and its contents using NSFileManager? Do I need to loop through and remove the contents first? Any code samples would be much appreciated. Thanks in advance.
Heres some code I use that Ive edited to suit the question - (NSMutableString*)getUserDocumentDir { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSMutableString *path = [NSMutableString stringWithString:[paths objectAtIndex:0]]; return path; } - (BOOL) createMyDocsDirectory { NSMutableString *path = [self getUserDocumentDir]; [path appendString:@"/MyDocs"]; NSLog(@"createpath:%@",path); return [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:NO attributes:nil error:NULL]; } - (BOOL) deleteMyDocsDirectory { NSMutableString *path = [self getUserDocumentDir]; [path appendString:@"/MyDocs"]; return [[NSFileManager defaultManager] removeItemAtPath:path error:nil]; }
0.888889
NSMutableString *paths
Scipy Fast 1-D interpolation without any loop
I have two 2D array, x(ni, nj) and y(ni,nj), that I need to interpolate over one axis. I want to interpolate along last axis for every ni. I wrote import numpy as np from scipy.interpolate import interp1d z = np.asarray([200,300,400,500,600]) out = [] for i in range(ni): f = interp1d(x[i,:], y[i,:], kind='linear') out.append(f(z)) out = np.asarray(out) However, I think this method is inefficient and slow due to loop if array size is too large. What is the fastest way to interpolate multi-dimensional array like this? Is there any way to perform linear and cubic interpolation without loop? Thanks.
The method you propose does have a python loop, so for large values of ni it is going to get slow. That said, unless you are going to have large ni you shouldn't worry much. I have created sample input data with the following code: def sample_data(n_i, n_j, z_shape) : x = np.random.rand(n_i, n_j) * 1000 x.sort() x[:,0] = 0 x[:, -1] = 1000 y = np.random.rand(n_i, n_j) z = np.random.rand(*z_shape) * 1000 return x, y, z And have tested them with this two versions of linear interpolation: def interp_1(x, y, z) : rows, cols = x.shape out = np.empty((rows,) + z.shape, dtype=y.dtype) for j in xrange(rows) : out[j] =interp1d(x[j], y[j], kind='linear', copy=False)(z) return out def interp_2(x, y, z) : rows, cols = x.shape row_idx = np.arange(rows).reshape((rows,) + (1,) * z.ndim) col_idx = np.argmax(x.reshape(x.shape + (1,) * z.ndim) > z, axis=1) - 1 ret = y[row_idx, col_idx + 1] - y[row_idx, col_idx] ret /= x[row_idx, col_idx + 1] - x[row_idx, col_idx] ret *= z - x[row_idx, col_idx] ret += y[row_idx, col_idx] return ret interp_1 is an optimized version of your code, following Dave's answer. interp_2 is a vectorized implementation of linear interpolation that avoids any python loop whatsoever. Coding something like this requires a sound understanding of broadcasting and indexing in numpy, and some things are going to be less optimized than what interp1d does. A prime example being finding the bin in which to interpolate a value: interp1d will surely break out of loops early once it finds the bin, the above function is comparing the value to all bins. So the result is going to be very dependent on what n_i and n_j are, and even how long your array z of values to interpolate is. If n_j is small and n_i is large, you should expect an advantage from interp_2, and from interp_1 if it is the other way around. Smaller z should be an advantage to interp_2, longer ones to interp_1. I have actually timed both approaches with a variety of n_i and n_j, for z of shape (5,) and (50,), here are the graphs: So it seems that for z of shape (5,) you should go with interp_2 whenever n_j < 1000, and with interp_1 elsewhere. Not surprisingly, the threshold is different for z of shape (50,), now being around n_j < 100. It seems tempting to conclude that you should stick with your code if n_j * len(z) > 5000, but change it to something like interp_2 above if not, but there is a great deal of extrapolating in that statement! If you want to further experiment yourself, here's the code I used to produce the graphs. n_s = np.logspace(1, 3.3, 25) int_1 = np.empty((len(n_s),) * 2) int_2 = np.empty((len(n_s),) * 2) z_shape = (5,) for i, n_i in enumerate(n_s) : print int(n_i) for j, n_j in enumerate(n_s) : x, y, z = sample_data(int(n_i), int(n_j), z_shape) int_1[i, j] = min(timeit.repeat('interp_1(x, y, z)', 'from __main__ import interp_1, x, y, z', repeat=10, number=1)) int_2[i, j] = min(timeit.repeat('interp_2(x, y, z)', 'from __main__ import interp_2, x, y, z', repeat=10, number=1)) cs = plt.contour(n_s, n_s, np.transpose(int_1-int_2)) plt.clabel(cs, inline=1, fontsize=10) plt.xlabel('n_i') plt.ylabel('n_j') plt.title('timeit(interp_2) - timeit(interp_1), z.shape=' + str(z_shape)) plt.show()
0.777778
Interp_2 is a vectorized implementation of linear interpolation that avoids any python loop whatsoever
abelian higgs vortices
Dear fellow mathematicians, during some gauge-theoretic explorations I've stumble upon a recent paper by Nick Manton on Abelian higgs vortices where he studies Abelian higgs "vortices" on hyperbolic surfaces. Does anyone have any historical knowledge of whether the word vortex in this context have any connection with point vortices from fluid dynamics?
The study of vortices in Abelian Higgs models in the context of relativistic QFT goes back to the paper by Nielsen and Olesen, Nucl.Phys.B61:45-61,1973. They in turn were directly inspired by the study of vortices carrying quantized magnetic flux in type II superconductors which goes back to Abrikosov (see his Nobel lecture here: http://nobelprize.org/nobel_prizes/physics/laureates/2003/abrikosov-lecture.html). In that context the Abelian gauge field is identified with the electromagnetic field and the Higgs field with the Cooper pair of electrons. I have not gone back to the original papers by Abrikosov (which are probably in Russian) but I would guess that the term vortex is based on an analogy to fluid mechanics with the vorticity of the fluid vortex (curl of the velocity field) being analogous to the magnetic field of the Abelian Higgs vortex (curl of the vector potential).
0.888889
Vortices in Abelian Higgs models in context of relativistic QFT
Wiki-like tool for writing specifications and documentation
I am looking for a wiki or wiki-like system for writing and managing specification and documentation for a software project. I know there are lots of wiki-implementations available, but are there some that are especially well-suited for this kind of task? Actually it doesn't have to be a wiki, just a system that makes it easy to write and navigate specs and documentation, and which support change tracing.
For the personal project (existing only in my PC) I use Wiki in a Jar. In the past I worked with Redmine (it has furthermore a system of bug tracking and SCM )
1
Wiki in a Jar
Career advice โ€“ mathematics
I really need some opinions/advice on my situation. My background I'm studying for my master degree in mathematics. I have always (since I was 14) wanted to do my own research one day. As I grew older, I knew that mathematics was what I wanted to do. So I went to the university to study mathematics. After having encountered a course in group theory I knew that I belonged to the algebraic part of mathematics. I did my bachelor project in group theory and when I became a graduate student (September 2013), I took courses and made a project supporting my interest in algebra. Along the way I created the vision that I would finish my master degree as a dedicated student in algebra. In order to realize this vision my plan was to study abroad for one semester taking new algebraic courses. The situation My situation today is that my study abroad semester begins tomorrow. As mentioned my dream is to do my own research, but more generally/important: I want to develop new ideas and be dedicated to something and I would love to follow/explore my passion. My first thought (as many other students): I should get a PhD. So I did some research and figured out that there was an available position at the university I'm currently studying at in geometric group theory. I don't know much about geometric group theory, but I do know that I love group theory. So I would really like to know if this is an opportunity or if I should just forget it. I don't want to pursue a PhD for anything in this world. I just want to stay focus on creating a meaningful work life around my passion. Any advice? Further remarks I'm a student from Denmark and I'm studying abroad in Austria for one semester. After my study abroad semester I still have to study one year for my master degree in Denmark. However this year consists of a half year with elective courses and a half year where I'm making my master's thesis. I donโ€™t know much about the PhD position. I found it from a Google search (: โ€œPhD position group theoryโ€). There is only given a starting date and an e-mail address for contact. Iโ€™m going to attend a course held by the supervisor of the project, so the whole thing is a coincidence. I have investigated my opportunities for a position at my home university. One of my supervisors, a professor in group theory, told me that he couldn't offer me a position, since it was a question about money, but would like to recommend me. I don't think the university accepts PhD students without a master degree and the positions are without project descriptions. However there is also another university (in Denmark) with a talent program where it is possible to get a PhD position without having a master degree. I contacted them and they told me I should apply after my study abroad semester (because I would have a stronger profile). But I don't know my chances.
I'm having a lot of trouble nailing down your question. After reading it several times, I think you mean that you have an opportunity to go on to study a PhD in geometric group theory at your current university. (Is it specifically relevant that you are going abroad tomorrow? How does this fit in with the rest?) From this I am guessing that you are not in the US, because in the US one would not have a position in "geometric group theory" specifically; one would just apply to the entire math department. It could be helpful to know what country you are studying in. So I think you are really asking whether you should go on to do a PhD? You say that your motivation is to do mathematical research: for that you essentially need a PhD, yes. Along the way I created the vision that I would finish my master degree as a dedicated student in algebra. Yes, okay, you're studying algebra. I feel like I'm missing some nuance here: what's the "vision"? As mentioned my dream is to do my own research, but more generally/important: I want to develop new ideas and be dedicated to something and I would love to follow/explore my passion. Again, I feel like I'm missing a nuance. Doing your own research means precisely to developing your new ideas and being dedicated to something. Doesn't everyone want to "follow/explore their passion"? That comes off sounding mean, which is not my intent: rather, I feel like you're trying to say something here and I'm missing it. I don't know much about geometric group theory, but I do know that I love group theory. So I would really like to know if this is an opportunity or if I should just forget it. It seems clear that a PhD in geometric group theory is an indeed an opportunity to do everything that you said you wanted to do...in geometric group theory, which is a subfield of the field that you say you like. Whether you will like GGT specifically seems best answered by learning some and finding out. If the PhD program is so specifically invested in GGT that if you find out you don't want to do GGT per se then you'll need to leave the program, then you should study GGT on your own / during your master's degree first in order to find out whether it's interesting enough to you to spend years of your life on. (I think GGT is really interesting. If I hadn't done arithmetic geometry, I think I would have had fun with it. So I assure you that there is nothing wrong with that subsubfield of mathematics!) I don't want to pursue a PhD for anything in this world. I just want to stay focus on creating a meaningful work life around my passion. Huh? This time I don't understand at all. Please elaborate/rephrase.
0.888889
Doing your own research means precisely to developing new ideas and being dedicated to something .
Close Popup window in Salesforce1
I need to close a popup window in Salesforce1. When it opens in a normal browser, the popup is closed using Window.close() But in case of Salesforce1(App Browser), the Window.close() does not work. Is there any workaround to close the popup?
When you say Salesforce1, are you trying this on a real device or in emulated mode on a browser (using the /one/one.app suffix)? If there are any errors, it should show up in the console log. Else, you should try the following window.top.close(); or window.self.close();
0.888889
If there are any errors, it should show up in the console log
Log In / Sign Up on Splash screen?
Is it common to include Login / Sign Up actions on an app's splash screen? Or is it more efficient to first have a Splash screen, and then follow with a dedicated Log In / Sign Up page?
I would suggest skipping the splash screen, as this will only delay the user. The answer to your login/signup question depends on the requirements of your application. Here are the various ways it could be done. If authentication is required to access any content on the application, because it will not function without it, then have a dedicated login/signup as your first screen. If login is only required for some of your applications features, then I would drop the user directly into your application. When a user attempts to use a feature where authentication is required, then ask them to login/signup.
1
How to skip splash screen?
Does the Canon *.CR2/CRW format contain "truly RAW" data?
In my work I am dealing with *.CR2 raw images taken by a Canon DSLR in raw mode. When I read about the format here, I was surprised to find that it has 4 TIFF IFDs which contain a) Original Size JPEG Image b) Thumbnail JPEG image c) Uncompressed RGB data d) Lossless JPEG image. My impression until now was any camera captured RAW image file would have Raw Bayer Data i.e. R,Gr,B,Gb kind of bayer data, and some EXIF data about camera capture settings etc. But after reading this CR2 specification I am slightly confused as to how can it have a RGB data or even surprisingly JPEG data. This seems to be the data after demosaicing(obtaining the missing R/G/B pixel data for the original sensor Bayer pattern). If thats the case I would not consider *.CR2 as "truly raw" data. It has done demosaicing before dumping the socalled raw file. Am I missing something? Does any other Camera Raw formats(e.g. Nikon - *.NEF, Kodac - *.kdc, Pentax - *.ptx/pef,...) have real raw bayer data without any processing done?
I think you are most definitely missing something. Consider: JPG is used to store (and usually compress, lossy) images. Any image. What is an image? It is a great big bundle of pixels, when all is said and done. The output from the camera sensor is a great big bundle of pixels, too. They just happen not to be full-colour RGB pixels, they are monochrome pixels - whether any individual pixel represents R G or B depends on its location on the image sensor, which is known. But their monochrome, colour-given-by-position nature does not mean that they cannot be usefully stored in the JPG way. A bundle of pixels is a bundle of pixels, and why reinvent the wheel? Look more closely at the document. "So with a BAYER grid of RG/GB, the even rows has interleaved HuffCode/Diff data for ...RGRGRG..., while the odd rows it is ...GBGBGB...". So, the raw Bayer output is stored in a JPG format. Lossless, it is stated (otherwise we'd have a problem!) and presumably in more than 8 bits' depth. You have too cook this quite a lot to get a useful photo from it. The other JPG images are used for in-camera preview, histogram and such. It makes good sense to cook these once and for all as the image is taken, rather than having to do it on the fly each and every time you want to look at them. This also means that the computer can fish these out for thumbnail purposes once you unload the camera into the PC. * I can't add a comment for some reason, so this goes here: Goldenmean, what makes you think that there is a problem that you don't have full RGB info for each pixel? Assuming that you are creating a RAW format and have a measurement of 128 from a "red" sensor cell; you can either choose to store this as 128,0,0 or 128,128,128 or, of you are feeling clever, 128,"data from next cell", "data from the cell after that" to save some space. Doesn't matter really. It's the RAW converter's job to keep track of this (though I'm sure the programmers would appreciate it if you documented how you chose to store your sensor data) and make an actual picture from it.
0.888889
What is an image? What is a bundle of pixels?
What is the best introductory Bayesian statistics textbook?
Which is the best introductory textbook for Bayesian statistics? One book per answer, please.
I found an excellent introduction in Gelman and Hill (2006) Data Analysis Using Regression and Multilevel/Hierarchical Models. (Other comments mention it, but it deserves to get upvoted on its own.)
1
Gelman and Hill (2006) Data Analysis using Regression and Multilevel/Hierarchical Models
sharing state between different controllers in angular
I have two controls : Left Side Navigation and the right pane that changes the content on clicking of any item on left navigation. Here is the html (angular view): <nav class="navigation"> <ul class="list-unstyled" ng-controller="NavigationController as navigation"> <li ng-repeat="nav in navigation.tabs" class="has-submenu"> <a href="#" ng-click="navigation.changeContent(nav.name)">{{nav.name}}</a> <ul class="list-unstyled" ng-show="nav.subNav"> <li ng-repeat="subnav in nav.subNav"><a href="#" ng-click="navigation.changeContent(subnav.name)">{{subnav.name}}</a></li> </ul> </li> </ul> </nav> <section class="content" ng-controller="ContentSwitcher as content"> {{content.tab}} <div class="warper container-fluid" > <div class="container-scroll"></div> </div> </section> And here is the controller (function () { var app = angular.module('provisioning', []); app.service('contentService',function(){ var tab = 'Dashboard'; return { getTab : function(){ return tab; }, setTab : function(value){ tab = value} } }); app.controller('NavigationController',['contentService','$log', function(cs,log){ this.tabs = [ { name: 'Dashboard' }, { name: 'Manage', subNav: [ { name: 'Account' }, { name: 'Facility' }, { name: 'Doctors' }, { name: 'Patients' }, { name: 'Nurses' }, { name: 'Device Inventory' } ] }, { name: 'Health Tracker' }, { name: 'Reports' }, { name: 'Settings' }, { name: 'Logout' } ]; var template = this; this.changeContent = function(tab){ cs.setTab(tab); } }]); app.controller('ContentSwitcher', ['contentService',function(cs){ this.tab = cs.getTab(); }]); })(); Also, is it best way to achieve what I intend to do in angularjs? I created a service and shared the variable in the two different controllers. However it doesn't work. The content on right never gets updated on clicking any of the item on left menu.
My answer to a previous question may help. It uses a type of observer pattern. AngularJs update directive after a call to service method Your service would change to allow all interested controller or directives to either generate or listen for certain events and access the associated data.
0.833333
AngularJs update directive after service method
What to do about students who ask for help too often?
For my writing courses, about 5% of students will come to me prior to deadlines asking for help with their paper. I see no problem advising students, as I often similarly came for help when I was an undergraduate. Recently, though, I found an increase in students who apparently just want to abuse this: Students will bring me some plagiarized work, showing it to me early, as a sort of test if I will notice. It seems difficult to punish plagiarism when the paper is not yet submitted. Students will bring in papers again and again, with little changes put in at each stage, hoping their minimal effort each time will be sufficient to reach their goal of a "D". I've tried stopping students, but then they are angry when they see the "F" that they hoped I would help them get away from. While most of these students are probably just incredibly lazy, there is a chance that some among them are genuinely trying to improve, but just struggling a great deal, and I can't see it. How might I go about blocking such abuses?
If you see something definitely plagiarized, you could try to get them to claim it as theirs when they consult you and fail them on the spot for making the claim whether it's in class or not. I do agree with @DaveClarke that on this or the other issue, announcing a policy at the start of the term (no more than N consults per assignment/per term, and plagiarism is an automatic F and will also be referred to the school's academic conduct team) would help set expectations, cut down on abuse, and give you grounds to say "No, it wouldn't be fair to others if I helped you again before you turn it in."
0.888889
If you see something definitely plagiarized, you could try to get them to claim it as theirs when they consult you .
Delay in debt appearing on credit card statement
We charged hospital fees totalling $2400 on a St George Bank credit card on 17 and 21 April 2014. The hospital was located in Denpasar Bali. On last checking the amount owed on the card (12/05/2014) in Sydney, we were advised that no account from the hospital has appeared. It is now three weeks since the transaction occurred and still there is no indication from St George bank that any money is owed them in relation to the hospital fees. Does anyone have a possible explanation for what might have occurred.
If the hospital is run like hospitals in the US it can take a long time just to determine the bill. The hospital, Emergency room, ER doctors, surgeons, anesthesiologists, X-Ray department, pharmacy and laboratory are considered separate billing centers. It can take a while to determine the charges for each section. Is there an insurance company involved? When there is one involved it can take weeks or months before the hospital determines what the individual owes. The co-pays, coverages, and limits can be very confusing. In my experience it can take a few months before the final amount is known. You may want to call the hospital to determine the status of the bills.
0.888889
Is there an insurance company involved?
Interacting with openCPU
I've stumbled across an awesome open source project called openCPU.org and I'm tremendously excited about the project. As a research scientist trying to create a website hosting my work, I would love nothing more than to be able to run R on the cloud to have my scripts run in real time and show up on my webpages. So a big time thanks to Jeroen for making this project happen. With that, onto my question. How the heck do I interact with openCPU? I can put an example function into "run some code" at: http://public.opencpu.org/userapps/opencpu/opencpu.demo/runcode/ And retrieve a PNG image of my code, which is great! But how do I do that in my own webpage, or via a URL? I can get the object of my original code upload from this page, something like: "x3ce3bf3e33" If it is a function similar to: myfun <-function(){ x = seq(1,6.28) y = cos(x) p = plot(x,y) print(p) # also tried return(p) } Shouldn't I be able to call it via: http://public.opencpu.org/R/tmp/x3ce3bf3e33/png What about with input variables? e.g.: myfun <-function(foo){ x = seq(1,foo) y = cos(x) p = plot(x,y) print(p) } I feel that perhaps there is something I am missing. How do I specify "GET" or "POST" with the url? EDIT Ok in response to @Jeroen below, I need to use to use POST and GET with the API. Now my question is extend to the following issue of getting PHP to interact with it correctly. Say I have the code: <?php $foo = 'bar'; $options = array( 'method' => 'POST', 'foo' => $foo, ); $url = "http://public.opencpu.org/R/tmp/x0188b9b9ce/save"; $result = drupal_http_request($url,$options); // drupal function ?> How do I then access what is passed back in $result? I am looking to get a graph. It looks like this: { "object" : null, "graphs" : [ "x2acba9501a" ], "files" : {} } The next step will be to GET the image, something along the lines of: $newurl = "http://public.opencpu.org/R/tmp/".$result["graph"]."/png"; $image = drupal_http_request($newurl); echo $image; But I don't know how to access the individual elements of $result? EDIT #2 Ok guys, I've gotten this to work, thanks to the answer below and to multiple other help sessions, and a lot of smashing my head against the monitor. Here we go, done with cURL <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://public.opencpu.org/R/tmp/x0188b9b9ce/save'); curl_setopt($ch, CURLOPT_POST, 1); // Method is "POST" curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Returns the curl_exec string, rather than just Logical value $result = curl_exec($ch); curl_close($ch); $new = json_decode($result,true); // $result is in 'json' format, decode it $get = $new['graphs'][0]; // the 'hashkey for the image, "x2acba9501a" above $img = 'http://public.opencpu.org/R/tmp/'.$get.'/png'; // link to the png image echo <<<END // use this to display an image from the url <a href="$img"> <img src="$img"> </a> END ?>
OpenCPU uses HTTP POST to execute functions, and HTTP GET to read/render objects and graphs. You could start with saving your function to the temporary store, and then calling it from there. A basic example is given in the "/R/tmp API" chapter of the interactive manual. If you click the red demo buttons named save a function, get the function and call the function it will work you through the steps. Basically in the first step you do a HTTP POST to the identity function to save your function in the store. This is also what is being done in the third form of the running code example page that you found. So I just copied your code there and then it returned me the object x0188b9b9ce. To inspect if everything went OK, you can then read this object using HTTP GET. For example, open this url to read the source code of your function: http://public.opencpu.org/R/tmp/x0188b9b9ce/ascii Alternative outputs are for example to get the function as an RData file: http://public.opencpu.org/R/tmp/x0188b9b9ce/rda Important is that HTTP GET never executes functions. It just looks stuff up, and returns it in the output format that you requested. So now that you're convinced your function is there in the store we want to run it. To do this you need a HTTP POST again. For example to obtain a PDF, you can do POST http://public.opencpu.org/R/tmp/x0188b9b9ce/pdf POST http://public.opencpu.org/R/tmp/x0188b9b9ce/svg POST http://public.opencpu.org/R/tmp/x0188b9b9ce/png If the function you calling takes arguments, you include them as parameters to the HTTP POST request. When you want to include the output in your webpage, usually you only want to use HTTP POST in combination with the /save output type. So you would use jquery or whatever to do: POST http://public.opencpu.org/R/tmp/x0188b9b9ce/save Which might return something like this: { "object" : null, "graphs" : [ "x2acba9501a" ], "files" : {} } This indicates that your function has been executed successfully, and it created a plot (yay!). The graphic was saved to the tmp store. So you can now obtain the graphic and embed it in your page using HTTP GET: http://public.opencpu.org/R/tmp/x2acba9501a/png http://public.opencpu.org/R/tmp/x2acba9501a/png?!width=900&!height=500 http://public.opencpu.org/R/tmp/x2acba9501a/pdf http://public.opencpu.org/R/tmp/x2acba9501a/svg
0.777778
OpenCPU uses HTTP POST to read/render objects and graphs
How can I enable HttpOnly cookies in EE
Update: Thanks to Dom Stubbs, I have an extension to accomplish this now. It is up on devot-ee and also up on GitHub. Thanks Dom! The Original Question I am nearly through a security review of a new EE2 version of an existing EE1 site that I hope to launch soon. One of the final issues remaining is to make the cookies HttpOnly. I've tried doing that through this line in the apache config: Header edit Set-Cookie "(?i)^((?:(?!;\s?HttpOnly).)+)$" "$1; HttpOnly" Using the dev tools in my browser I can see that it does indeed append HttpOnly to the Set-Cookie headers, but the issue then becomes that I cannot log in. When I asked Ellislab they tell me that the cookies should not be being dealt with in javascript, which was what I expected the issue might be. ExpressionEngine does not seem to use the session libraries from codeignitor, if it did I could set a config variable to turn httponly on, but it looks like the session handling code is in the expressionengine side of things. The real question that I need answered is how can I make HttpOnly cookies work, but I guess that breaks down into some potential subquestions: Am I missing an addon that would allow me to do this without a lot more heartache?Is there something wrong with my apache approach? Are you able to log in if you enable that in Apache, log out and try to log back in? Is there something wrong with my apache approach? Are you able to log in if you enable that in Apache, log out and try to log back in? Failing these, can anybody give me a hint as to where cookies are being set in expressionengine so I can dig in there and try to fix this?
For anyone else coming across this, ExpressionEngine 2.8.0 introduced a new config variable for httponly cookies, and it's set to 'yes' by default: http://ellislab.com/expressionengine/user-guide/general/system_configuration_overrides.html#cookie-httponly-config
0.666667
config variable for httponly cookies set to 'yes'
Many POST requests to /xmlrpc.php from GoogleBot taking down server?
I have several hosted wordpress blogs, and I've been trying to visit them and they are really slow. I looked at my server logs and I found this stanfordflipside.com:80 188.138.33.149 - - [17/Aug/2013:17:14:28 -0700] "POST /xmlrpc.php HTTP/1.1" 200 595 "-" "GoogleBot/1.0" stanfordflipside.com:80 188.138.33.149 - - [17/Aug/2013:17:14:28 -0700] "POST /xmlrpc.php HTTP/1.1" 200 595 "-" "GoogleBot/1.0" stanfordflipside.com:80 188.138.33.149 - - [17/Aug/2013:17:14:28 -0700] "POST /xmlrpc.php HTTP/1.1" 200 595 "-" "GoogleBot/1.0" stanfordflipside.com:80 188.138.33.149 - - [17/Aug/2013:17:14:28 -0700] "POST /xmlrpc.php HTTP/1.1" 200 595 "-" "GoogleBot/1.0" stanfordflipside.com:80 188.138.33.149 - - [17/Aug/2013:17:14:29 -0700] "POST /xmlrpc.php HTTP/1.1" 200 595 "-" "GoogleBot/1.0" stanfordflipside.com:80 188.138.33.149 - - [17/Aug/2013:17:14:29 -0700] "POST /xmlrpc.php HTTP/1.1" 200 595 "-" "GoogleBot/1.0" stanfordflipside.com:80 188.138.33.149 - - [17/Aug/2013:17:14:29 -0700] "POST /xmlrpc.php HTTP/1.1" 200 595 "-" "GoogleBot/1.0" stanfordflipside.com:80 188.138.33.149 - - [17/Aug/2013:17:14:29 -0700] "POST /xmlrpc.php HTTP/1.1" 200 595 "-" "GoogleBot/1.0" stanfordflipside.com:80 188.138.33.149 - - [17/Aug/2013:17:14:31 -0700] "POST /xmlrpc.php HTTP/1.1" 200 595 "-" "GoogleBot/1.0" stanfordflipside.com:80 188.138.33.149 - - [17/Aug/2013:17:14:31 -0700] "POST /xmlrpc.php HTTP/1.1" 200 595 "-" "GoogleBot/1.0" stanfordflipside.com:80 188.138.33.149 - - [17/Aug/2013:17:14:31 -0700] "POST /xmlrpc.php HTTP/1.1" 200 595 "-" "GoogleBot/1.0" I am getting ~10 hits per second to the file /xmlrpc.php from the GoogleBot to several sites, and this seems to be slowing down the server. I am running tail -f on the log file, and can just see these requests continuing. Does anyone know why this might be happening or what you could do to stop it?
I would block the IP with iptables if it were me, and if you have that kind of server level access. You could also disable xmlrpc. Unfortunately, since 3.5 the admin screen option to disable that feature has been removed. A single line of code should disable it though: add_filter( 'xmlrpc_enabled', '__return_false' ); That might save some overhead from the requests, though it won't eliminate all of it.
1
xmlrpc disables admin screen
What do percentages mean on a BF3 server description?
I am a bit behind the curve, and just started playing BF3. I played BFBC2, and liked it, and enjoy what I see so far in BF3. The new server setup confuses me though. Since it appears that there are no more 'standard' servers (think BC2 or even most other games on the xbox like Halo or CoD), you can see a list of all of these 'public' shared servers, with odd descriptions. One thing I noticed a lot through them was people saying '500% on [map name]'. I was very unsure of what this meant. I was in an awesome match last night, and after dying once, I was kicked. I had no clue what for. Because I had just selected 'quick match' I was unsure of any server rules. I would like to understand what hosts are meaning by their description.
It means 500% increase in tickets per round. It essentially makes the rounds last longer because there are more tickets. See this for more details on how tickets work: http://www.battlefield.com/uk/battlefield3/blog/battlefield-3-battleblog-11
0.888889
500% increase in tickets per round
Should I include high school details in Grad School Resume?
I was wondering if I should include my high school details in the resume of my graduate school application ? It's unclear about this bit since we are not actually submitting any proof of high school records during grad school application( they only ask for undergraduate details). But my high school final examination details are particularly good (better than my undergraduate credentials infact!)
No You already explain why: they only ask for undergraduate details. The graduate school admission committees already have too many applications to look at. Donโ€™t over-load them Your idea is actually counter-productive. If your high school record is better than your undergrad credentials, they would wonder why your academic achievement is regressing instead of progressing.
1
Why is your high school record regressing?
Word for a result/achievement so exceptional that it is impossible?
I am looking for a word or phrase regarding something that is "impossible". I can't seem to put my finger on it, but I am trying to think of the word to describe something that is the top of the top, and thus impossible to achieve? The only two words I have come up with are elusive and formidable, neither of which really mean what I want them to mean. I want something more clever to put it plainly.
Unattainable Not able to be reached or achieved: an unattainable goal
0.888889
Unattainable Not able to be reached or achieved
Why don't spinning tops fall over?
One topic which was covered in university, but which I never understood, is how a spinning top "magically" resists the force of gravity. The conservation of energy explanations make sense, but I don't believe that they provide as much insight as a mechanical explanation would. The hyperphysics link Cedric provided looks similar to a diagram that I saw in my physics textbook. This diagram illustrates precession nicely, but doesn't explain why the top doesn't fall. Since the angular acceleration is always tangential, I would expect that the top should spiral outwards until it falls to the ground. However, the diagram seems to indicate that the top should be precessing in a circle, not a spiral. Another reason I am not satisfied with this explanation is that the calculation is apparently limited to situations where: "the spin angular velocity $\omega$ is much greater than the precession angular velocity $\omega_P$". The calculation gives no explanation of why this is not the case.
The point is that conservation principles are not generally intuitive. For example, why should energy be conserved? One must have a grip of the dynamics involved in order to understand them. Anyway, the precession of the spinning top doesn't have to do with the conservation of angular momentum. It has to do with the strange nature of torque and its interaction with angular momentum. When a force acts on a spinning top, it excerpts a torque perpendicular to the plane defined by the axis of the top and the direction of gravity, which is a vertical plane. That direction is horizontal. On the other hand, the torque is the rate of change of angular momentum. That means that the direction of the torque is the direction towards which the vector of angular momentum changes. Thus, since the torque is horizontal and perpendicular to the angular momentum, it can only change the direction of angular momentum along the horizontal direction and not towards the ground. That means that the vector of angular momentum has its back on the ground, at the point that the tip of the top touches the ground, and its head is performing a circle on a plane that is parallel to the ground. That motion is the precession of the spinning top. Finally, I think that the reason for assuming a much faster rotation than precession for the top, is to simplify the calculations and consider the top as a gyroscope.
0.777778
Why should energy be conserved?
Using sketch to find exact value of trigonometric expression
Use sketch to find exact value of $\tan (\cos^{-1}\dfrac{5}{13})$ I drew a right triangle with angle $\theta$ and sides $12,5,3.$ If $\cos \theta=\frac{5}{13},$ then $\sin \theta = \frac{12}{13}$ and $\tan \theta = \frac{12}{5}.$ This isn't correct since tangent is greater than one. How would I solve this correctly? (Please show steps) Thanks.
Print it and give it to your teacher. Or send him this link. Answer is $\pm\frac{12}{5}=\pm 2.4$
0.888889
Print it and give it to your teacher or send him this link
I want to travel to the USA while working remotely for my non-US employer
I would like to travel in the USA for a period of 3 - 6 months. But I want to spend some time working for my employer (remote work) and getting paid by the employer. Is this possible under a tourist visa (B1/B2)? I hope this is OK since I will not be getting paid by a US employer. I am in the IT trade so all that I will be needing is my own laptop and a connection to the internet. The money I earn would actually help me pay for the expenses I get during the holiday.
Tourist visas do not allow you to work as employed in the issuing country. But, they do not prohibit you from doing your 'home' work while on vacation. So anyone from anywhere who is working on their laptop or smartphone while on short or long vacation is not under any penalty. You can do your work/ personal stuff there, as long as your employment i.e. employer-employee relationship has no direct legal, financial bindings with the destination country of tourism. PS: For all technical purposes, you are not going to work in the US, even if you are remotely working for your German employer. It is stupid for you to mention that. Why? What is your intended relationship with US/ US Consulate/ US Visa - as a tourist.. right..? Whether you go there and check your Germany work email or do some presentations remotely for your Germany company or take up a dance class for a few weekends, it is outside of the domain of your relationship with the US.
0.888889
What is your intended relationship with US/US Consulate/US Visa - as a tourist
"I wanted you to know that ..." is it mean or offensive
I am not a native English speaker. I am writing an email to my boss and I want him to know an important thing, so will it be ok to say "I wanted you to know that ...", it is offensive/mean etc in any sense ?
I don't find it offensive or mean. If you wanted to soften the language somewhat, though, you could use: I wanted to let you know that ... NOAD defines that idiomatic phrase as: let someone know inform someone You could also avoid the use of the word you by saying: I just wanted to say that... which often implies that you are simply passing some information along.
1
NOAD defines that idiomatic phrase as: let someone know inform someone
A alternative to install pairtaghighlighter for geany 1.23.21
I prove to install this plugin following the instructions of this post: HTML pair tag highlight alternative for Geany editor on Ubuntu 14.04 but, when I write sed -i 's/1.24/1.23/' wscript it says me this: fatal: destination path 'geany-plugins' already exists and is not an empty directory. What can I do? after ./waf configure --enable-plugins=pairtaghighlighter it appears me this: Setting top to : /tmp/geany-plugins Setting out to : /tmp/geany-plugins/_build_ Checking for waf version in 1.6.1-1.7.0 : ok Checking for 'gcc' (c compiler) : /usr/bin/gcc Checking for program pkg-config : /usr/bin/pkg-config Checking for 'gtk+-2.0' >= 2.16.0 : not found The configuration failed (complete log in /tmp/geany-plugins/_build_/config.log)
This has nothing to do with sed -i 's/1.24/1.23/' wscript. This is an error message from Git. You start the command git clone https://github.com/geany/geany-plugins.git several times. Then Git complains. Example: $ git clone https://github.com/geany/geany-plugins.git Cloning into 'geany-plugins'... remote: Counting objects: 15302, done. remote: Compressing objects: 100% (15/15), done. remote: Total 15302 (delta 1), reused 0 (delta 0), pack-reused 15287 Receiving objects: 100% (15302/15302), 14.59 MiB | 1.17 MiB/s, done. Resolving deltas: 100% (8708/8708), done. Checking connectivity... done. $ git clone https://github.com/geany/geany-plugins.git fatal: destination path 'geany-plugins' already exists and is not an empty directory. Install the gtk2 development library: sudo apt-get install libgtk2.0-dev and again ./waf configure --enable-plugins=pairtaghighlighter
0.777778
Git clones 'geany-plugins' in a directory that is not empty
Tight VNC Server, Ubutu 12.10 and unity desktop
I've done the following but all I get in VNC Viewer is a blank orange screen, any help appreciated. apt-get -y install ubuntu-desktop tightvncserver adduser vnc passwd vnc echo "vnc ALL=(ALL) ALL" >> /etc/sudoers su - vnc vncpasswd exit cd ~ nano .vnc/xstartup #!/bin/sh # Uncomment the following two lines for normal desktop: unset SESSION_MANAGER . /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & x-terminal-emulator -geometry 1280x1024+10+10 -ls -title "$VNCDESKTOP Desktop" & #x-window-manager & save THEN nano /etc/init.d/vncserver THEN paste in the following, then save: #!/bin/sh -e ### BEGIN INIT INFO # Provides: vncserver # Required-Start: networking # Default-Start: 3 4 5 # Default-Stop: 0 6 ### END INIT INFO PATH="$PATH:/usr/bin/" # The Username:Group that will run VNC export USER="vnc" #${RUNAS} # The display that VNC will use DISPLAY="1" # Color depth (between 8 and 32) DEPTH="16" # The Desktop geometry to use. #GEOMETRY="x" #GEOMETRY="800x600" GEOMETRY="1024x768" #GEOMETRY="1280x1024" # The name that the VNC Desktop will have. NAME="my-vnc-server" OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}" . /lib/lsb/init-functions case "$1" in start) log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}" su ${USER} -c "/usr/bin/vncserver ${OPTIONS}" ;; stop) log_action_begin_msg "Stopping vncserver for user '${USER}' on localhost:${DISPLAY}" su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}" ;; restart) $0 stop $0 start ;; esac exit 0 Then ctrl-x to save, Y for Yes, and enter to accept file name. THEN chown -R vnc. /home/vnc/.vnc && chmod +x /home/vnc/.vnc/xstartup sed -i 's/allowed_users.*/allowed_users=anybody/g' /etc/X11/Xwrapper.config THEN chmod +x /etc/init.d/vncserver && service vncserver start THEN update-rc.d vncserver defaults THEN reboot. FINALLY: go in there with tightvnc viewer client, and voila, blank kool aid tangerine orange screen. any help appreciated, of course it's been 3 x 8 hour evenings so far :}
you didn't set gui session for xstartup file, that is why you see blank screen when try try to remotely connect to your desktop/server via vnc on ubuntu, if you want gnome, install these packages # apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal and use this xstartup file #!/bin/sh export XKL_XMODMAP_DISABLE=1 unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & gnome-panel & gnome-settings-daemon & metacity & nautilus & gnome-terminal &
0.777778
Install gnome-panel metacity nautilus on ubuntu
ListBox is selecting many items even in SelectionMode="Single"
I have encountered something very strange, simple WPF application <Window x:Class="ListBoxSelection.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <ListBox ItemsSource="{Binding Path=Strings}" SelectionMode="Single"/> </Grid> </Window> with code behind public class ViewModel { public List<string> Strings { get; set; } public ViewModel () { Strings = new List<string> (); Strings.Add ("A"); // add many items ... Strings.Add ("A"); } } /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow () { InitializeComponent (); DataContext = new ViewModel (); } } and when I click on a single item, if I continue clicking items, they just aggregate. Clicking an already selected item does nothing. Scratching my head, I have databound lists to ListBoxes before, and have never seen this before. Running Win7 (64), VS2010, behaviour presents with .Net 3.5, .Net 3.5 Client Profile, .Net 4, and .Net 4 Client Profile. Arg, I should mention I am expecting normal, default, single-select behaviour.
Dan Bryant got most of the answer in his comment. What's going on here is string interning. When you create a bunch of strings with the same value, .Net saves on memory usage by having all references to the same string value actually refer to the same string object. (See this, for instance, for details.) I don't really know why the ListBox behaves exactly the way it does, which is that the first time you select any item in the list, it selects both that item and the first item in the list. But it doesn't unselect when you click on a new item because checks to see if the SelectedItem is different from the item you just clicked on, and it isn't. I got exactly the same behavior by binding a ListBox to a collection of test objects: public class TestObject { public override string ToString() { return GetHashCode().ToString(); } } In MainWindow.xaml: <ListBox x:Name="MyListBox" ItemsSource={Binding}"/> In MainWindow.xaml.cs: ObservableCollection<TestObject> test = new ObservableCollection<TestObject>(); TestObject t = new TestObject(); test.Add(t); test.Add(t); test.Add(t); test.Add(t); test.Add(t); test.Add(t); MyListBox.DataContext = test;
0.888889
What's going on with string interning?
Interface options for specifying language prettify
I'm the maintainer for Google Code Prettify. Markup authors can specify the language for source code, but not markdown authors. Are the SO admins interested in a way of doing this? If so, might the following work If the first line is "#!" followed by one or more word characters, then make the first line invisible (using CSS hidden:visible) and use those word characters as the file extension. Otherwise, use the current scheme. So #!css tag.class#id { color: red } would be recognized as CSS. In markdown, should any indicator of line numbers survive copy-paste in markdown? Does any scheme like this need to do work to handle quoting of responses in markdown? Is it common for inline responders to split code sections? Do users also want to number lines ( http://google-code-prettify.googlecode.com/svn/trunk/README.html#linenums ), so that others can respond with reference to particular lines?
Syntax Highlighting with โ€œCode Prettifyโ€ This is now implemented. See Stack Overflowโ€™s help on Syntax Highlighting. Specifying a language for syntax highlighting Besides tag inferences (a recent change), you can manually specify a language as a hint to Google Code Prettify. Hereโ€™s how: <!-- language: ยซlang-or-tag-hereยป --> ยซcode goes hereยป ยซmore textยป <!-- language: ยซlang-or-tag-hereยป --> ยซcode goes hereยป You may use either a tag or a prettify language code. Prettify language codes are guaranteed to work, regardless of what language the tag happens to be set to. Available Language Hints Moved Due to several lists of available hints existing throughout Meta, the entire list has been consolidated and moved to the following FAQ: What is syntax highlighting and how does it work?
0.777778
What is syntax highlighting and how does it work?
Why was the winner of the AES competition not a Feistel cipher?
The winner of the AES competition has a structure that does not qualify as a Feistel cipher, as explained in answers to this recent question. However, most many of the AES candidates, and all 3 out of 4 some other finalists (Twofish, MARS) are Feistel ciphers, if we define that as a cipher transforming a block of data using a number of rounds which each can be expressed as: split all the bits of the block $B_j$ into two disjoint portions $L_j$ and $R_j$ (typically of equal size); compute some (typically round-dependent) function of $R_j$ and key with output $F_j$ of same width as $L_j$; compute $L_j'=L_j\oplus F_j$ where $\oplus$ is binary addition with removal of some carry bits (e.g. exclusive-OR, where all carry bits are removed); recombine bits of $L_j'$ and the unmodified $R_j$ into a new block $B_{j+1}$. Note: Serpent and RC6 can not be put in this framework (thanks to @Reid and @J.D. for pointing that). Neither can Rijndael/AES. At the time of the AES competition, Feistel ciphers already enjoyed a well understood theory. In particular DES was among them, and essentially unbroken in practice except for its small key and block size. It would seem that proposing anything else than a Feistel cipher would be an uphill battle. Yet, Rijndael won the AES competion, and does not fall under the above definition. Did a desirable characteristic of Rijndael made it preferred to the other candidates despite the apparent drawback of using a relatively untested structure? And if that characteristic could not be matched by a Feistel cipher, why?
As a page at ibm.com indicates, there could have been a bit of a "contra" attitude against Feistel ciphers thanks to DES having seen the first breaks in it's security etc. Down with the Feistel structure! In most ciphers, the round transformation has the well-known Feistel structure. In this structure typically part of the bits of the intermediate State are simply transposed unchanged to another position. (An example of this linear kind of structure are those tables we discussed back in the DES discussion that substitute bits by a fixed tabular means.) The round transformation of Rijndael does not have this venerable Feistel structure. Instead, the round transformation is composed of three distinct invertible uniform transformations, called layers. ("Uniform" here means that every bit of the State is treated in a similar way.) The linear mixing layer guarantees high diffusion over multiple rounds. The non-linear layer uses parallel application of S-boxes that have the desired (hence optimum) worst-case nonlinearity properties. The S-boxes are non-linear. That's the key conceptual difference between DES and Rijndaelโ€ฆ So, I guess one of the reasons they chose a non-Feistel cipher could well have been that they wanted to guarantee higher security through higher diffusion etc. while hoping that โ€” in case Feistel ciphers should collapse sooner than expected โ€” the next crypto they were about to recommend wouldn't automatically join in and break down too. Serpent for example was designed so that all operations can be executed in parallel, using 32 1-bit slices. While this maximizes parallelism, it also allowed immediate use of the extensive cryptanalysis work performed on DES. A good reason not to give Serpent that final go and prefer "something else" (most probably because Serpent's origins were too close to a theoretically broken Feistel โ€” DES). This would also go in canon with what @thomas-pornin mentioned in the first lines of his great answer.
1
Non-Feistel ciphers have a well-known Feistel structure
Create Valid XML from XSD Loaded at Runtime (without xsd.exe)
Possible Duplicate: Programmatically Create XML File From XSD XML instance generation from XML schema (xsd) How to generate sample XML documents from their DTD or XSD? Here's the scenario: I've created an application that hooks into a commercial CRM product using their web service API, which unfortunately has a different schema for every installation, based on how the users create their custom fields. This schema can also be modified at any time. This application will be installed at the customer location, and will need to function even when they change their field structure. In order to insert or update a record, I first call their Project.GetSchema() method, which returns the XSD file based on the current set of fields, and then I can call the Project.AddProject() method, passing in an XML file containing the project data. My question is: What's the best way to generate the XML from the XSD file at runtime? I need to be able to check for the existence of fields, and fill them out only if they exist (for instance, if the customer deleted or renamed some fields). I really don't want to have the application attempting to recompile classes on the fly using xsd.exe. There simply must be a better way. [update] My current solution, that I'm working on, is to basically parse out the XSD file myself, since the majority of the schema is going to be the same for each installation. It's just an ugly solution, and I was hoping there was a better way. The biggest problem I have is that their schema uses xsd:sequence, so putting things in a different order always breaks validation.
For others that wound up here: the best solution given the constraints, create XML at runtime and using .NET, is probably the first link: Is there a class to generate a sample XML document from XSD schema in .NET At least, that's what I am going to try :).
1
Is there a class to generate a sample XML document in .NET?
Is Cyrus the Messiah?
What are the actual words used for Isaiah 44:28 to describe his anointed? Why do most Bible translation translate that as shepherd? I've heard the Masoretic Text uses "messiah" and the Septuagint uses "Christ". The English translation uses the word "shepherd," which seems like lying or filtering. Why the discrepancy? I stumbled upon some atheist sites and found this. Translating a word like Christ into shepherd seems very misleading. I also came across this discussion about this on the web.
The original Hebrew word being used here is ืจึนืขึดื™ (roยท'i),[1][2], which does indeed translate as "shepherd" according to Strong's Concordance.[3][4]
0.888889
Hebrew word "shepherd"
finding control in winforms panel
I need to find a child control in a winforms panel. I was wondering if there is a method similar to Panel.FindControl() of the asp.net webforms panel in the .net winforms version
You can achieve like this: mypanel.Controls.Find("mycontrolname",true); The documentation is here: Control.ControlCollection.Find Method
0.666667
Control.ControlCollection.Find Method
Why are my recovered images only 160x120 pixels?
I am trying to recover some lost images, and with all the programs I've tried, some of the photos resulted to be in a 160x120 pixel resolution. What does this mean, and is there any possibility to recover photos in original dimensions? Any help is appreciated.
The recovered images might be the thumbnails and not the actual images. Some of the image programs or browsers create the thumbnails from the actual images for displaying in the GUI. If you know any other attributes that might ascertain that the recovered image were, indeed, the actual images (location etc) then you may wish to investigate further.
0.777778
The actual images are the thumbnails and not the actual images
Session Fixation - Setting path to root without /
I have found an XSS vulnerability on the subdomain of a site I am testing, and using it I can set cookies for both the main site and all it's subdomains. My url currently looks like this: http://s1.example.com/u/%22%3E%3Cmeta%20http-equiv=Set-Cookie%20content=%22sid=1234;%20path=/;%20expires=Thursday,%2020-May-15%2000:15:00%20GMT;%20domain=example.com%22%3E The issue is that for some reason or another, the character "/" is filtered out (no other characters are), meaning that although I can set cookies to the main site and all it's subdomains, I can only set them to the path /u/ as that is where the attack is launched from on the subdomain. Is there any way to set the path to / without actually using the /? Thank you very much for any help!
Remove the whole %20path=/ section - the HTTP response header should set everything at root level. If that doesn't work inside a meta http-eqiv, try the HTML encoded version of the path as because the content is in HTML should be correctly decoded (/). Alternatively you could inject JavaScript to set the cookie via client-side script and set the path via entity encoding (\x2f).
1
Remove the whole %20path=/ section
hide javascript/jquery scripts from html page?
How do I hide my javascript/jquery scripts from html page (from view source on right click)? please give suggestion to achive this . Thanks.
It's virtually impossible. If someone want's your source, and you include it in a page, they will get it. You can try trapping right click and all sorts of other hokey ways, but in the end if you are running it, anyone with Firefox and a 100k download (firebug) can look at it.
0.888889
Firefox and 100k download (firebug)
Probability of a certain result obtaioned by throwing an octahedron
Assume having a fair octahedron. We throw it $93$ times and get the following results: $\{33;7;8;1;2;0;5;37\}$ The numbers represent how many times the die fell on side $1, 2,...., 8$. What is the probability we got such a result?
Use multinomial distribution with $p_i = 1/8$, $n=93, n_1 = 33, n_2 = 7, n_3 = 8, n_4 = 1, n_5 = 2, n_6 = 0, n_7 = 5, n_8 = 37$ for i = 1 to 8. The required prob = $$\frac{93!}{33!\cdot7!\cdot8!\cdot1!\cdot2!\cdot0!\cdot5!\cdot37!}\cdot{(\frac{1}{8})}^{93}$$ http://en.wikipedia.org/wiki/Multinomial_distribution
1
Multinomial distribution
display tag and c choose tag
I use the following code. But it is always go to the otherwise condition. I checked the value , and those are correctly passed from java to the jsp. Any missing points? <c:when test="${pCount > 0}"> <display:column class="colPCount" property="pCount " title="${titlePCount}" sortable="true" headerClass="sortable" /> </c:when> <c:otherwise> <display:column class="colPCount" title="${titlePCount}"> - </display:column> </c:otherwise> For the pcount>0 items, still displaying as '-' in the display tag. Even I reverse the checking condition like pCount<0 in the first condition checking, the display tag always show the otherwise condition. It always pointing to the otherwise condition for every value. Edited: Full Code <display:table class="displayTable" id="itemList" name="${sessionScope.itemList}" requestURI="listItem.action" pagesize="15" defaultsort="2" defaultorder="ascending" sort="list"> <display:column class="colItemName" property="name" title="${titleItemName}" sortable="true" headerClass="sortable"/> ... <c:choose> <c:when test="${pCount > 0}"> <display:column class="colPCount" property="pCount " title="${titlePCount}" sortable="true" headerClass="sortable" /> </c:when> <c:otherwise> <display:column class="colPCount" title="${titlePCount}"> - </display:column> </c:otherwise> </c:choose> </display:table>
Try this way: ${itemList.pCount>0}
0.888889
$itemList.pCount>0
Adding price-alert link to category list views
Normally the build in functionality goes just for a single product view as it has no i.e. setProduct() method. I already modded the module so every product can be set from category list/grid template which works as expected. As you shouldn't build your blocks hardcoded inside the template I want to move from a Mage::getSingleton('core/layout')->createBlock('productalert/product_view')->setTemplate('productalert/product/view.phtml') to a simple $this->getChild('productalert_price') call and have the rest inside the layout.xml of the pricealert module. Sadly every handle etc. won't achieve the expected result. For now I have: <default> <reference name="content"> <reference name="product_list"> <block type="productalert/product_view" name="productalert_price" template="productalert/product/view.phtml"> <action method="setHtmlClass"> <value>alert-price link-price-alert</value> </action> <action method="setSignupLabel" translate="value"> <value>Sign up for price alert</value> </action> </block> </reference> </reference> </default>
As you might already figured out: Your problem is, you need a bunch of blocks, not a single one. Because you need for every product your own block. So you either achieve this, by setting the product in the registry (this might be done already by magento, please check) and then just use the product from the registry or you create a block for every product, as you already do. Make sure if you use 1. that you don't save any product specific states in the block!
1
Make sure that you don't save any product specific states in the block
Why are there mobs on my balcony?
I have a sweet ravine balcony, that I've lit up, and partially fenced off. It's not connected to anywhere that mobs could spawn yet, come night zombies are at my door creepers are lounging around and spiders are crawling around! I didn't invite them! Is there any reason for these mobs to spawn here when it's well lit?
If there is a tunnel connecting to the balcony that has some dark areas the mobs you encounter could be spawning there and be walking onto your balcony. If not then creepers could be climbing up the ladders and spiders can climb up walls as you probably know. Or the mobs culd be dropping off an above area to your balcony.
0.555556
If there is a tunnel connecting to the balcony the mobs could be spawning there and be walking onto your balcony
Are there any versions of LQG that claim to not violate Lorentz symmetry?
LQG formulations have a minimum length/area. Since say, a Planck area can always be boosted, any minimum area in space can be shrunk. Do LQG proponents worry about local Lorentz invariance violation, and if not, why not? In LQG, does considering length to be a quantum operator really get rid of the boost problem?
This has been asked and answered before: see Does the discreteness of spacetime in canonical approaches imply good bye to STR? Also, this question has popped up many times on other sites such as physicsforums: http://www.physicsforums.com/showthread.php?t=281951 The answer is roughly that LQG does not in fact violate Lorentz invariance. The discretisation of area and volume operators does not imply a broken symmetry, any more than discretisation of angular momentum states imply breaking of rotational symmetry --- symmetries in quantum theories are equations of the operator algebra, not of the states! See also: http://arxiv.org/abs/1012.1739
1
Does discreteness of spacetime in canonical approaches imply good bye to STR?
Would Esther really have kept silent?
In Esther 7:4 we read ื•ึฐืึดืœึผื•ึผ ืœึทืขึฒื‘ึธื“ึดื™ื ื•ึฐืœึดืฉึฐืืคึธื—ื•ึนืช ื ึดืžึฐื›ึทึผืจึฐื ื•ึผ, ื”ึถื—ึฑืจึทืฉึฐืืชึดึผื™--ื›ึดึผื™ ืึตื™ืŸ ื”ึทืฆึธึผืจ ืฉึนืื•ึถื”, ื‘ึฐึผื ึตื–ึถืง ื”ึทืžึถึผืœึถืšึฐ ... ... But if we had been sold for bondmen and bondwomen, I had held my peace, for the adversary is not worthy that the king be endamaged. Is this true? Had, in fact, the entire Jewish population been sold as slaves Esther would not have said a word about it? Is this simply hyperbole? How do we understand this?
The Meam Loez says that she meant that Achashveirosh shouldn't kill the Jews, as he would thereby lose out. Had the Jews been sold as slaves, Achashveirosh could have always changed his mind later on (once realized how useful the Jews are). However, once they would be dead, he couldn't have done anything.
0.888889
Achashveirosh couldn't kill the Jews if they were sold as slaves .
How does multitasking work
I am completely clueless about the inner workings of an operating system, but I can more or less guess the approximate behaviour of many functions. One thing that I am not able to figure out, though, is multitasking. In theory, the operating system manages time, according the CPU for small intervals to the various programs running. But it is not clear how this really works. Say the operating system wants to start my program. The machine code is loaded somewhere in RAM, starting at a certain address. I guess then a jump should be performed to that address, allowing my code to execute. But in this way, the OS cannot regain control until I jump back. Basically, I can imagine just two ways of making this work, but neither seems really suitable: The operating system could read the machine instructions I want to perform and emulate them instead of executing them directly. I am intentionally vague, since I do not know how this would work, but it seems like it would slow down the program considerably. Alternatively, the operating system could wait until I make a system call. In that moment it regains control and can check how long I have been running and do its timesharing stuff. This may work, but it seems unreliable, as I could make a long calculation which does not involve system calls and hang everything for a while. So, it seems neither mechanism would work very well. How is multitasking actually performed?
Timer interrupts can be generated by computer hardware to interrupt CPU. In this way, based on the scheduling algorithm used by Operating System, OS can decide whether to continue executing your current program or context switch to another one that is ready to run.
1
Timer interrupts can be generated by computer hardware to interrupt CPU
How to separate my rendering from game loop?
If I have a (complex) operation that takes a long time for it to finish, for instance, a couple of seconds, my frame rate drops far below the acceptable. How could I still implement it while it is not messing up my frame rate?
Hrm... My first guess would be multithreading. For example, if you had your logic and render in the main loop, if logic takes a long time, you don't get anything rendered till it is done. With multiple threads, the render can be independant of the logic, and so evedn if the logic is bogged down, stuff still gets rendered, etc. As per how to calculate it every 1/2 seconds, I am sure whatever libraries you are using contain the simple contraption of some sort of timing devices/timers, etc. Or, in the case the logic is threaded by itself, a sleep might also suffice. The problem of ensuring the logic is completed by the time it must next be calculated might be tricky, depending on specifically what you are doing. You could: optimize the logic calculations, thread individual part of the logic (though I haven't actually used threads in a real application, so how to seperate but coordinate the logic, I don't know much on). Alternatively, perhaps you can either set a minimum calculation time (say 0.5 seconds) and give it as much time as it needs, or somehow otherwise coordinate the application to the time it takes.
0.666667
Multithreading if logic takes a long time
What's the best way to generate an NPC's face using web technologies?
I'm in the process of creating a web app. I have many randomly-generated non-player characters in a database. I can pull a lot of information about them - their height, weight, down to eye color, hair color, and hair style. For this, I am solely interested in generating a graphical representation of the face. Currently the information is displayed with text in the nicest way possible, but I believe it's worth generating these faces for a more... human experience. Problem is, I don't know where to start. Were it 2007, I'd naturally think to myself that using Flash would be the best choice. I'd love to see "breathing" simulated. However, since Flash is on its way out, I'm not sure of a solid solution. With a previous game, I simply used layered .PNGs to represent various aspects of the player's body: their armor, the face, the skin color. However, these solutions weren't very dynamic and felt very amateur. I can't go deep into this project feeling like that's an inferior way to present these faces, and I'm certain there's a better way. Can anyone give some suggestion on how to pull this off well?
The way you are thinking to do it is fine. You should drop inhibitions about Flash and just use it. You aren't writing a bank system here, you're writing a single game. Even if it does have a sequel, Flash is still installed on pretty much every computer today. Just a note that the best face generator I've ever come across is facegen. There is a FaceGen SDK. I don't really know what it costs, but I'm guessing it must be in the thousands. Then, you have FaceGen create a face, using your inputted parameters (for eyes spacing, skin color etc - FaceGen can do all that). Then, you render the face to a texture, save it out, and send it over to the other application.
0.888889
The way you are thinking to do it is fine. You should drop inhibitions about Flash
What are the reasons to mix oil & coolant?
Frontal impact vehicle is there fan motor touches the oil cooler,oil cooler slight impact is there, in coolant tank oil and coolant mixed, what are the reasons to mix the coolant and oil in this situation.
It's not unusual for a second radiator to be present behind the main radiator, often to cool the transmission fluid. If these fluids are mixing (water and transmission fluid), then both radiators have been damaged and are leaking their fluids together. Both radiators will need to be removed and repaired. Sometimes coolant will appear in engine oil because the head gasket has 'blown' or broken, allowing coolant to enter the cylinder or oil to enter the water jacket. The repair is to remove the head and replace the head gasket. Sometimes the cause for mixed fluids is a cracked block, in which coolant and/or oil escapes the engine through the crack. The repair is to replace the block because a cracked block cannot be repaired. Normally you'll choose to replace the engine, since it's easier to swap the engine than disassemble an engine to swap its block. Most people would just buy another car. If your car HAS been in an accident, I would first try to identify the two fluids that are mixed. Then I would check first for a cracked block, then check for broken radiators. The third possibility, a blown head gasket, is unlikely to be caused by an accident.
0.888889
If a second radiator is present behind the main radiator, then both radiators have been damaged .
PHP getting cover image from Google Books API
I'm trying to get the image from Google Books service, in the thumbnail. Reading the address in php via file_get_contents get all the web page of the book while I just want to get the cover image. I know that it can be done via the src tag of html img element but I need the image server side. Is there a way? Thanks Here the code I've used: $context = [ 'http' => [ 'method'=>"GET", 'header' => "Accept:image/png\r\nAccept-Language:it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3\r\nCache-Control:max-age=0\r\nConnection: keep-alive\r\nUser-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:33.0) Gecko/20100101 Firefox/33.0\r\n" ] ]; $context = stream_context_create($context); $result = @file_get_contents($bookThumbnail, false, $context);
sounds like you want something like this $dat = file_get_contents('https://www.googleapis.com/books/v1/volumes/H1w9AwAAQBAJ'); $arr = json_decode($dat,1); $info = $arr['volumeInfo']; $imagedata = file_get_contents($info['imageLinks']['thumbnail']); file_put_contents('/images/thumb.jpg', $imagedata); // just to see it $img = imagecreatefromstring($imagedata); header('Content-Type: image/jpg'); imagejpeg($img); imagedestroy($img);
0.888889
$dat = file_get_contents
Robots.txt disallowing URLs
I need to disallow some URLs on my site but I am not sure how to do that. I have a site that has products and reviews. When someone makes a review, the site generates a URL automatically like this: mysite.com/addreview_1.htm mysite.com/addreview_2.htm .... mysite.com/addreview_9999.htm I need some way to disallow all the URLs which will appear in the future.
The original robots.txt specification has no concept of "full" URL. Whatever you specify as value for Disallow is always the start of the URL paths you want to block. For example, see this robots.txt: # robots.txt for example.com User-agent: * Disallow: /foobar.html This will obviously block example.com/foobar.html. But it will also block: example.com/foobar.html?foo=bar example.com/foobar.html.zip example.com/foobar.html.for.example example.com/foobar.html/foo/bar So, in your case you just need: User-agent: * Disallow: /addreview It will block all URLs that begin with the string addreview: example.com/addreview example.com/addreview.html example.com/addreview_1.htm example.com/addreview_9999.htm But it will also block an URL like (letโ€™s assume it exists) example.com/addreviewer, of course. Which may or not what you want (depends on all your URLs you use). So you need to find a part of a starting URL paths that matches to all the URLs you want to have blocked and doesnโ€™t include any others.
1
Disallow is always the start of the URL paths you want to block
Removal of the incoming sms
@Override public void onReceive(Context context, Intent intent) { Bundle bundle = intent.getExtras(); SmsMessage[] msgs = null; if (bundle != null) { Object[] pdus = (Object[]) bundle.get("pdus"); msgs = new SmsMessage[pdus.length]; for (int i = 0; i < msgs.length; i++) { msgs[i] = SmsMessage.createFromPdu((byte[]) pdus[i]); if (msgs[i].getOriginatingAddress().equals( SmsModuleActivity.number)) deleteMessage(context, msgs[i]); } } } private void deleteMessage(Context context, SmsMessage msg) { Uri deleteUri = Uri.parse("content://sms/inbox/"); Cursor c = context.getContentResolver().query(deleteUri, null, null, null, null); while (c.moveToNext()) { try { String pid = c.getString(0); String uri = "content://sms/inbox/" + pid; ContentValues values = new ContentValues(); values.put("read", true); context.getContentResolver().update(Uri.parse(uri), values, null, null); context.getContentResolver().delete(Uri.parse(uri), null, null); } catch (Exception e) { e.printStackTrace(); } } New incoming sms not removed. When I get sms from this number it delete only old sms from this sender, but no new message. I need delete new incoming message from specific number (see source code.)
Use This Code to delete last sms after recieving sms in your first activity class. Dont forget togive sms read and write permission in your mainfest file. Uri uriSms = Uri.parse("content://sms/"); Cursor c = getContentResolver().query(uriSms, new String[] { "_id", "thread_id", "address","person", "date", "body" }, null, null, null); if (c != null && c.moveToFirst()) { long id = c.getLong(0); getContentResolver().delete(Uri.parse("content://sms/" + id), null, null); }`enter code here`
0.555556
Use This Code to delete last sms after recieving them in your first activity class
Conscript won't install - what to do?
I'd like to started with Scalatra. For that, I need to use giter8 to generate a template project. To install giter8, I need to install conscript first. But doing that (at least using the runnable jar on Windows) fails with this error: :::::::::::::::::::::::::::::::::::::::::::::: :: UNRESOLVED DEPENDENCIES :: :::::::::::::::::::::::::::::::::::::::::::::: :: net.databinder.conscript#conscript_2.11;0.4.4: not found :::::::::::::::::::::::::::::::::::::::::::::: This is with the latest conscript version. Doesn't it support scala 2.11 yet? Is conscript even still actively maintained? The mailing list is dead and there's not even a stackoverflow tag. Although I'd prefer to fix the conscript installation issue, is there an easy workaround? Like installing giter8 without using conscript? Or setting up scalatra without using giter8?
I'm not sure if Scala 2.11 is supported in conscript, so that's the first thing I'd try. Scalatra depends pretty heavily on conscript, so we'll need to check it out with 2.11 in Windows - I would imagine you're pretty much the first person who's hit this. You can of course set Scalatra up without using conscript, by manually copying values around, but it wouldn't be very convenient. g8 definitely depends on conscript, I don't think you can have one without the other. The Scalatra crew will need to take a look at conscript and see what's going on here. You may actually want to file a bug on installation so that it gets looked at.
1
Scala 2.11 is supported in conscript, so check it out with 2.11 in Windows
Array of Fibonacci values; Value of high index turns array value into negative
I created an array called numbers that will store values of a Fibonacci sequence. 1, 2, 3, 5, etc. The problem is that when I try to call the array value at a very high index value, the array value becomes negative. numbers[10] = 144 which is reasonable but numbers[9999998] = -1448735941 Any help? public static void main(String[] args) { int[] numbers = new int[10000000]; numbers[0] = 1; numbers[1] = 2; for(int x = 2; x<=numbers.length-1; x++) { numbers[x] = numbers[x-1] + numbers[x-2]; } System.out.println(numbers[9999998]); System.out.println(numbers[10]);
You are experiencing integer overflow. Take a look at BigInteger for one workaround.
0.888889
Integer Overflow
How are pixels actually shown on display
I spend a lot of time looking at raw-video in YCbCr-format. Started thinking about what is really shown on the display and how the pixels end up there. No display can handle YCbCr-data so I guess everything gets converted to RGB somewhere. YCbCr->RGB is however tricky business, see e.g. http://www.fourcc.org/fccyvrgb.php If I do the YCbCr- to RGB-conversion, am I guaranteed that the pixel-values I have are the ones being displayed? Short of getting a hardware-calibrated Eizo-display like the ones shown here: http://www.eizo.com/global/products/coloredge/ is there a way to have as much control as possible over the "pipeline" to the display (i.e. my pixels do not get converted on the way) I'm thinking perhaps nvidia/gpu/opengl and moving everything as close to the HW as possible; then for my graphic-card at least I know what I'm looking at. Is there a RGB-format that is native for graphics card and that doesn't require any further conversion? YCbCr is 8bpp and I'm thinking 32-bit RGB 4:4:4. I'm mainly on an linux-system if that makes a difference. Currently I'm using http://www.libsdl.org/ There's also http://directfb.org/ but I haven't explored that path yet. Or, perhaps all this is just stupid and paranoid :-)
That's a lot of questions, I'll try to answer at least some of them. No display can handle YCbCr-data so I guess everything gets converted to RGB somewhere. All displays use RGB. On LCDs each pixel consists of three subpixels in three basic colors. So you're right, everything must be converted to RGB to be displayed. If I do the YCbCr- to RGB-conversion, am I guaranteed that the pixel-values I have are the ones being displayed? It depends what you mean. You are guaranteed that exact results of the conversion are displayed. So it depends on the results of conversion and those depend on the gamma you're using. is there a way to have as much control as possible over the "pipeline" to the display (i.e. my pixels do not get converted on the way) I'm thinking perhaps nvidia/gpu/opengl and moving everything as close to the HW as possible; then for my graphic-card at least I know what I'm looking at. Once the image is converted to RGB, it's not modified anymore (unless you use f.lux or similar software). It doesn't really matter if it's closer to hardware or not, it's just a bunch of pixels and nothing will modify them after conversion to RGB (unless you ask something to, like with the mentioned f.lux, color correction software or video editing programs that can apply color filters). YCbCr is 8bpp and I'm thinking 32-bit RGB 4:4:4. I think you're mixing few things up or I don't get what you mean. First, 32-bit RGB can't be 4:4:4, because you can't equally split 32 bits to 3 color channels. (10 bits for R, 11 bits for G, 11 bits for B?) 32-bit RGB actually consists of three 8-bit color channels and one 8-bit transparency channel. Videos don't have transparency, so they work with 24-bit RGB. (8 bits for each channel) I don't know how YCbCr is saved in digital format, but I'm sure it's not 8-bit, at least assuming we're talking about total size of a pixel. (if you mean 8-bit color channels, then it's exactly as much as in RGB) 8-bit pixels could hold up to 256 colors. 24-bit RGB is over 16 million colors. Is there a RGB-format that is native for graphics card and that doesn't require any further conversion? So you want raw, uncompressed RGB pixels? Well, there are such picture and video formats, but uncompressed videos take up really A LOT of space. Let's do a quick calculation for a 24-bit 24fps 1080p video: 3B * 1920px * 1080px * 24fps = 149299200B So every second of raw uncompressed 1080p video weights over 140 MB. It means you could have up to 5 and a half minute of video on an industry-standard Blu-Ray disc. Not really a good deal I think ;)
1
Is there a way to convert YCbCr to RGB?
Spice definition of resistor/capacitor
I am trying to understand a Spice definition of a circuit and transient analysis on it. I have kind of "inherited" this and can't ask the original creator; my Spice memories from university are pretty rusty, and online manuals have not been of much help. What I don't understand is the first segment here (snippet of whole file): .define c1 6926.0 6233.4 7618.6 .define r1 0.16661 0.149949 0.183271 .... il 0 98 dc 0 ac 0 pwl (0s 1720.0a ... 6233s 1718.0a 6925s 1728.0a 7618s 1718.0a ....) ... c01 1 0 [c1] ic= 89.974 r01 1 2 [r1] In the third segment, I understand that capacitor c01 is defined as lying between nodes 1 and 0 and has initial conditions as given; resistor r01 is situated between nodes 1 and 2. In the second segment, a piecewise linear current source is defined, with ampere values associated with timestamps. What does the first segment define? The values next to the capacitor seem to be the timestamps from the current source, but why are they used for defining the capacitor/resistor? I can provide other details as needed, but didn't want to clutter the post too much with useless information. EDIT: The suggestion given below in comments is good, but my original question still stands. Is this not standard Spice, since no manual mentions it?
Google search found that Micro-Cap Spice simulator does allow for .define keyword to be used. I understand that .define could be omitted from the code you showed with the following change: il 0 98 dc 0 ac 0 pwl (0s 1720.0a 692s 1726.0a 1385s 1716.0a 2077s 1720.0a 2770s 1726.0a 3463s 1724.0a 4155s 1712.0a 4848s 1720.0a 5540s 1724.0a 6233s 1718.0a 6925s 1728.0a 7618s 1718.0a ....) ... c01 1 0 [6926.0 6233.4 7618.6] ic= 89.974 r01 1 2 [0.16661 0.149949 0.183271] However, I've never seen this kind of syntax with square brackets (it neither seems to be supported by Micro-Cap). My guesses for this syntax are: Parameters value to be swept in simulation. If this is the case then I'd expect the simulator to sweep the value of \$r01\$ for each value of \$c01\$ As suggested by Andy Aka this could be a part of Monte-Carlo analysis syntax. However, if there are no additional Monte-Carlo commands in this file - I'd say that this is not the case. Some kind of randomization syntax - the value of the component will be generated randomly from the distribution characterized by the numbers in the brackets. I can try to narrow down the options (or provide additional ones) if you provide some more information. Hope this helps.
0.666667
Micro-Cap Spice simulator does allow for .define keyword to be used
How to access Event object inside javascript tag of Aspx page header content?
I am trying to fire a event from script inside aspx page. To fire a event I am using Event.observe() method. In that line I am getting error like "Event is not an object". Please help me inthis issue.Thanks in advance. My code: function Submitkeyword() { obj = document.getElementById("select");//select is button id Event.observe(obj, 'change', function () { var e = document.getElementById("lookupvaluesDropdown");//lookupvaluesDropdown is dropdownlist id var valueddl = e.options[e.selectedIndex].value; }); fireEvent(obj, 'submit'); window.close(); //To close the popup window } function fireEvent(element, event) { if (document.createEventObject) { // dispatch for IE var evt = document.createEventObject(); return element.fireEvent(event, evt); } else { // dispatch for firefox + others var evt = document.createEvent("HTMLEvents"); evt.initEvent(event, true, true); // event type,bubbling,cancelable return !element.dispatchEvent(evt); } }
Event.observe requires the Prototype JavaScript library loaded. If its not loaded and you try to use it you will get the error "Event is not an object" You need to include that in your <head> as follows : <script src="/path/prototype.js" type="text/javascript"></script>
0.888889
Event.observe requires the Prototype JavaScript library loaded
Saturated Density Plots
I am making some density and contour plots in Mathematica. These plots have very high peaks which saturate with color and prevent me from seeing differences in the peaks. Is there a way I can tone down the color scale so my peaks are not just white blobs? Trying other color schemes has not worked out, and playing with the range of color data has not been very useful. Is there some way to have the colors on a log scale??? Here is my code. ListDensityPlot[photo, PlotLegends -> Automatic, Frame -> {True}, FrameLabel -> {"Electron Bunch Energy (MeV)", "Photon Energy (keV)", "", "Yield (Photons/Sr e-KeV)" }, LabelStyle -> {15}, InterpolationOrder -> 10] Cheers, Ben
Borrowing Murta's data we can also try out Rahul Narain's Log recommendation: data = Table[Exp[-10 (x^2 + y^2)], {x, -1, 1, 0.02}, {y, -1, 1, 0.02}]; ListDensityPlot[data] ListDensityPlot[Log @ data] If your data is in the (x,y,z) form you will need something like {#, #2, Log@#3} & @@@ data as Kuba comments above.
1
Using Murta's Log
What is the likelihood of ever discovering the graviton?
How would one look for and confirm existence of a graviton? Someone was speaking to me about perhaps one day discovering the graviton, but to me it seems unlikely, although I'm young and essentially quite naive, so am coming to you physicists to ask What actually is the likelihood of finding it? How would we find it?
This depends on graviton energy and wavelength. Given a source of a beam of high-frequency gravitons with high luminocity, it would not be difficult to detect one. The problem is that nature has little sources of high-energy gravitons.
1
a source of a beam of high-frequency gravitons with high luminocity
XNA 2D camera just part of screen
Is it possible to use the 2D camera, but just for a part of the screen? Perhaps I want some info on the screen about score and other things, but I want that at a fixed place, just like when not using a 2D camera?
Create a Vector2 called Camera. Say you want to show an object with respect to the camera, i.e. a non-HUD object, draw it at a position given by: DrawPosition = ObjectPosition - CameraPosition; For the score and other HUD stuff, don't consider the camera vector. DrawPosition = ObjectPosition;
0.777778
Create a Vector2 called Camera
Please help me in changing layout of all products page
can anyone tell me where can I change layout of this page i think this page is now having 3columns.phtml layout but I need 2columns-left.phtml layout please help me.
add the following code in your local.xml file <catalog_category_layered translate="label"> <reference name="root"> <action method="setTemplate"> <template>page/2columns-left.phtml</template> </action> </reference> </catalog_category_layered>
0.666667
Add the following code in your local.xml file .
Effects of nuclear explosions in space?
In the Honor Harrington universe, ship-to-ship combat takes two forms: missiles and direct energy weapons. Missiles come in two forms - bomb-pumped lasers and contact nukes. Both use multi-megaton nuclear initiations to damage enemy ships. While this sort of event on a planetary surface will obviously have lasting effects, what long-term effects could be expected in a vacuum environment, aside from the destructive force associated with the explosions themselves, and the resulting EMP? Especially, would there be lingering (or spreading) radiation?
The biggest hazard would have to be any macroscopic particles left over. Gamma rays, X-rays, and other ionizing radiation would spread out at the speed of light, or nearly so for electrons, alphas, etc., and within moments be less than the radiation that always present in space. After an hour, any such radiation will be smeared out to a volume as large as the orbit of Jupiter. I.e., it's effectively gone. You'd have to worry more about minor solar flares than space nukes. On the other hand, although most of what's in the immediate vicinity of the explosion would be vaporised to atoms (or parts thereof), it seems possible that you could end up with significant amounts of debris. Perhaps the solar wind would blow the smaller ones away, much like the effect with a comet, but some of the larger chunks would present major navigational hazards. NASA gets very concerned when millimeter sized bits float away in orbit. Obviously anything larger will be more of a concern. If you're moving around at planetary speeds, 10's of km/sec, the kinetic energy in such space junk could easily put a hole your hull.
1
The biggest hazard would be any macroscopic particles left over .
How can you detect if the device is rooted in the app?
Possible Duplicate: Determine if running on a rooted device On Launch of the application, I want to detect if the device running is rooted. Is there proper way of detecting it? I don't think trying to write a file to '\data' to see if rooted is a good solution. (Since even rooted devices may have that path unprivileged)
you could try to do Process proc = Runtime.getRuntime ().exec ( "su" ); if that throws an exception or proc is null then they don't have root
0.333333
Process proc = Runtime.getRuntime
Application deployment using MDT with no access to network.
Is it possible to install ONLY software using MDT via USB? I don't want to deploy OS as don't want to lose the licence. I would like to achieve this scenario: Laptop with installed Windows 8.1 USB stick with MDT on it is plugged in I run silent deployment of software using the wizard. Other bits to clarify: I don't want to run MDT connected to network I don't want to install OS from scratches
Read this and ignore the OS part. http://www.vkernel.ro/blog/creating-an-offline-mdt-deployment-media
1
Read this and ignore the OS part
Display a field of a node that is referenced on another node via a relationship
I have two content types, "Stores" and "Offers." In the "Offers" content type, there is a CCK node reference field type that references the "Stores" nodes. So essentially, I create a store and if the store has an offer, I create the "Offer" node and select the store with which it is associated. I have a view (a default glossary view) that displays a list of stores. I would like to display the node titles of any offers that are associated with it but I can't figure out how to do it. I have tried to add a relationship on the node reference field then add a field that uses the relationship but the result just appears blank.
I finally went with something similar to Stefan's answer. I created a module using hook_views_pre_render that checks the correct table against the node id to see if there are any related nodes. The code is shown below. <?php /** * Implementation of hook_views_pre_render() */ function gretna_views_pre_render(&$view) { // Select the right view if ($view->name == 'stores_list') { // Check how many results there are $count = count($view->result); // For each result (reason we don't use foreach is every result is duplicated twice) for($i = 0; $i < $count; $i++) { // Get the nid for this row $nid = $view->result[$i]->nid; // Check to see if the node has any related offers $result = db_query("SELECT nid FROM {content_type_store_offers} WHERE field_offer_store_nid = %d", $nid); $result = db_fetch_array($result); // If not false, the row has offers if ($result !== FALSE) { $view->result[$i]->users_uid = "Yes"; } // Else it doesn't else { $view->result[$i]->users_uid = "No"; } } } }
0.888889
hook_views_pre_render checks the correct table against the node id
C#: Is it possible to have partial extension classes
I am looking to create Extension classes that extend Entity Framework Entities in a different assembly to the EF Entities. I also want to code gen some additional/generic methods in an extension methods class (using T4), then have the ability to create a partial extension methods class with additional custom methods. Is this possible.
You don't need them. Just write another extension class. namespace Namespace1 { public static class MyEntityBlibblingExtensions { public void Blibble(this MyEntity self) { // ... } } } Then, elsewhere... namespace Namespace2 { public static class MyEntityFurtlingExtensions { public void Furtle(this MyEntity self) { // ... } } } Anything importing Namespace1 will see the extension method Blibble() while anything importing Namespace2 will see Furtle(), and importing both will see both. They can be in different assemblies or anywhere which imports MyEntity's namespace. So, partial extensions aren't really a valid concept. In fact, the very idea of putting extension methods inside classes is a bit of a hack as it is - a shame they couldn't unbend C#'s rules enough to let extension methods live outside of classes.
0.555556
putting extensions inside classes is a bit of a hack
Maximum absolute value of polynomial coefficients
Suppose we have a polynomial in integer coefficients $$p = p_0 + p_1 x + p_2 x^2 + \ldots + p_n x^n, p_k \in \mathbb{Z}$$ Now define $M(p)$ as the maximum absolute value of the coefficients of $p$, i.e. $$M(p) = \max \{|p_k| \: |\: 0 \leq k \leq n\}$$ Is it true that for any polynomial factor $q$ of $p$, $M(q) \leq M(p)$? I'm not sure whether this is obvious and I'm just missing something, or whether my train of thought is just completely off...
No. There is a famous example of a factor of $x^{105}-1$ \begin{align} \Phi_{105}(x) = & \; x^{48} + x^{47} + x^{46} - x^{43} - x^{42} - 2 x^{41} - x^{40} - x^{39} + x^{36} + x^{35} + x^{34} \\ & {} + x^{33} + x^{32} + x^{31} - x^{28} - x^{26} - x^{24} - x^{22} - x^{20} + x^{17} + x^{16} + x^{15} \\ & {} + x^{14} + x^{13} + x^{12} - x^9 - x^8 - 2 x^7 - x^6 - x^5 + x^2 + x + 1 \end{align} See cyclotomic polynomials Also $x^4+1=(x^2+1)^2-2x^2$ has the factorisation $(x^2+\sqrt 2 x + 1)(x^2-\sqrt 2 x +1)$ which isn't integral, but does suggest that lower degree counterexamples may exist.
0.666667
Factor of $x105-1$ beginalign
How can I add a director name in line with author name in beamer?
I would like to write director name in line with author name in a beamer like: \author{Made by:\\Author name} \director{Directed by:\\Director name} but if I try to define director: \def\director#1{\def\Director{#1}}\director{Director's Name} Then it writes on the top of the first frame. Any suggestions?
You can adopt an approach based on columns environment: \documentclass{beamer} \usepackage[T1]{fontenc} \usetheme{CambridgeUS} \title{My title} \institute{My institute} \author[Author name]{Made by:\\Author name} %<= used the short author name [] for the footline \newcommand{\director}{Directed by:\\Director name} % re-definition of the title page \setbeamertemplate{title page}{ \centering \begin{beamercolorbox}[rounded=true,shadow=true,sep=8pt,center]{title} \inserttitle \par \end{beamercolorbox} \vfill \begin{beamercolorbox}[leftskip=8cm,center,wd=0.7\textwidth]{author} \begin{columns}[T] \begin{column}{.49\textwidth}% \centering \insertauthor \end{column} \begin{column}{.49\textwidth}% \centering \director \end{column} \end{columns} \end{beamercolorbox} \vfill \usebeamerfont{institute}\insertinstitute \par \vfill \centering \insertdate\par \vfill } \begin{document} \begin{frame} \titlepage \end{frame} \begin{frame}{Title} example text \end{frame} \end{document} which gives you: Notice that I adopted the short name for the author to not display in the footline the string Made by:.
1
Using the short author name for the footline
Create an "All Posts" or "Archives" Page with WordPress 3.0?
I'd like to create an "All Posts" page on the Ocean Bytes blog that contains an unordered list of all Titles of the posts to date, with each title hyperlinking to its blog post. There appear to be several plugins that do something like this, but most do not list Wordpress 3.0+ as supported yet, or they want to subset the blog postings by Year and then Month which is not desired. Any suggestions for the "best way"? Thx.
I ended up creating a page template called "allposts-page.php" in the Twenty-Ten Themes folder containing the following code: <?php /** * Template Name: All Posts * * A custom page template for displaying all posts. * * The "Template Name:" bit above allows this to be selectable * from a dropdown menu on the edit page screen. * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ get_header(); ?> <div id="container"> <div id="content" role="main"> <h2>Archive of All Posts:</h2> <ul> <?php wp_get_archives('type=postbypost'); ?> </ul> </div><!-- #content --> </div><!-- #container --> <?php get_footer(); ?> I then created a new page using the Wordpress Admin system with a title of "All Posts" and selected the "All Posts" template from the drop-down. Didn't need to enter anything in the body. The resulting page can be found via: www.oceanbytes.org/all-posts/ The default for "wp_get_archives" is "monthly" but I chose "postbypost" as I wanted to just list all posts as on long list. More options can be found on the Wordpress site via Function Reference/wp get archives
1
Template Name: All Posts - Page.php
App drawer on stock Android not alphabetized
I have a Nexus 4 with stock Android and no modifications. I installed a flashlight app and for some reason it is first in my app drawer despite it starting with a "f" and not an "a". As a developer I find this intriguing. Does anybody know how this developer managed to put his app first in the drawer or is this some type of bug?
I can't say for sure, but there's probably a zero-width non-breaking space, or some other invisible or unprintable character, at the start of the label, causing it to sort ahead of normal characters.
0.888889
Null-width non-breaking space, or other invisible or unprintable character at the start of the label
up sample and down sample
Let's say that I have a sampled signal x[n], it is being, in this exact order, up sampled by 2, down sampled by4, up sampled by 4 and down sampled by 2 to produce y[n]. It seems to me that it should be pretty self evident that since we up sampled the signal by 2 and down sampled it by 2, then up sampled it by 4 and down sampled by 4, I should just get the original x[n] back. Am I right? So the real question is, can the various up/down sampling pieces be readily swapped?
The downsampling by a factor of 4 can introduce aliasing (because you upsampled only by a factor 2 in the first stage). If this is the case, it cannot be undone by the following upsampling operation. So in general this system will not produce at its output the original input signal $x[n]$.
0.666667
The downsampling by a factor of 4 can introduce aliasing
If $a$ is a quadratic residue of odd prime $p$, then is it the case that $a^{-1}$ is also a quadratic residue?
If $a$ is a quadratic residue of odd prime $p$, then is it the case that $a^{-1}$ is also a quadratic residue ? I notice quadratic residues of odd prime $13$ : $$1^2\equiv 12^2\equiv 1\\2^2\equiv 11^2\equiv 4\\3^2\equiv 10^2\equiv 9\\4^2\equiv 9^2\equiv 3\\5^2\equiv 8^2\equiv 12\\6^2\equiv 7^2\equiv 10$$ $4^{-1}=10\\9^{-1}=3\\1^{-1}=1\\12^{-1}=12$ Is this true always ? How to go about proving ? thanks!
If $a^2 = b$ in a ring $R$ with unit, $a$ is invertible if and only if $b$ is and then $b^{-1} = (a^{-1})^2$. (Tell if this is clear to you, if not, I'll detail in an edit.) Apply this to $R = \mathbf{Z} / n \mathbf{Z}$. Apply the latter to the case $n = p$ is prime. ;-) Detail. If $a$ is (for instance left) invertible of left inverse $c$ then $ca = 1$ so that $ca^2 = a$ which implies that $c^2 a^2 = ca = 1$, that is $c^2 b = 1$ and $b$ is invertible. If $b$ is (let's say left) invertible then $db=1$ and then $(d a) a = 1$ and $a$ is left invertible. Same for right inverse. The relation $c^2 a^2 = 1$ shows you the assertion on quadratic residue, that is, that if you are invertible and a quadratic residue, that you your inverse is also a quadratic residue.
1
If $a2 = b$ in a ring $R$ with unit, $a$ is invertible if
Reading XML file and fetching its attributes value in Python
I have this XML file <domain type='kmc' id='007'> <name>virtual bug</name> <uuid>66523dfdf555dfd</uuid> <os> <type arch='xintel' machine='ubuntu'>hvm</type> <boot dev='hd'/> <boot dev='cdrom'/> </os> <memory unit='KiB'>524288</memory> <currentMemory unit='KiB'>270336</currentMemory> <vcpu placement='static'>10</vcpu> Now i want parse this and fetch its attribute value. For instance i want to fetch the uuid field. So what should be the proper method to fetch it in Python. Any libraries or code snippets that could help is appreciated
I would use lxml and parse it out using xpath //UUID
1
Parse lxml using xpath //UUID
Keyword not supported in SQL Server CE connection string
I'm trying to connect to a SQL Server CE database in a C# web application (VB 2012) using this connection string: using (SqlCeConnection conn = new SqlCeConnection(@"Data Source|DataDirectory|\MyData.sdf; Persist Security Info=False;")) The problem is that I am getting an exception that the data source|datadirectory is not a supported keyword. I attempted to change this string to: Data Source=MainDb.sdf;Persist Security Info=False; But then I get an error that the Db cannot be found. The database is located in the App_Data folder. Any ideas?
I think you're just simply missing an = sign: Data Source=|DataDirectory|\MyData.sdf; Persist Security Info=False; * ***
1
= sign: Data Source=|DataDirectory|MyData.sdf
Preventing Superscript from being interpreted as Power when using Ctrl+^ shortcut?
I have very strong desire to use superscript as the index of the variable. However, it looks like that the Mathematica automatically recognize the superscript as the power and I got message that my variable with superscript is 'protected'. Could you help me to make the superscript used as the index of the variable instead of power? UPDATE (16-June-2015): This question is being reopened and a bounty is being awarded on this. Previous answers are very good, however the bounty is to be awarded on an answer which solve this specific problem: How to change the behaviour of Ctrl+^ keybinding so that it produces Superscript instead of Power.
Superscript is not interpreted as Power: Presumably you are referring to what happens when you enter a power in superscript notation using the key combination Ctrl+6. Mathematica is capable of representing both this power notation and a formatted plain Superscript. In my opinion it is a failing that the power notation appears in the Typesetting menu while the latter is missing; if anything it should be the other way around I think. Since there is no key combination for raw Superscript I propose using a palette or input alias: Palette You may enter a formatting template using a palette button which may be created with: CreatePalette @ PasteButton @ Superscript[\[SelectionPlaceholder], \[Placeholder]] Click that palette button to insert a template for plain superscript in the current Notebook. Use Tab to move between fields. Input alias Either open the Option Inspector, select Global Preferences, type "InputAliases" to find the appropriate entry, and add this to the list of rules: "sps" -> TemplateBox[{"\[SelectionPlaceholder]", "\[Placeholder]"}, "Superscript"] Or add it programmatically (run this only once): AppendTo[ CurrentValue[$FrontEnd, "InputAliases"], "sps" -> TemplateBox[{"\[SelectionPlaceholder]", "\[Placeholder]"}, "Superscript"] ] Now type: EscspsEsc to enter a template for plain Superscript. (In version 10.0.0 the first field will not be automatically selected due to a bug; see Input Aliases in Mathematica 10.) Bounty A bounty was added for: [A] solution to map the Ctrl+^ keybinding to produce superscript instead of power. To accomplish this first copy MenuSetup.tr from the installation directory to the matching path in your user directory and open the user copy for editing: os = $OperatingSystem /. "Unix" -> "X"; CopyFile @@ ( FileNameJoin[{#, "SystemFiles", "FrontEnd", "TextResources", os, "MenuSetup.tr"}] & /@ {$InstallationDirectory, $UserBaseDirectory}) % // SystemOpen Then within the user copy edit the appropriate MenuItem to read: MenuItem["&Superscript", FrontEndExecute[{ FrontEnd`SelectionMove[FrontEnd`InputNotebook[], All, Word], FrontEnd`NotebookApply[FrontEnd`InputNotebook[], TemplateBox[{"\[SelectionPlaceholder]", "\[Placeholder]"}, "Superscript"], Placeholder] }], MenuKey["6", Modifiers -> {"Control"}] ] Restart Mathematica. You may now enter raw Superscript by using Ctrl+6 where 6 is the number-line six above the alphabetic keyboard. You can still enter Power notation by using Ctrl+Shift+6 or Ctrl+Keypad-6, the latter assuming that Num Lock is on. For those you prefer the reverse behavior you can instead copy and edit KeyEventTranslations.tr and change the Item: Item[KeyEvent["^", Modifiers -> {Control}], "Superscript"] to: Item[KeyEvent["^", Modifiers -> {Control}], FrontEndExecute[{ FrontEnd`SelectionMove[FrontEnd`InputNotebook[], All, Word], FrontEnd`NotebookApply[FrontEnd`InputNotebook[], TemplateBox[{"\[SelectionPlaceholder]", "\[Placeholder]"}, "Superscript"], Placeholder] }] ] Now Ctrl+6 is Power and Ctrl+Shift+6 is raw Superscript. However the Typesetting menu item remains misleadingly named Superscript so I would personally change that to Power if adopting this binding. Also see: Can I modify Ctrl-- to insert Indexed expressions?
0.666667
Input alias: Palette Input Aliases
Interpretation of riemannian geodesics in probability
Good morning everybody. My question is, as maybe already hinted in the title, rather philosopic. We know that geometric properties of a riemannian manifold can be interpreted in terms of certain evolution processes; I'm thinking about all the relations between the expansion of the heat kernel and, for example, the gaussian curvature of the manifold. Now, since I'm not a probabilist the question is as follows... are there characterizations, or properties of riemannian geodesics which can be deduced from stochastic operators (like the Brownian motion)? Even more, can we give a characterization of (properties of) riemannian geodesics in these terms? All references are welcomed.. this is just a soft question for me to know where I have to look at in literature. Thanks again for the patience. Guido
Check out: Franchi and LeJan, Hyperbolic Dynamics and Brownian Motion: An Introduction
0.888889
Franchi and LeJan, Hyperbolic Dynamics and Brownian Motion
Any connection between akimbo, askance and atremble?
I came across akimbo and askance today and wondered if they were related, with the opening 'a' signifying something. Apparently not: Akimbo โ€” to stand "with hands on hips and elbows projecting outwards", from the C15 in kenebowe, "literally: in keen bow, that is, in a sharp curve" Askance โ€” to look sideways, obliquely, especially with suspicion or doubt; origin obscure. Other words take an 'a' prefix meaning a negative: a- or an- [Greek a- and an- un-, non-] Negative, not (abiotic, acaulescent, acephalia, aphasia, asexual, atrophy, anorexia). But 'a' is also used as a prefix in words that are not negative, for example his knees were all atremble. What is the meaning of 'a-' here? Could it have connections with akimbo and askance?
This is actually a matter of general reference that should be easily explained by consulting any dictionary worthy of being called such โ€” and certainly can be found in The Dictionary, if one would but look. But I will explain it anyway. :) English has at least 6 different prefixes, a-. This, however, is not one of those six. Rather, the one you see in knees all a-tremble is actually an old preposition that we no longer use, just as it is in here we come a-wassailing, in nine lords a leaping, and in twice a day. It was a variant of the preposition on that lost its -n. The OED explains in a prep. (which is just the 8th entry in the Dictionary): Variant of on prep. with loss of the final consonant -n, reflecting an unstressed pronunciation of the word in proclitic use; compare an, variant of on prep., and also o, variant of on prep. Compare a- prefix3, away adv., aright adv. The loss of final -n in this word occurs early in terms of the developments described at Nย n. and perhaps began in fixed idioms where the word was felt to be almost a prefix; compare the parallel development represented by a- prefix3. A following consonant favoured the loss of final -n (compare discussion at Nย n.) and so until the 17th cent. the word was often found in complementary distribution with an, variant of on prep., which was common before vowels (with variation between the two before following h-). The separate preposition a ceased to be used in standard English after about 1700, being replaced by the full on, in, or the various prepositions which represent them in modern idiom, surviving only in a few set uses from branch II., such as to go a begging, to set a going (occasionally, before a vowel or h-, in form an, after an, prevocalic variant of a adj.; compare quots. 1759, 1780 at sense 11b), and in temporal distributive phrases, as twice a day, once a year, where it had been early identified with the indefinite article (see a adj.4). It also survived in a large number of combinations, where it was treated as a prefix to the governed word, and the whole as a compound adverb. As I said, itโ€™s in the Dictionary. Were you to look there, you would also see that although there is some connection between askew and askance, and several other, less common words besides, the actual origin is obscure. The Dictionary says of askance adv.2: There is a whole group of words of more or less obscure origin in ask-, containing askance, askant, askew, askie, askile, askoye, askoyne, (with which compare asklent adv., aslant adv., asquint adv.,) which are more or less closely connected in sense, and seem to have influenced one another in form. They appear mostly in the 16th or end of the 15th cent., and none of them can be certainly traced up to Old English; though they can nearly all be paralleled by words in various languages, evidence is wanting as to their actual origin and their relations to one another.
1
The Dictionary says of askance adv.
How to measure a crooked room?
I am faced with the task of measuring a room that has no right angles. The room has the following layout (this sketch in not scaled, there is also a window in the right wall which I omitted here): I want to measure the room as accurately as possible, because I want to create a plan for a friend who is a carpenter to cut some plates for a subceiling, and I would like for them to fit. My current plan is to measure the diagonals shown in the sketch as well as all the individual wall-segments. This should give me the information to construct an accurate plan without actually having to measure the angles of the corners. The measuring is complicated by the fact that I cannot measure on the ground, because there is furniture in the way that I cannot move. Also, since the walls are really crooked, I want to take the measurements at the hight at which the subceiling will be built. The longest diagonal is about 6 meters. How do I measure this room accurately? Is my approach sound? How can I measure these diagonals accurately (preferably without having to buy a laser-measuring-device)?
Forget it!!!! Trying to measure an untrue room for prefabrication of parts is nearly impossible. Your carpenter will have to come in, establish a center line in both axis and divide the differences on the edges. This application is no different than doing a suspended ceiling, and must be done on site. There will be a bit of adjustment in all directions, I'm sure.
1
Trying to measure an untrue room for prefabrication of parts
Word to describe "a person who is only wishful to help others and cares little about themself"?
Specifically, I am looking to describe a person whose only purpose is to help others, not caring about what happens to himself or herself (physically or otherwise), though without actively seeking pain.
Selfless Having, exhibiting or motivated by no concern for oneself but for others; unselfish. Also altruistic. See http://en.wikipedia.org/wiki/Altruism
1
Selfless Having, exhibiting or motivated by no concern for oneself
Why are there so many different types of screws (phillps/flat/hex/star/etc)?
Newbie question. Why is it that there's a bazillion different types of screws? Why can't we just always use one standard screw type? Are there advantages/disadvantages to the different types? Are there times when one type is preferred over another? Help me understand why there isn't one screw to rule them all.
I thought it would be useful to include an image/link to some drive types found on screws and bolts (obtained from bontool):
1
Image/link to some drive types found on screws and bolts
Password sending through network
In case of no TLS/SSL available, why can't I use the hash of the password (SHA512) as the key to encrypt the password (with out any salt) to send through the network ? MITM attacks I can understand, but what are the other possible attacks ?
SSL's only purpose is to stop Man in the middle from happening. Not having SSL/TLS just means you can't have: Confidentiality Integrity Furthermore the password is just a token used for authentication, it's not required to have the actual password if the access token is the hash. You can perform a repeater/replay attack if you can sniff the hash from the network and provide it to your application to authenticate to your service. An example for such an attack can be found in Windows. It's called the pass-the-hash attack.
1
Pass-the-hash attack
Possible to remove p tags from a table cell in Wygwam
I have a problem that occasionally a <p> tag is being added to a table cell, usually when someone pastes something into it. Is there a way to remove that <p> and just have the cell be an empty <td> or <th>, ideally without editing the source? Is there an option that could be added through the advanced settings?
If the reason is appearance, you can remove any margin/padding formatting with css, like: table p {padding:0; margin:0} Or you can add specific classes to the styling menu of wygwam for tables, for a more fine grained control over styling tables.
0.5
Edit margin/padding formatting with CSS
Facebook Redirect url in ruby on rails open ssl error
I have followed the omniauth devise facebook app as explained by Ryan in episode 235.After the user authorizes we are getting the error at http://localhost:3000/auth/facebook/callback?code=13444... The following are the facebook settings : App Domain : localhost siteurl: locahost:3000/ canvas url: http://localhost:3000/auth/facebook/ please tell me where am i going wrong?
In one project, we had to add this code to config/environments/development.rb to get Facebook connect working for local development: OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
0.833333
config/environments/development.rb to get Facebook connect working for local development
If NASA could send a camera into a black hole, could we then see what's inside the black hole?
Inspired by Stephen Hawking I recently tripped upon an idea of what is really inside a black hole. I thought if NASA (or any other space agency) could send a super protected camera into a black hole, then we could see what's inside black hole. Is this even possible?
No, not even light can escape a black hole, therefore radio will be unable to broadcast signals back to Earth. (Radio is a form of light)
1
No, not even light can escape a black hole
Meaning of ladder points
Last night, we had a discussion regarding promotions on the ladder. One of the issues where whether the points have influence on promotion or not, and neither of us can find legit facts to the points on the ladder. We couldn't find any facts regarding the points at all, besides the fact that it ranks you on the ladder. Do the points on the ladder have any other meaning besides placing you from 1-100 on the ladder?
Ladder ranking (LR) is (presumably) like hidden Matchmaking Rating (MMR), but offset by an unknown amount, and inflated by Bonus Pool. Ladder ranking changes similarly to MMR, rising and dropping depending on the relative strength of your opponents, but it becomes offset by following factors: LR has different "zero point" in different leagues (and League ranges should not overlap much, theoretically). LR cannot be negative, so if you keep losing, your MMR diverges from ladder points. LR is inflated by Bonus Pool, so, assuming all players spend their bonus pool, everyone's Ladder points drift up from their MMR by some (same for everyone) amount. There was also a nuance that when matching players, their relative strength was determined by subtracting MMR of one from LR of the other, so both players could turn out to be "favored". "Favor" indication was removed, though, so it may have no effect today. Bottom line: while LR does correlate with MMR in some circumstances, strictly speaking, it does not mean anything but rank in a Division. It is (with all Bonus pool stuff) just a convenient way to rank players, while giving them sense of progression and "catching up".
0.555556
Ladder ranking (LR) is similar to hidden Matchmaking Rating (MMR)
Windows 7 lookups on first host file entry
Today my ISP blocked my internet due to suspicious activity - outgoing requests to malicious websites. Numerous scans of my machine couldn't reveal the culprit. However, after doing a quick netstat /f I found the following: TCP 127.0.0.1:5357 101com.com:49168 TIME_WAIT TCP 192.168.1.21:49169 THOMSON:netbios-ssn TIME_WAIT TCP 192.168.1.21:49170 THOMSON:netbios-ssn ESTABLISHED TCP 127.0.0.1:49171 101com.com:49172 ESTABLISHED TCP 127.0.0.1:49172 101com.com:49171 ESTABLISHED Coincidentally, only a few days ago I decided to start adding servers to my host file. 101com.com appears to be the first entry on my list. So, am I actually sending out requests to 101com even though it is being blacklisted? And if so, how can it be prevented? Thanks.
First, let's make something clear. hosts file doesn't prevent domain name resolution, it only overrides what domains resolve to. When some program tries to resolve 101com.com, your OS would normally query DNS servers for its IP address. But, if you have it in your hosts file, then 101com.com will be resolved to provided IP without DNS query. Domain name resolution still happens, but it's handled inside OS. All programs that try to resolve domains will receive IP addresses in response, but it will be the IP you have provided instead of DNS provided one. 101com.com is not "blacklisted", you have only redirected its traffic to your own machine (127.0.0.1). Now, how can we explain 101com.com in netstat's output? That's pretty simple. netstat will try to reverse lookup domain names for IPs in the third column. You have defined 101com.com as a domain name for 127.0.0.1, so if you have a TCP connection from your machine (127.0.0.1) into your machine (127.0.0.1), then it can be as well shown as a connection from 101com.com to 127.0.0.1. 101com.com still exists for you, but now it points at your computer, not theirs. If your PC says something about 101com.com, it means itself. This has nothing to do with your ISP and he has no idea you have added some entries to the hosts file.
1
How can we explain 101com.com in netstat's output
Link directly to a tab in adminhtml tab widget
Is it possible to link directly to a tab on a backend page, using URL fragments? In particular, I want to link to the "Manage Label / Options" tab on the "Edit Product Attribute Page": I hope for something like /admin/catalog_product_attribute/edit/attribute_id/1/#product_attribute_tabs_labels where the URL fragment #product_attribute_tabs_labels is read in JavaScript and the tab gets selected. If that's not possible out of the box, how could this feature be added with an additional script and without rewriting templates?
Actually it's possible with a URL parameter ?active_tab=$id. How to find the right tab id Find the responsible tab container class. This is a child class of Mage_Adminhtml_Block_Widget_Tabs, in my case, Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tabs. You'll find calls to $this->addTab(), usually in the methods _beforeToHtml(), or _construct(). The first parameter of addTab() is the tab id: $this->addTab('labels', array( 'label' => Mage::helper('catalog')->__('Manage Label / Options'), 'title' => Mage::helper('catalog')->__('Manage Label / Options'), 'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_attribute_edit_tab_options')->toHtml(), )); So, the URL is /admin/catalog_product_attribute/edit/attribute_id/123/?active_tab=labels, generated with this code (within an adminhtml block): $this->getUrl('adminhtml/catalog_product_attribute/edit', array('attribute_id' => 123, '_query' => array('active_tab' => 'labels')); How it works Let's have a look at the responsible code: Mage_Adminhtml_Block_Widget_Tabs::_beforeToHtml() Sets the active tab based on URL parameter or session value. If setActiveTab() is not called, the _activeTab property defaults to the first added tab: if ($activeTab = $this->getRequest()->getParam('active_tab')) { $this->setActiveTab($activeTab); } elseif ($activeTabId = Mage::getSingleton('admin/session')->getActiveTabId()) { $this->_setActiveTab($activeTabId); } app/design/adminhtml/default/default/template/widget/tabs.phtml Here, the result of getActiveTabId() is passed to the varienTabs instantiation in JavaScript: <script type="text/javascript"> <?php echo $this->getJsObjectName() ?> = new varienTabs( '<?php echo $this->getId() ?>', '<?php echo $this->getDestElementId() ?>', '<?php echo $this->getActiveTabId() ?>', <?php echo $this->getAllShadowTabs()?>); </script> The varienTabs constructor takes the active tab id as parameter and shows it. For the curious, the code is in js/mage/adminhtml/tabs.js
0.888889
How to find the responsible tab container class
asynchronously loaded images in uitableview disappear on scrolling up
i am able to fetch images asynchronously on to uitableview.i am fetching these images are from a url.on scrolling up uitableview these images disappear and they take time to load again and sometimes they dont load at all.i dont want to use any 3rd party libraries.i dont want to go with synchronous approach.please suggest any correct approach to improve performance.thanks for help in advance.my code is below: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *identifier=@"cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"identifier"]; } UIImageView *imgVw=[[UIImageView alloc]initWithFrame:CGRectMake(250, 10, 40, 30)]; [cell.contentView addSubview:imgVw]; Attributes *att = [listOfObjects objectAtIndex:indexPath.row]; strImgUrl=@"http:image url"; strImgName=att.classifiedImg; if (strImgName == nil) { UIImage *myImg=[UIImage imageNamed:@"user_circle.png"]; imgVw.image=myImg; } else{ strImg=[strImgUrl stringByAppendingString:strImgName]; } dispatch_async(dispatch_get_global_queue(0,0), ^{ NSData *data = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString:strImg]]; if ( data == nil ) return; dispatch_async(dispatch_get_main_queue(), ^{ UIImage *img=[UIImage imageWithData: data]; imgVw.image=img; }); }); return cell; }
It seems like your reuse code contains bug, which causes everytime to create new cells. The following code uses reuseIdentifier as @"identifier" if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"identifier"]; } Change it to: if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier]; } EDIT: On reusing tableView cells, you dont need to create and add subviews to cell each time. Instead, just create the subview when creating cell and then if cell is reusing, just get the subview using tag and update your content from datasource. Your code can be modified like below: if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier]; UIImageView *imgVw=[[UIImageView alloc]initWithFrame:CGRectMake(250, 10, 40, 30)]; imgVw.tag = indexPath.row; [cell.contentView addSubview:imgVw]; } UIImageView imgVw = (UIImageView*)[cell.contentView viewWithTag:indexPath.row]; //Rest is same as you posted. Hope this will fix the issue.
0.888889
reuseIdentifier is @"identifier"
Heathrow Customs - "Arrivals from the EU" exit
At Heathrow, after collecting your baggage, there are three exits. Green - nothing to declare Red - something to declare (not sure of text) Blue - arrivals from the EU What is the blue one for? Is it if you have something to declare, and have come from an EU country? I saw no signage to tell me when I was there last week.
The blue channel is for travelers from the EU who have nothing to declare. If you have something to declare you should in any case go through the red channel. The difference between travelers coming from the EU and other travelers is that some procedures like declaring cash are unnecessary and the limits, e.g. for alcohol, are much higher than when coming from outside the EU. You can basically import just about anything for your personal use. Other EU countries do not offer separate channels, however, and for the system to work it seems you would need some way to make sure that people coming from outside the EU do not simply sneak through the EU lane. I don't have any particular insights into the reason the UK organized things in that way but the blue channel could be a way to sort out travelers that are less likely to be importing something illegally. Baggage tags from EU airports are marked with green stripes so people who go there by mistake or try to cheat (without being too clever about it) can still be spotted easily. The only difference I could find between the UK and some other EU countries without separate channels is that in the UK, declaring cash is only mandatory if you come from outside the EU (it's EU law) whereas in France or Germany it's also mandatory if you come from another EU country. But it's not clear to me how this could explain the blue channel.
0.888889
The blue channel is for EU travelers who have nothing to declare .
A deferred capital gains tax similar to the real estate 1031 Exchange but for securities reinvestment?
I am looking for a way to transfer a stock that has done well into a safer investment (like an index fund). I assume the only way I can do this is sell the stock, pay the tax owing, and buy new stock. I do remember reading something about you can transfer the ownership of the stock (e.g. into a Children's Trust) but not sure if that is realistic. I know the 1031 Exchange is a real estate tax benefit to encourage reinvestment in property and I just wondered if there is anything similar for securities.
Sale of a stock creates a capital gain. It can be offset with losses, up to $3000 more than the gains. It can be deferred when held within a retirement account. When you gift appreciated stock, the basis follows. So when I gifted my daughter's trust shares, there was still tax due upon sale. The kiddy tax helped reduce but not eliminate it. And there was no quotes around ownership. The money is gone, her account is for college. No 1031 exchange exists for stock.
1
Sale of a stock creates a capital gain, which can be offset with losses .
Adding seconds to mysql DateTime via php
Im trying to add 12 seconds to a mysql datetime object via php. My php code generates the following query: "UPDATE Stats SET Usage = 1970-01-01 00:00:12" however the query fails. My php code is as follows: public function UpdateTime($diffrence) { $seconds = $diffrence / 1000; mysql_connect('localhost','user','pass') or die("Unable to select host"); mysql_select_db('StatDB') or die("Unable to select database"); $query = "SELECT * FROM Stats"; $result=mysql_query($query); $retVal = mysql_result($result,0,"Usage"); $oldTime = new DateTime($retVal); $oldTime->modify('+'. $seconds .' seconds'); $from = date("Y-m-d H:i:s", strtotime($oldTime->format('Y-m-d H:i:s'))); $query2 = "UPDATE Stats SET Usage = $from"; echo $query2; $result2=mysql_query($query2); mysql_close(); } Does anyone how I can fix this? Thanks
This is likely related to missing quotes in your query. Check out the answer to this question. UPDATE Stats SET Usage = '1970-01-01 00:00:12' You should surround the date time value passed in single quotes.
0.888889
This is likely related to missing quotes in your query
Why doesn't Owen Lars recognize C-3PO during ANH?
As shown in this answer, Owen and Beru Lars should be very familiar with C-3PO (he stayed with Shmi Skywalker till her death, and was present at her funeral). Yet, Lars (not sure if Beru saw him during ANH) never recognizes C-3PO in the first part of A New Hope, despite presumably having lived with him during the time of Shmi Skywalker's marriage to Cliegg Lars. Is there a canon explanation for Owen's lack of recognition? (related: How come Obi-Wan doesn't remember R2D2 and C3P0 in New Hope? )
Because George Lucas doesn't have a clue, it really can not be made sense of in any other way. It just doesn't make sense, because: 1) The only reason Owen would not recognize C-3PO is if 3PO is, as suggested, one of a mass-produced series of droids. However... 2) C-3PO was not part of a mass-produced line, he was hand-built by Darth Vader. 3) He really should've had a clue when R2 started talking about Obi-Wan, the guy who OWNED the droids last time he saw them, but he just gives some vague response when questioned by Luke, rather than desperately trying to get rid of the droids. 4) C-3PO should have recognized Owen and Beru, unless his memory had been wiped. However... 5) He remembers his first job, so his memory has not been wiped. 6) So, how do the droids not even remember who Obi-Wan is when the message is recorded? There really is no decent explanation beyond rushed writing and production of the movies so that the associated toys could hit the shelves.
1
How do the droids not remember who Obi-Wan is when the message is recorded?
Is there a comprehensive life science techniques/methods database?
There are so many techniques/methodologies in the life sciences that we can use to interrogate interesting questions. The thing is, most of us are completely unaware of the available methods we can employ. Rather, we go with the techniques we are familiar with or that are popular in our subdomains at the time. But that's pretty limiting. So I'm wondering... we have databases for everything else... is there one for life sciences techniques/methods? Something like this could be immensely helpful in experimental planning. In particular, I think a comprehensive database would help scientists break outside of their spheres of familiarity and to employ less known (but potentially illuminating) methods to their questions. I know there are journals that publish protocols and methods, but they are fragmented and don't encompass everything. Does what I'm looking for exist? If not, how might one go about creating such a tool?
There's Benchfly, which is a video-based protocol library: http://www.benchfly.com/video-protocols.php There's also JOVE, which is a peer-reviewed video journal that sometimes covers protocols: http://www.jove.com/
0.888889
Benchfly is a peer-reviewed video-based protocol library .
Understanding of Relays and associated circuitry
I needed a simple understanding of how this circuit works. I understand everything about this circuit apart from the diode. I also know the function of the diode is to protect the transistor but from what exactly? Is it something to do with back EMF from the coil? I'm not too sure. Also I needed to confirm if the relay will function correctly with a 9V supply (regulated or unregulated). The datasheet of the relay is attached here and the part I'm going to use is '40.61' on page 20 of the datasheet. Also any tips for making this circuit work more efficiently. Note I am going to use the relay for no more than 16A at 230VAC at 50Hz. Thanks
First the diode. An inductor resists to changes in current. So if you switch off the transistor the relay coil will try to keep the current flowing, it becomes a current source. If there would be a low resistance path that would only create a low voltage, according to Ohm's Law. But if there's no way out for the current the voltage will rise to several tens of volts, and destroy the transistor. The diode provides a low resistance path where the current is drained to the positive power supply. BTW, a Schottky diode is a better choice here. R1 and Q1 look OK. The BC546B has an \$\mathrm{H_{FE}}\$ of 200 minimum, and with a 5V input you have 1 mA base current, so the 200 mA collector current is more than sufficient.
0.666667
The diode provides a low resistance path to changes in current
Trying to recreate graphic from image as a vector
I am trying to recreate the rings from the following image into a vector graphic. I have made several attempts using various shapes and the pen tool with no luck. Any help on which steps I could take would be greatly appreciated! Here is the image in question (on pinterest):
You simply draw one ellipse. Duplicate it. Draw a rectangle for the sides. Then use the Shape Builder Tool to combine specific pieces (Holding the Option/Alt key down with the Shape Builder Tool will remove parts.) Then add color.
0.888889
Draw one ellipse.
Why are my recovered images only 160x120 pixels?
I am trying to recover some lost images, and with all the programs I've tried, some of the photos resulted to be in a 160x120 pixel resolution. What does this mean, and is there any possibility to recover photos in original dimensions? Any help is appreciated.
As others have noted, you are seeing "thumbnails". The originals are very likely to be there and depending on what was done to the storage medium after the photos were written, some or all may be still recoverable. File recovery programs vary widely in capability. Some are fully free, some cost substantial money. I have found that the best free ones are as good as you could hope for. Sometimes you may need to try a number of free programs to find one that works best in your situation. On one occasion I found that the fully free Undelete 360 worked superbly when nothing else did. Worth a go. On that occasion, from a largish flash card (16 GB?) I recovered not only most of the photos the user had "lost" when they formated the card and then continued to use it, but also many going back a year+ that they had copied and then deleted on various past occasions. You may find that some other program works better in your case, but this is a good starting point. A typical 'Undelete 360' pre-recovery screen is shown below - deleted files are shown (where possible) by name, size etc, plus likely recovery status - here you can see "very good", Bad and Overwritten estimates of file quality. If the storage media is used to write more files to after deletion or formating the chances of ecovery fall as files are fullyt or partially overwritten.
1
File recovery programs are as good as you could hope for
Can an affidavit be used in Beit Din?
An affidavit, from what i understand, is basically a signed document given by a witness to be used as evidence in a trial, without the witness themselves needing to take a stand. Can an affidavit be used in Beit Din? Or must witnesses take the stand in person for their testimony to count? (In case i'm misunderstanding what exactly an affidavit is, simply treat it as a signed document by a witness with their testimony.)
Sending an "affidavit" it is a dispute between Rashi and Rabbeinu Tam. Devarim 19:15: ืœื ื™ืงื•ื ืขื“ ืื—ื“ ื‘ืื™ืฉ ืœื›ืœ ืขื•ืŸ ื•ืœื›ืœ ื—ื˜ืืช ื‘ื›ืœ ื—ื˜ื ืืฉืจ ื™ื—ื˜ื ืขืœ ืคื™ ืฉื ื™ ืขื“ื™ื ืื• ืขืœ ืคื™ ืฉืœืฉื” ืขื“ื™ื ื™ืงื•ื ื“ื‘ืจ Rashi: ื•ืœื ืฉื™ื›ืชื‘ื• ืขื“ื•ืชื ื‘ืื’ืจืช ื•ื™ืฉืœื—ื• ืœื‘ื™ืช ื“ื™ืŸ And not that they write their testimony in a letter and send it to Beis Din Tosefos Bava Basra 40a (continued from 39b): ื•ืขื•ื“ ืื•ืžืจ ืจ"ื™ ืฉืฉืžืข ืžืŸ ืจ"ืช ืฉื ื•ื”ื’ื™ื ืœืฉืœื— ื”ืขื“ื™ื ืขื“ื•ืชื ื‘ืื™ื’ืจืช ืœื‘"ื“ ื•ื—ืฉื™ื‘ ืขื“ื•ืช ื•ื”ื ื“ื“ืจืฉื™ื ืŸ ื‘ืกืคืจื™. ืžืคื™ื”ื ื•ืœื ืžืคื™ ื›ืชื‘ื ืœื ืืชื ืืœื ืœืžืขื•ื˜ื™ ื“ื•ืงื ืืœื ืฉืื™ื ื• ื‘ืจ ื”ื’ื“ื” ืื‘ืœ ืจืื•ื™ ืœื”ื’ื“ื” ืื™ืŸ ื”ื’ื“ื” ืžืขื›ื‘ืช ื‘ื• R"i said that he heard from Rabbeinu Tam that the custom is to send testimony by a letter and it is considered [valid] testimony. And that which it expounds in the Sifre "From their mouths and not from their writing" is only coming to exclude a mute who is not able to speak, but someone who is able to speak does not need to speak. Rambam concludes it is not allowed, but in monetary law the Chachomim enacted that it would be accepted in order to not prohibit the ability of people to secure loans (Hilchos Edus 3:4) ื“ื™ืŸ ืชื•ืจื” ืฉืื™ืŸ ืžืงื‘ืœื™ืŸ ืขื“ื•ืช, ืœื ื‘ื“ื™ื ื™ ืžืžื•ื ื•ืช ื•ืœื ื‘ื“ื™ื ื™ ื ืคืฉื•ืช, ืืœื ืžืคื™ ื”ืขื“ื™ื: ืฉื ืืžืจ "ืขืœ ืคื™ ืฉื ื™ื™ื ืขื“ื™ื" (ื“ื‘ืจื™ื ื™ื–,ื•)--ืžืคื™ื”ื, ื•ืœื ืžื›ืชื‘ ื™ื“ืŸ. ืื‘ืœ ืžื“ื‘ืจื™ ืกื•ืคืจื™ื ืฉื—ื•ืชื›ื™ืŸ ื“ื™ื ื™ ืžืžื•ื ื•ืช ื‘ืขื“ื•ืช ืฉื‘ืฉื˜ืจ, ืืฃ ืขืœ ืคื™ ืฉืื™ืŸ ื”ืขื“ื™ื ืงื™ื™ืžื™ืŸ, ื›ื“ื™ ืฉืœื ืชื ืขื•ืœ ื“ืœืช ื‘ืคื ื™ ืœื•ื•ื™ืŸ.
0.888889
Sending an "affidavit" to Rabbeinu Tam
Using a ski helmet for winter biking
I am curious if anyone uses a skiing helmet for winter biking? Would this be safe? Are skiing helmets designed to protect you from the same kind of accidents that you would have on a bike? My thinking is that a ski helmet would: Help to keep your ears warm Would fit well with ski goggles (which fit poorly with my bike helmet) Not have air vents in it which make you cold in the winter
I wear a Bern Brentwood with a winter liner in cold weather. It's a certified bike helmet, but designed more like a ski helmet. The winter liner does a great job of keeping my ears warm without wearing any other protection, but doesn't block traffic noise. It is vented, but not well enough that it makes my head cold. It also has a clip in the back for ski goggles if you're using them. With the summer liner it works well for fall and spring, too.
1
Winter liner keeps my ears warm without wearing any other protection
reference a view page with entity reference
I have an entity reference field for referencing and rendering a teaser display of nodes. I would like to be able to include a View page in the list. I this possible in some way?
View Reference Module makes it possible Defines a field type View reference which creates a relationship to a Views display and allows the view to be displayed as the content of the field. OR Entityreference View Widget Module is another solution This module provides an advanced Entity Reference widget that uses a view embedded in a modal dialog for selecting items. In the Field UI for the Entity Reference field select "View" as the widget Edit your Content Type or Entity Add or Edit the field with "Entity Reference" Next make sure your "field" - "widget type" is set to "View" Check for the following "field" settings in your content type field: "View": make sure you select your "Entity Reference View Widget" Pass selected entity ids to view
1
View Reference Module allows Views to be displayed as content of the field
Finding Facebook profile ID from an image URL
I was forwarded an anonymous concern about a photo or group site. I want to find the user id as the photo appears to have been removed. The link is https://www.facebook.com/photo.php?fbid=10155011880340063&set=gm.891218424251397&type=1&theater. From that URL, is there a way to find the Facebook user?
If the photo has been removed there will not be a way to trace back to the ID (that's a good thing in terms of privacy) https://www.facebook.com/photo.php?fbid=10155011880340063&set=gm.891218424251397&type=1&theater broken down is fbid=10155011880340063 The Photo ID gm.891218424251397 The Group Permalink Post ID associated with it Without the UID or Group ID it will be difficult to impossible to trace back the user who posted this.
1
If the photo has been removed there will not be a way to trace back to the ID
How can I make an X-Y scatter plot with histograms next to the X-Y axes?
I just saw a nice plot there: How could I implement that in Mathematica โ€” by which I mean the plot structure, not so much the styling.
This doesn't have the styling and it doesn't yet enforce the plot ranges or implement the regression line, but it's a start: fakeBloombergThing[data:{{_?NumericQ, _?NumericQ}..}] := Grid[{{Histogram[data[[All, 2]], BarOrigin -> Left , AspectRatio -> 5, ImageSize -> 80], ListPlot[data, Frame -> True, AspectRatio -> 1, ImageSize -> 350]}, {Null, Histogram[data[[All, 1]] , AspectRatio -> 1/5, ImageSize -> 350]}}] Some fake data: testdata = RandomVariate[BinormalDistribution[{-1, 1}, {1, 2}, -.6], 100]; fakeBloombergThing[testdata]
1
FalseBloombergThing[data:_?NumericQ, _?numricQ]
Multiple orders in a single list
I have a problem with a ranking system I am using. Scenario: An online game with around 10k players calculates a real time ranking of points when a certain event occurs. Events don't occur that often, around 1 time per minute. This ranking is kept in the cache for quick calculations, sorting and access. Now players can form groups and play against each other, but the scoring system is the same, only the ranking is based for the players in that group. At first I created for every group a separate ranking, effectively having the same scores as the complete ranking, but with different positions in the ranking. This is trivial because there are over 1.000 groups and every time an event occurs all the groups would have to be updated. So what I did now is when the group ranking is requested take only the players that are in that group from the complete ranking and show them. The positions would have to be re-counted. That re-counting is where the problem is. Because the sub-list is by-reference from the complete ranking list I cannot change the position of the player in the sub-ranking without updating it in the complete ranking, because it's just a reference. I came up with two solutions: Create a copy from the record every time it is requested and do some output caching (not very desirable because the rankings are live) Create a copy and store this in a cache which is reset when an event occurs. Create a sub-list with just the positions which is updated when an event occurs. And the last solution: do the position counting in the output instead in the business side. This would be the best solution, only problem is that on some pages this text appears: "You are on position # in the ranking" where # is your ranking position. This number would be tedious to get then. Does anybody have any suggestions to this problem?
As you say yourself, the best solution is to do the counting in the output, instead of storing it in the various lists. That way you don't have to store (and recalculate) the ranking numbers on each event for each (sub-)list, but you only calculate them when needed. For the "You are on position # in the ranking" text, you could have a method in the class that represents the ranking list, like this: RankingList::getRankingOf(Player). Only if this information is costly to obtain and you only need the ranking from the overall list, you could consider caching the current ranking numbers in the overall list (as an optimisation strategy).
0.555556
Calculate the ranking numbers in the overall list
How do they shoot long underwater scenes (especially the even longer stylistic ones)?
How do they shoot the music videos where people are singing inside water? What confuses me if that is plain special effects is their clothes, they behave exactly how clothes behave in water. The motion of the cloth is slow, like it's supposed to be in a fluid, whereas the motion of the person is normal (or slow, but for stylistic reasons). I mean, it could be special effects, but that will really surprise me, because it will certainly take a lot of effort. Example
It really depends on the film, but the best example I can think of is the James Cameron's The Abyss, and I suspect they did the same thing in the music video you mentioned. As detailed in this Time article about the film, there is a large tank of water for the scene to be filmed in, with all the crew using oxygen tanks. In between cuts, support divers with a spare oxygen tank will then swim up to the cast and give it to them. In the case of The Abyss, there was also an underwater oxygen refilling station so they didn't have to surface every time their Oxygen tank was empty (which would be once an hour), but in shorter and/or cheaper projects they would just swim up to the surface to do so. Though in the music video, the angle of the light source seems to indicate that she isn't very deep underwater and could probably reach the surface with a single kick.
1
James Cameron's The Abyss is an underwater oxygen refilling station .
C++: Access embedded resource from dll
I have a c++ dll project, in which, I have embedded some raw data through "resource.rc" file. IDR_TEMPLATE1 RCDATA "areaTemplate.bin" Now I want to access the data of "areaTemplate.bin" file from the dll. How can I read the contents of "areaTemplate.bin" in a byte array?
As Manuell says, you use FindResource(), LoadResource() and probably LockResource() and SizeofResource() I happen to have some code which does pulls out a resource and writes it to a file, and may help with your understanding of the API in question. void WriteResourceToFile( HANDLE hFile, const _tstring &resourceName, const _tstring &resourceType, HMODULE hModule) { HRSRC hResource = ::FindResource( hModule, resourceName.c_str(), resourceType.c_str()); if (!hResource) { const DWORD lastError = ::GetLastError(); throw CWin32Exception( _T("WriteResourceToFile() - FindResource"), lastError); } HGLOBAL hGlobal = ::LoadResource(hModule, hResource); if (!hGlobal) { const DWORD lastError = ::GetLastError(); throw CWin32Exception( _T("WriteResourceToFile() - LoadResource"), lastError); } void *pData = ::LockResource(hGlobal); if (!pData) { const DWORD lastError = ::GetLastError(); throw CWin32Exception( _T("WriteResourceToFile() - LockResource"), lastError); } const DWORD bytes = ::SizeofResource(hModule, hResource); DWORD bytesWritten = 0; if (!::WriteFile(hFile, pData, bytes, &bytesWritten, 0)) { const DWORD lastError = ::GetLastError(); throw CWin32Exception( _T("WriteResourceToFile() - WriteFile"), lastError); } if (bytesWritten != bytes) { throw CWin32Exception( _T("WriteResourceToFile() - WriteFile"), _T("Wrote less bytes (") + ToString(bytesWritten) + _T("( than expected: ") + ToString(bytes)); } }
0.777778
FindResource(), LoadResource, LockResource and SizeofResource.