summary
stringlengths
15
147
text
stringlengths
1
19.3k
answer
stringlengths
32
22.6k
labels
float64
0.33
1
answer_summary
stringlengths
5
164
Is lots of red juice normal when making sous-vide steak?
So I made a 1lb hanger steak via sous-vide the other day and cooked it for 45 minutes at 130F. After I seared in a cast iron pan, I took the meat off of the pan and let it sit for a few minutes and then sliced it up(against the grain) into smaller portions. I noticed a lot of red juice in the plate as I was slicing it up but after I put it on a plate and it was sitting at the table, the meat almost ended up swimming in red juice. When I order medium rare steak at a restaurant and it comes out pre-sliced, I don't usually notice this much red juice. Is this normal? UPDATE: Found this great article explaining what was going on: http://www.seriouseats.com/2009/12/how-to-have-juicy-meats-steaks-the-food-lab-the-importance-of-resting-grilling.html#continued He has another article about sous vide ( http://www.seriouseats.com/2010/03/how-to-sous-vide-steak.html ) where he claims that you don't need to let the meat rest after searing. This is the one that originally led me to not need to rest the steak. Looks like there is some resting that is required. Will post up with results next time I make some steak.
Usually a steak at a restaurant is allowed to "rest" for 10 minutes before being served, perhaps that helps? Also, cooking in a normal method gives more opportunity for moisture to escape. OK, I'm just winging it, I don't have a sous-vide set up yet.
1
Cooking in a normal method gives more opportunity for moisture to escape .
numpy float: 10x slower than builtin in arithmetic operations?
EDIT: I rerun the code under the Windows 7 x64 (Intel Core i7 930 @ 3.8GHz). Again, the code is: from datetime import datetime import numpy as np START_TIME = datetime.now() # one of the following lines is uncommented before execution #s = np.float64(1) #s = np.float32(1) #s = 1.0 for i in range(10000000): s = (s + 8) * s % 2399232 print(s) print('Runtime:', datetime.now() - START_TIME) The timings are: float64: 16.1s float32: 16.1s float: 3.2s Now both np floats (either 64 or 32) are 5 times slower than the built-in float. Still, a significant difference. I'm trying to figure out where it comes from. EDIT: Thank you for the answers, they help me understand how to deal with this problem. But I still would like to know the precise reason (based on the source code perhaps) why the code below runs 10 times slow with float64 than with float. EDIT: numpy.float64 is 10 times slower than float in arithmetic calculations. It's so bad that even converting to float and back before the calculations makes the program run 3 times faster. Why? Is there anything I can do to fix it? I want to emphasize that my timings are not due to any of the following: the function calls the conversion between numpy and python float the creation of objects I updated my code to make it clearer where the problem lies. With the new code, it would seem I see a ten-fold performance hit from using numpy data types: from datetime import datetime import numpy as np START_TIME = datetime.now() # one of the following lines is uncommented before execution #s = np.float64(1) #s = np.float32(1) #s = 1.0 for i in range(10000000): s = (s + 8) * s % 2399232 print(s) print('Runtime:', datetime.now() - START_TIME) The timings are: float64: 34.56s float32: 35.11s float: 3.53s Just for the hell of it, I also tried: from datetime import datetime import numpy as np START_TIME = datetime.now() s = np.float64(1) for i in range(10000000): s = float(s) s = (s + 8) * s % 2399232 s = np.float64(s) print(s) print('Runtime:', datetime.now() - START_TIME) The execution time is 13.28 s; it's actually 3 times faster to convert the float64 to float and back than to use it as is. Still, the conversion takes its toll, so overall it's more than 3 times slower compared to the pure-python float. My machine is: Intel Core 2 Duo T9300 (2.5GHz) WinXP Professional (32-bit) ActiveState Python 3.1.3.5 Numpy 1.5.1 END OF EDIT ORIGINAL QUESTION: I am getting really weird timings for the following code: import numpy as np s = 0 for i in range(10000000): s += np.float64(1) # replace with np.float32 and built-in float built-in float: 4.9 s float64: 10.5 s float32: 45.0 s Why is float64 twice slower than float? And why is float32 5 times slower than float64? Is there any way to avoid the penalty of using np.float64, and have numpy functions return built-in float instead of float64? I found that using numpy.float64 is much slower than Python's float, and numpy.float32 is even slower (even though I'm on a 32-bit machine). numpy.float32 on my 32-bit machine. Therefore, every time I use various numpy functions such as numpy.random.uniform, I convert the result to float32 (so that further operations would be performed at 32-bit precision). Is there any way to set a single variable somewhere in the program or in the command line, and make all numpy functions return float32 instead of float64?
The answer is quite simple: the memory allocation might be part of it, but the biggest problem is that arithmetic operations for numpy scalars is done using "ufuncs" which are meant to be fast for several hundred values not just 1. There is some overhead in choosing the correct function to call and setting up the loops. Overhead which is un-necessary for scalars. It was easier to just have the scalars be converted to 0-d arrays and then passed to the corresponding numpy ufunc then write separate calculation methods for each of the many different scalar types that NumPy supports. The intent was that optimized versions of the scalar math would be added to the type-objects in C. This could still happen, but it never has happened because no-one has been motivated enough to do it. Possibly because the work-around is to convert numpy scalars to Python scalars which do have optimized arithmetic.
0.777778
arithmetic operations for numpy scalars are done using "ufuncs" which are meant to be fast
Gaussian blur - convolution algorithm
My program uses graphics convolution, an algorithm that processes pixels to make them round, soft and blurred. This particular algorithm is well-known, but its slowing down the operation of the whole program. Can you suggest any improvements of this algorithm? I tried following from here, especially "ultimate solution" all the way to the bottom of that page, hoping to reduce the number of for loops one within another, but it did not work. import perceptron.DoubleBuffer.ImageRenderContext; import util.ColorUtility; import java.awt.image.DataBuffer; public final class Convolution { DoubleBuffer buffer; int[] d; int s, h, e; int[] temp; /** * Constructs new Convolution using the convolution degree and DoubleBuffer as input parameters. * * @param std * @param b */ public Convolution(int std, DoubleBuffer b) { s = 2 * std; h = s / 2; e = 256 / h; d = new int[s]; buffer = b; for (int i = 0; i < s; i++) { d[i] = (int) (256 * gaussian(i - s / 2, std)); } temp = new int[b.buffer.W * b.buffer.H]; } /** * Optimized power function. Poor quality? */ public static double power(final double a, final double b) { final long tmp = (Double.doubleToLongBits(a) >> 32); final long tmp2 = (long) (b * (tmp - 1072632447) + 1072632447); return Double.longBitsToDouble(tmp2 << 32); } /** * Optimized exponent function with little benefit. */ public static double exponent(double val) { final long tmp = (long) (1512775 * val + (1072693248 - 60801)); return Double.longBitsToDouble(tmp << 32); } /** * Calculate the Gaussian for blurring. * * @param x * @param sigma * @return */ static double gaussian(float x, float sigma) { return exponent(-.5 * (x * x) / (sigma * sigma)) / (sigma * 2.506628); //return exponent(-.5 * pow(x / sigma, 2)) / (sigma * sqrt(2 * PI)); //return exp(-.5 * pow(x / sigma, 2)) / (sigma * sqrt(2 * PI)); // actual equation } /** * Process the loaded buffer (image). * * @param amount */ public void operate(int amount) { ImageRenderContext source = buffer.output; DataBuffer sourcebuffer = buffer.output.data_buffer; DataBuffer destbuffer = buffer.buffer.data_buffer; if (buffer.convolution != 0) { int W = buffer.output.W; int H = buffer.output.H; int Hp = H - h; // Do X blur int i = 0; for (int y = 0; y < H; y++) { for (int x = 0; x < W; x++) { int Y = 0, G = 0; for (int k = 0; k < s; k++) { int c = source.get_color_for_convolution.getColor(x + k - h << 8, y << 8); int w = d[k]; Y += w * (c & 0xff00ff); G += w * (c & 0x00ff00); } temp[i++] = (0xff00ff00 & Y | 0x00ff0000 & G) >> 8; } } // Do Y blur i = 0; int notamount = 256 - amount; for (int y = 0; y < h; y++) { for (int x = 0; x < W; x++) { int Y = 0, G = 0; for (int k = 0; k < s; k++) { int y2 = (y - h + k + H) % H; int c = temp[x + W * (y2)]; int w = d[k]; Y += w * (c & 0xff00ff); G += w * (c & 0x00ff00); } int c1 = (0xff00ff00 & Y | 0x00ff0000 & G) >> 8; int c2 = sourcebuffer.getElem(i) << 1; int r = ((c2 >> 16) & 0x1fe) - ((c1 >> 16) & 0xff); int g = ((c2 >> 8) & 0x1fe) - ((c1 >> 8) & 0xff); int b = ((c2) & 0x1fe) - ((c1) & 0xff); r = r < 0 ? 0 : r > 0xff ? 0xff : r; g = g < 0 ? 0 : g > 0xff ? 0xff : g; b = b < 0 ? 0 : b > 0xff ? 0xff : b; c2 = (r << 16) | (g << 8) | (b); c2 = ColorUtility.average(c1, amount, c2, notamount); destbuffer.setElem(i++, c2); } } for (int y = h; y < Hp; y++) { for (int x = 0; x < W; x++) { int Y = 0, G = 0; for (int k = 0; k < s; k++) { int c = temp[x + W * (y - h + k)]; int w = d[k]; Y += w * (c & 0xff00ff); G += w * (c & 0x00ff00); } int c1 = (0xff00ff00 & Y | 0x00ff0000 & G) >> 8; int c2 = sourcebuffer.getElem(i) << 1; int r = ((c2 >> 16) & 0x1fe) - ((c1 >> 16) & 0xff); int g = ((c2 >> 8) & 0x1fe) - ((c1 >> 8) & 0xff); int b = ((c2) & 0x1fe) - ((c1) & 0xff); r = r < 0 ? 0 : r > 0xff ? 0xff : r; g = g < 0 ? 0 : g > 0xff ? 0xff : g; b = b < 0 ? 0 : b > 0xff ? 0xff : b; c2 = (r << 16) | (g << 8) | (b); c2 = ColorUtility.average(c1, amount, c2, notamount); destbuffer.setElem(i++, c2); } } for (int y = Hp; y < H; y++) { for (int x = 0; x < W; x++) { int Y = 0, G = 0; for (int k = 0; k < s; k++) { int y2 = y - h + k; if (y2 < 0) { y2 = 0; else if (y2 >= H) { y2 = H - 1; } int c = temp[x + W * (y2)]; int w = d[k]; Y += w * (c & 0xff00ff); G += w * (c & 0x00ff00); } int c1 = (0xff00ff00 & Y | 0x00ff0000 & G) >> 8; int c2 = sourcebuffer.getElem(i) << 1; int r = ((c2 >> 16) & 0x1fe) - ((c1 >> 16) & 0xff); int g = ((c2 >> 8) & 0x1fe) - ((c1 >> 8) & 0xff); int b = ((c2) & 0x1fe) - ((c1) & 0xff); r = r < 0 ? 0 : r > 0xff ? 0xff : r; g = g < 0 ? 0 : g > 0xff ? 0xff : g; b = b < 0 ? 0 : b > 0xff ? 0xff : b; c2 = (r << 16) | (g << 8) | (b); c2 = ColorUtility.average(c1, amount, c2, notamount); destbuffer.setElem(i++, c2); } } } else { buffer.buffer.data_buffer = buffer.output.data_buffer; } } }
I think the custom power/exponent methods are a probably waste of time when Math.pow and Math.exp would do just as well in this context. The X/Y passes can be identical except the direction the bell curve is applied in. I'm assuming the extra passes are to handle the edges, but I think you might come out ahead by just doing 2 passes and perform clipping as you go. I think I see some bit-hacking tricks to avoid some divides after going through the inner multiplication loops. I'm not convinced that doing this and going through all the averaging stuff is going to be faster than just doing two simple passes using multiples in the inner loop and 3 integer divides when the loop is complete. Some multiplies can also be eliminated when writing to the temp array by making another array containing the offsets for each row. Like this: temp = new int[w * h]; row = new int[h]; // make row offsets for(int i = 0; i < h; i++) row[i] = w * i; // write a pixel temp[x + row[y]] = color; // read a pixel color = temp[x + row[y]]; Try to avoid calling methods within the X loops, they probably have a bigger overhead than you want for this.
1
X/Y passes can be identical except direction the bell curve is applied in
How long does it take for backlinks to appear?
How long does it take for backlinks & linkjuice to appear in your link profile and have an effect?
However long it takes for Google to find them and then process them. Google crawls different websites at different rates. This website is crawled constantly. New pages show up in Google's index in seconds. So links found on this page are available to Google's algorithm almost immediately. Pages on a personal website that has few links and little content will be crawled infrequently so links on those pages will not be found by Google for weeks or months. Google supposedly is constantly running its ranking algorithm so theoretically as links are found they should have an effect on a web page's rankings. But who really knows how often ranking calculations are performed? Plus who knows when data is actually factored into a rankings calculation? It may vary like crawl rate does. So the answer is: it depends and varies a lot.
1
Google is constantly crawling different websites at different rates
Larger cylinder volume, but less power, how?
KTM Duke 200 which has an engine of 200 cc, and, on the other hand, Royal Enfield Bullet 350 with a 345 cc engine. I.e. Enfield has 150 cc more than the Duke. But KTM produces 25 BHP of power, whereas Enfield only 19 BHP. How is it so? Form WikiPedia: Brake horsepower (bhp) is the measure of an engine’s horsepower before the loss in power caused by the gearbox, alternator, differential, water pump, and other auxiliary components So it’s not gear box or final drive that makes it more powerful.
There are two sides to the design and efficiency coin. As a rule of thumb, more modern motors would have better characteristics due to general improvements in manufacturing (machining tolerances are smaller, for instance), and engineering. Liquid-cooled motors are more efficient, as a rule, than air-cooled, and so forth. However, there are also other considerations. For instance, I have a 250 cc standard motorcycle (Suzuki TU250X). It uses the same basic engine that Suzuki used on its small DR dual-sports, GN standards, and GZ cruisers since early 80s. However, for the new fuel-injected version that Suzuki introduced in the last few years, the newly re-designed top end (cylinder and head) caused it to make less horse-power than earlier carburetted versions (16 v. 20). Why so? There are multiple factors for such re-design. First of all, the amount of valves were reduced from four to two. Obviously, it would reduce power, because the more, and the bigger the valves, the more air-fuel mixture can be brought in and out. However, the less valves means less maintenance. And for a commuter motorcycle, fuel economy was more important than sheer power. Design of the valve openings and cam shaft was also rethought to produce more useful power band for this motorcycle. Having high theoretical horsepower does not mean that that power is readily available. Small sport-bikes and sport-like bikes like Duke, CBR250R or Ninja 250 capable of a lot more horsepower (25‒27 in stock form), however that horsepower is available at high RMP (8000‒10 000 or thereabouts), and in regular street riding it is never achieved, unless some one races by overreving the motor on lower gears. TU250X engine is designed to give mild and more even power band, that does not peak as high, but allows more useful power and torque at lower RPM one would use most often in regular urban traffic. As a result, this bike would not win any races and it takes awhile to get up to high speed (though people pushed it past 135 km/h (85 mph) while drafting), but it is a very capable commuter and easily allows over 200 kg of useful load (rider, passenger, and some gear). Likewise, Bullet 350 affected by two of these factors: it has very old engine that harkens from 1950s, and it is a standard motorcycle workhorse that is designed for commuting, and not racing. Even the brand new RE 500 cc unit-construction engine with EFI is not that powerful for the same reason.
0.777778
Motors are more efficient than air-cooled, and so forth.
Important non-technical course for programmers?
What kind of non-technical training course do you suggest for a programmer? Example could be public speaking course, presentation skill, English, business writing, or anything not related to programming or software engineering itself.
Law There are many subjects that a computing professional should know, indeed our profession, like most business consultancy professions, requires a substantial breadth of knowledge across all the domains we encounter and analyse. However, law is the one I would single out as a necessity. Our profession is on the front-line of a rapidly changing legal framework, intellectual property is the well known example, but there are all manner of legal issues that crop up day-to-day. Regulatory compliance, valid and invalid contractual clauses, credit law, if you work in e-commerce, data protection. I think all IT professionals, and certainly senior software engineers should have basic legal training and follow applicable law in their areas. My university had it on the compulsory syllabus for master's students for computing, it comes in handy regularly. The usual riposte is that "the legal department handles that", yes well, they may not be aware an issue created by software exists unless the staff there have sufficient awareness to notify them of it - plus, it is usually the source that has their head on the chopping block.
1
IT professionals should have basic legal training and follow applicable law in their areas .
Improve on an after_create callback with database queries - Ruby on Rails
First, some background. I have a Payment model that has_many :subscriptions. When a user pays (creates a new payment), I have an after_create callback that adds the newly created @payment.id to @subscriptions.payment_id. Here's what it looks like: def update_subscription @unpaid_subs = Subscription.where(:user_id => self.user_id).unpaid @unpaid_subs.each do |sub| sub.payment_id = self.id sub.start # call to state_machine to change state from pending -> active sub.save end end I know that doing database queries inside a loop is generally not good for performance, but I don't know any way to update multiple records at the same time. Also, is there a way to pass the @unpaid_subs instance variable from my create action to the callback (it's the same query on both) so that I can remove the query here?
Considering you have a state machine, you're probably doing the right thing by looping through the records. Although you could change all the subscriptions (including their state) in the database, you'd be bypassing the state machine and whatever checks and callbacks it has in place. But, if you really want to bypass the state machine, you could probably do something like this: unpaid_subs = self.user.subscriptions.unpaid # I'm assuming Payment belongs_to User unpaid_subs.update_attributes(:payment_id => self.id, :state => 'active') Of course, it would require you to allow mass-assignment of both payment_id and (what I assume is named) state, neither of which sound like good ideas at all. So you'd have to bypass the state machine and ActiveRecord to directly update the records in the database with some raw SQL... ugh, gross. So, as I said, you're probably doing the right thing already :)
1
Using a state machine, you're probably doing the right thing by looping through the records .
Splicing tiny wire inside broken mouse cable
I don't know a lot about electronics repairs, but I've got a relatively expensive laser mouse that got a frayed connection on the wire: I'm wanting to repair it as it's out of warranty. I've cut the cable on either side of the "stopper", isolated each of the individual wires, and stripped the ends off in preparation for splicing. I've read some instructions that indicate I should do an inline wrap and then apply some solder. Is there a better way for wires this small? Is there a particular type of heat shrink wrap I should put on this after it's spliced? Or will electrical tape suffice? Inside the mouse, the cable is connected to a little plug. To me, it looks a lot like the fan plugs inside a PC. It's got 5 pins each 1mm apart. If there were a replacement plug I could buy and crimp the wires into, that'd be great!
I disagree with Chris in that you don't just want to shorten the cable. It's not the length of cable I'm worried about, but that tiny connector you don't want to replicate. The connector and the wires immediately coming out of it look to be intact. Replacing that will be a major pain in the butt, so I'd go to reasonable length to preserve that piece. Since that piece is now short, you'll have to make a splice. Just realize up front you're not going to make a splice in such small cable that is anything like the size of the cable. The splice will be big, fat, and ugly in comparison. It looks like it can be made to serve as the strain relief too, so that helps a little. To splice such tiny wires, see if you can sortof stick the stranded ends into each other. That may take some persuasion under a magnifying light, and then some weighty objects on your bench to hold them in place while you solder. This won't be easy, but it should be doable. If that just isn't practical, give up and bend each wire into a U and hook the two U ends together, flatten them together with a needlenose, then solder. Once you have the connections made, wrap each one individually in a small piece of electrical tape, then wrap the whole bundle in electrical tape so that is looks like one fat section of cable. Like I said, big, fat, and ugly, but it should work. All that tape will act like a strain relief, so that section shouldn't break again.
1
splice in small cable: big, fat, and ugly .
What's the point in limiting the number of security groups per tenant In OpenStack?
By default, a tenant (1) can only create 10 security groups (2). Is there any reason to keep this number so low? (1) http://docs.openstack.org/grizzly/openstack-compute/admin/content//users-and-projects.html: Legacy terminology: earlier versions of OpenStack used the term "project" instead of "tenant". (2) http://docs.openstack.org/user-guide-admin/content/cli_set_quotas.html: $ nova quota-defaults +-----------------------------+-------+ | Quota | Limit | +-----------------------------+-------+ | instances | 10 | | cores | 20 | | ram | 51200 | | floating_ips | 10 | | fixed_ips | -1 | | metadata_items | 128 | | injected_files | 5 | | injected_file_content_bytes | 10240 | | injected_file_path_bytes | 255 | | key_pairs | 100 | | security_groups | 10 | | security_group_rules | 20 | +-----------------------------+-------+
The most obvious effect is to keep firewall rules to a manageable level, which does not have a significant impact on performance. At a certain point, you may end up with too many firewall rules and not enough CPU to process them quickly enough. The default limits may seem low, but they're sufficient for most people, who will never create more than a few security groups with perhaps half a dozen rules each.
1
How to keep firewall rules to a manageable level?
Getting Value Of Radio Button And Label Text Put Into Two TextField
I'm trying to get value form label (radio) and value of radio button. When I click label or radio button, they value input into their respective textfield o 1 • 2 o 3 o 4 value radio value label ____________ ______________ | 72 | | 2 | |__________| |____________| I try create on jsfiddle but not working, only value radio button insert into text field. See FIDDLE How do I create function?
The change doesn't occur on the label. You need to use the change of the radio for both. $('input[name="20"]').on('change', function() { $('input[class="20"]').val($(this).val()); $('input[class="1_20"]').val($(this).parent().text()); });
0.777778
Change of the radio
Polite alternatives to "as soon as possible"
I’ve found myself writing the phrase “as soon as possible” just too often. Sometimes I wonder if it sounds a little rude. How can I convey the same meaning in a more polite way but without losing sense of urgency?
I often need to ask for things to be returned to me. In a business setting, I have found that giving people a specific date (and sometimes a specific time) helps them. I always follow up with something like, "If you feel you need more time than that, please let me know." or "If this deadline is not feasible, please let me know." Adding that sentence shows the recipient that you are sensitive to his or her schedule. Giving a firm date helps the recipient be cognizant of your schedule. I have found writing, "when you get a chance" or "as soon as possible" leaves it too much up in the air. And, as the saying goes, if it weren't for the last minute, nothing would ever get done. Your items of business will be pushed back in the recipient's schedule and then you find yourself trying to find a polite way to write, "where's my stuff!?!"
1
Giving a specific date helps the recipient be cognizant of your schedule .
Errors when attempting to install a sharepoint 2010 feature
I'm attempting to install and activate a feature containing a Timer Job. When I execute the install-spfeature cmdlet I get the following error. What is the source of my error? PS C:\Users\crmadmin> install-spfeature AltirisOpsListFeature Install-SPFeature : Required tag 'http://schemas.microsoft.com/sharepoint/:Feat ure' is missing from XML file 'feature.xml', found 'Feature' instead. At line:1 char:18 + install-spfeature <<<< AltirisOpsListFeature + CategoryInfo : InvalidData: (Microsoft.Share...tInstallFeature: SPCmdletInstallFeature) [Install-SPFeature], ArgumentException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletInstallF eature The feature folder has been added to the 14\Template\Features directory, the Feature.xml file exists and is the following, <?xml version="1.0" encoding="utf-8"?> <Feature xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="58dce6e3-0444-4122-8aa6-08e35345e03e" FeatureId="58dce6e3-0444-4122-8aa6-08e35345e03e" ImageUrl="" ReceiverAssembly="$SharePoint.Project.AssemblyFullName$" ReceiverClass="$SharePoint.Type.bde159bf-eac9-44cd-a06a-df7bfb0e912e.FullName$" Scope="Site" SolutionId="00000000-0000-0000-0000-000000000000" Title="AltirisOpsListFeature" Version="" DeploymentPath="$SharePoint.Project.FileNameWithoutExtension$_$SharePoint.Feature.FileNameWithoutExtension$" Xmlns="http://schemas.microsoft.com/VisualStudio/2008/SharePointTools/FeatureModel" /> I appreciate any assistance.
Per was right, the xmlns was the beginning of my issue(s). I was just able to install and activate the Timer Job, yea! But, I took a different route than what I did yesterday. Initially, I copied over the feature folder to the product SP2010 hive, and edited and renamed the AltirisFeature1.feature file to Feature.xml. This was incorrect. Though with enough hacking, I was able to get the Feature.xml worthy enough to get installed and activated, the feature subfolder from my vs2010 project did not contain the necessary compiled code of the Timer Job. Yes, i was confused. To solve my problem, I deactivated and uninstalled the feature from my sp2010 production environment. I then went back into my vs2010 project and added the feature to the package and built the wsp. From there, I loaded and deployed the package to sp2010 using tested scripts. From there, I ran the get-spfeature cmdlet to confirm the feature was added to the farm, and confirmed the name. From there, I activated/enabled the feature using the enable-spfeature cmdlet. success. The timerjob is now running every 5 minutes. so, Per, thanks for the direction. I have some more learning to do.
0.888889
Installing and activating the Timer Job
My MacBook Air won't connect to wifi
I bought a new MacBook Air and was able to connect to the internet at first but now it won't connect. I have other devices as well as other computers on wifi but my Mac won't connect. When I try and click on the wifi, it tells me that it can't be joined. How can I troubleshoot?
Option click the wifi icon in the menu bar and select Wireless Diagnostics. Follow the instructions and post a second question if you get stuck with a specific step or can't narrow down the issue. Also, carefully read the help guide on how to be specific and show how your research such as what version of OS X and what router is not working as expected.
1
Option click the wifi icon in the menu bar
Where do the bodies of the dead Tributes go?
I've only seen the movie-version of The Hunger Games, and have yet to read the books. Is it explained where the bodies of the dead Tributes go, if they are removed at all?
Well, it is pretty clear overall from the books at least that the bodies in the first hunger games are picked up by hovercraft. However to more completely answer the question I would point out that Katniss thinks that the bodies of the tributes are revived (which would mean they would have to be retrieved quickly) and converted into the monsters she and Peeta have to face at the end. ...My head snaps from side to side as I examine the pack, taking in the various sizes and colors. The small one with the red coat and amber eyes…Foxface! And there, the ashen hair and hazel eyes of the boy from District 9 who died as we struggled for the backpack! And worst of all, the smallest mutt, with dark glossy fur, huge brown eyes and a collar that reads 11 in woven straw. Teeth bared in hatred.... So the mutts are likely the same tissue as existed in the tributes just revived and altered into a wolf. This is why she can recognize foxface (due to the hair).
1
Katniss thinks that the bodies of the tributes are revived and altered into a wolf .
When turning a corner my rear wheel touches the brake pad, is this normal?
I replaced my brake pads about a week ago and today I noticed that, when turning (or generally under lateral force), the rim touches one of the brake pads (depending on which way I'm turning. I hadn't noticed it before but today was the first wet day so maybe the sound was louder because of this. I don't notice myself slowing down at all, but don't really want to be unnecessarily wearing down my brakes. The brakes aren't super close when released, maybe 2-3mm on each side. I would expect a certain amount of flex in the wheel, but as I built the wheel myself I just wanted to check that this wasn't a problem with my build (though its already done 1000 miles probably so it cant be too bad!) There would be room to widen the brakes slightly if this is all that might be required. When stationary and holding the wheel and applying lateral force manually I can make the rim touch either brake pad without a great deal of effort. Any input appreciated Thanks!
You should check the wheel hubs. They may have too much free play. Take out the wheel and wiggle the axle. See Sheldon Brown's page here: http://sheldonbrown.com/cone-adjustment.html The new brake pads may be closer to the rims than the old ones so that the fault showed up.
1
Check the wheel hubs for free play
I Cancelled Microsoft 10 Reservation and uninstalled KB3035583 but Window 10 is still trying to install
I cancelled the Microsoft Windows 10 Reservation and uninstalled KB3035583, but Windows 10 is still trying to install. After I uninstalled KB3035583 and restarted my laptop as instructed, I could not find KB3035583 to hide it. Now Windows 10 is sitting in my Windows Update saying that it will install when I restart my computer.
Short Version: Use Windows' Disk Clean-up Tool to remove the installer files so that the upgrade fails (intentionally). Long Version: Uninstall KB3035583 and select the option to reboot later. Run the Disk Clean up tool and select the Clean up system files after the initial scan. Select the Temporary installation files for deletion. Once they are removed reboot your system and then check for Windows Updates once again Wait for the scheduled time to arrive because that has already been set in motion if you choose a time for the upgrade. One hour prior to that you will see a window on your screen indicating that it is almost time for the upgrade to happen. This dialog does offer you the chance to reschedule as well. Once the timer reaches zero then the system will begin the upgrade process. Following the reboot, the attempt to upgrade will fail because you removed the temporary installation files earlier in this scenario. You now need to check Windows Update and hide KB3035583 and the Windows 10 Upgrade when it is offered so they will not start again. Source for Long Version
0.888889
Short Version: Uninstall KB3035583 and select the option to reboot later
Why did Lucifer interfere with Mammon crossing over?
Why did Lucifer care about Mammon crossing over from Hell to the real world? Before coming up to drag John (literally) to Hell, he makes a detour and sends his son back to presumably prevent Hell on earth. Why would the master of Hell not want to expand his domain?
When Angela Dodson visits Constantine in his home, then leaves and Constantine follows her (approximately 36 minutes into the movie), he says the following: Constantine What if I told you that God and the Devil made a wager? A kind of standing bet for the souls of all mankind Dodson I'd tell you to stay on your meds Constantine Humor me. No direct contact with humans, that would be the rule. Just influence, see who would win. Dodson Okay, I'm humoring you. Why? Constantine Who knows? Maybe just for the fun of it, no telling. When Lucifer comes along later on and saves Dodson from Gabriel, he says Lucifer This world is mine, in time. So two reasons here: He wants to win his bet with God, and he wants to stop Mammon from taking over the world, which he considers to be his.
1
What if I told you that God and the Devil made a wager?
WLAN roaming on same, or different channel
I've setup a router in my basement, and an access point in my attic floor. They are connected with a patch cable. Both have the same SSID and WPA2 security. Roaming does work. But, what I want to know is, if I need to set them on different channels, or do they need the exact same channel to share. I've read many community forums and manuals, but yet it is not clear what to do because they have different opinions. Router: Fritz!Box 7270 Accesspoint: Netgear WN604
If you use WDS you need to use the same channel. If you use cable network between them, use different channels - roaming is based on SSID, not channel and if you've got less interference using different channels.
0.888889
WDS is based on SSID, not channel
Does adding a comma before "or" change the meaning of a phrase?
For example, the definition given from the OALD for pronoun is the following one: a word that is used instead of a noun or noun phrase, for example he, it, hers, me, them, etc. If I would rewrite it as the following, would the mean change? a word that is used instead of a noun, or noun phrase, for example he, it, hers, me, them, etc. If the meaning doesn't change, are there other differences between those phrases? Is this just an example of using the Oxford comma, or is there something different/more? I am asking because I rephrase a similar phrase, and I was said it was more correct without the comma.
Regarding general usage (in the U.S., at least), I would encourage leaving out the comma.  For example, You can have any kind of a pet except for a dog or a terrier. is nonsense.  But You can have any kind of a pet except for a dog, or a terrier. means (or could be taken to mean) You can have a pet cat, ferret, rabbit, or a terrier –– but not any other kind of dog. So you may have introduced confusion into the other phrase where you added the unnecessary comma.
1
You can have any kind of pet except for a dog or a terrier
Combine multiple unix commands into one output
I need to search our mail logs for a specific e-mail address. We keep a current file named maillog as well as a week's worth of .bz2 files in the same folder. Currently, I'm running the following commands to search for the file: grep [email protected] maillog bzgrep [email protected] *.bz2 Is there a way combine the grep and bzgrep commands into a single output? That way, I could pipe the combined results to a single e-mail or a single file.
Here's another way to do it (assuming you're running bash, which you probably are): cat <(bzgrep ...) <(grep ...) Here bash is transparently feeding the output of the bzgrep and grep commands into cat as if they were files (and they sort of are under the hood, details in url at the bottom). In your particular case I'd recommend Phil's solution, but the above is a good trick to keep in your bag. If you're interested, you can read more here: http://www.tldp.org/LDP/abs/html/process-sub.html
0.666667
Bash is transparently feeding the output of bzgrep and grep commands into cat .
What's the maximum will a soldier can have per rank? How much willpower does an operative gain per rank?
I'm trying to make a squad of superhumans to fight the alien scum. To that end I would like to maximize my soldiers' will by reloading at the end of the mission until I'm satisfied with the result. How much will can an operative gain per rank? What's the maximum will a soldier can have at each rank up? Bonus questions: how likely is a soldier to get the maximum will increase when ranking up? What about high rank soldiers that come as mission rewards?
According to the wiki: Soldiers also gain a randomized 2-6 point Will bonus for each rank; if the Iron Will upgrade is purchased this bonus is increased to a possible 4-12 points. You can further boost this by using some of the Second Wave option, "Not Created Equally", to randomize starting stats: On one hand a Rookie can start out with a Will stat of 59 and Aim of 80 which is significantly better than the standard stats while on the other hand you can also end up with one with a Will of less than 30 and Aim less than 60 which is substantially worse than standard. Note that this setting does not affect HP, but it does affect Speed - a hidden attribute that is otherwise constant throughout the game.
0.888889
The wiki: Soldiers also gain a randomized 2-6 point Will bonus for each rank
Please advise on check gauges light on and battery gauge reads zero
Saw this thread while investigating what sounds like the same problem with my jeep. The check gauge light came on and my battery gauge bottomed out. But weird thing is, it ran fine. I drove it a few miles home, and turned it off, then started it again and the same thing happened real quick. What should I approach first since it's running ok. I do have some rust damage underneath. This jeep came from Detroit so its been in salt and snow for a long time, I just bought it and this is the first time its done anything weird. I could have a corroded connection or should I go right at Alternator being the culprit. Thanks in advance for any advice,this is my first Jeep
Yes, your alternator is the culprit as the engine is running on battery power. Before you purchase a new one, though, take it to your local Autozone, Pepboys, Checker, or the like and have them test it. They will do it for free. I take it since you didn't say the steering became hard, that the serpentine belt is still running correctly. If it was difficult to steer, this would be the issue.
1
Autozone, Pepboys, Checker, or the like.
Setting up a storage server to replace Dropbox
We are a non-profit organisation in education sector dealing with a lot of external stakeholders including the government. As such, we work with a lot of documents every day including: Office documents (Word, Excel, and PDF). Large media files (photos and videos). Our team often need to share documents with each other so we resort to Dropbox for file sharing AND backup. Office documents are okay, but problem arises when the media files got too big but aren't used as much, taking up bandwidth for nothing. Is there a smarter and cheaper way to do this? A consultant advises us to use a VPN, so remote staffs can can log in to the server and download/upload documents. How would this affect the Internet connection in the office, especially when huge files are being transferred? Would it be possible to set different permission levels?
Go take a look at OwnCloud. It works really well. Linux/Windows/Mac/Android/iOS supported. Completely opensource and free with an option of getting the commercial edition as well. http://owncloud.org/
1
Opensource and free with the option of getting the commercial edition as well.
Is the ability cost of the commander part of the color identity?
Consider the card Rhys the Exiled. Are you allowed to play black (and green) cards in your deck with this commander? Or are you only allowed to play cards that are the same color as the commander's cost? If so, would this then make it impossible to use his ability?
The colour identity of Rhys the Exiled is Green and Black. As per the Commander colour identity rules: A card's colour identity is its colour plus the colour of any mana symbols in the card's rules text. The colour doesn't have to be just in the casting cost (which determines the card's colour), any mana symbol cost in the rules text counts towards the card's colour identity. See also Comprehensive Rule 903.4: 903.4. The Commander variant uses color identity to determine what cards can be in a deck with a certain commander. The color identity of a card is the color or colors of any mana symbols in that card's mana cost or rules text, plus any colors defined by its characteristic-defining abilities (see rule 604.3) or color indicator (see rule 204). Example: Bosh, Iron Golem is a legendary artifact creature with mana cost {8} and the ability "{3}{R}, Sacrifice an artifact: Bosh, Iron Golem deals damage equal to the sacrificed artifact's converted mana cost to target creature or player." Bosh's color identity is red.
0.888889
Colour identity of Rhys the Exiled
Current passing through me from Macbook to iMac?
I recently bought a UPS for my iMac and it runs just fine. However, sometimes I also run a MacBook Pro nearby and when I have my hand in contact with the MacBook and reach across to touch the aluminium keyboard attached to my iMac I can feel electricity running through my finger! It doesn't happen when the MacBook is running on battery power, only when it's connected to the mains. It also doesn't happen when the UPS isn't connected. The MacBook Pro is plugged into a standard wall outlet, the iMac is plugged into a UPS and that's in a similar wall outlet (not the same one). I'm not very electrically minded, so am puzzled as I'd like to plug the MacBook into the mains again! Does anyone have any ideas as to why it's happening and how I can fix the problem?
Usually, ground loop current is experienced on portables where often no ground wire is connected - just the neutral and live (or hot) wires. If you are using a grounded plug and feel ground loop current you should either have the outlet serviced or the computer serviced. It's normal (and safe) for ground loop current to exist and feel lightly tingly on Macs with magsafe connectors and only DC power going in to them. It's harder to be sure an iMac or other device that has 110/220 AC power directly into the case, so I would rather be too cautious and have you get an electrician to look at the outlet if your Mac works properly on other outlets or a technician to look at the Mac if it leaks current no matter which receptacle you plug it in to. You might be able to find a grounding issue and solve this yourself, but if you have any doubts as to safety, I'd rather you chose to get expert help rather than trust our guesses based on how things should work. See: Is grounding important? Electricity coming through screws, USB, and headphone jack on 2009 MacBook How can I avoid my MacBook Pro giving me minor shocks? Is it bad that my MacBook Air is passing me electricity? And note that all the MacBook questions are low risk situations where any iMac one would be a little more danger (potentially).
1
Ground loop current on Macs with magsafe connectors and only DC power going in to them
Copy file from web to Google Drive
There is a document on the web that I want to store in my Google Drive. The only way I know to do this is saving the document on my computer and then upload it again to my Google Drive. Is there a more straightforward way to do this?
Try this IFTTT receipt. Upload file from URL This Action will download a file at a given URL and add it to Google Drive at the path you specify.
0.888889
Upload file from URL This Action will download a file at a given URL
How do I repair a floor joist which has a hole drilled less than 2 inches from the bottom?
I have three floor joists that have approximately 1/2 inch hole in them less than 2 inches from the bottom. Is there a recommended fix or approved method to correct this to meet code? These joists are in excellent condition otherwise. Someone drilled through them years ago to run cable through. There are other holes above 2 inches on other joists.
Whilst not a direct answer this thread will give you all the detail you require: http://www.homeownershub.com/uk-diy/filling-holes-in-joists-280701-.htm I'd advise leaving them alone if no sagging has occurred.
1
Leave holes alone if no sagging has occurred
How to prevent the "Too awesome to use" syndrome
When you give the player a rare but powerful item which can only be used once but is never really required to proceed, most players will not use it at all, because they are waiting for the perfect moment. But even when this moment comes, they will still be reluctant to use it, because there might be an even better moment later. So they keep hoarding it for a moment which will never come. In the end, they will carry the item around until it is outclassed by other, more readily available resources, or even until the very end of the game. That means that such one-shot items don't provide any gameplay-value at all. They are simply too awesome to use. What can you do to encourage the player to make use of their one-shot items and not hoard them?
The most common reason for hoarding it is that the user doesn't know what is the best time to use it. so, one simple way is to name it in such a way to make it obvious where its best use lies. The more generically powerful an item is, more the likelihood that the user will hoard it as he cannot zero in on its optimal use.
0.666667
the more generically powerful an item is, the more likely the user will hoard it as he cannot zero in on its optimal use
Using nofollow when crosslinking my own sites
I have 20 sites in the same domain, different niches and I want to interlink them for USER EXPERIENCE. I want to know from someone who tested this: Will using a nofollow attribute for the links keep the sites safe from google link scheme penalties?
Nofollow SHOULD help from a pure outbound/inbound link perspective, but I haven't tested this personally. If Google isn't seeing site B sending site A links, you should be good. But I think there's more to it than just blindly saying if StackExchange is doing it, there isn't a problem if you do link them all to each other. I think you have to weigh multiple factors, three of which are the type (of content) of sites in your network, their subject matter, and the number of links created. Is all the content created by you? Is it an aggregator site? Is it a Blogger site with copy and pastes from other sites, with nothing but Adsense on it? If the content is original, you're better off, but I don't think completely safe from penalties. As Aurelio De Rosa mentioned above, linking sites with similar subject matter will be more beneficial than just linking all 20 very different sites together. And if we're only talking about a small percentage of your overall inbound links, it probably won't hurt. I'm facing a similar issue with my network of sites (all related to one industry) that you're trying to avoid. It's made up of 6 sites, of which 4 are included in the footer of every page on those 4 sites. After Googles April/May algorithm update, we saw a dramatic decrease in keyword rankings and actually dropped off the first 10 pages completely for a couple of them (after being on the first page). We received warnings from Google that our page exhibited "unnatural inbound links", of which 2 of the 4 sites I mentioned numbered 350K+ inbound links. One of those sites is a news aggregator, all others are UGC and original content. After making changes and submitting a couple reconsideration requests, we're still seeing the warnings. Our next test is the nofollow approach you suggested. We'll start by reducing those 350k links by some percentage and hope for something positive from Google.
0.888889
Nofollow is a pure outbound/inbound link aggregator site
anchor tag with span inside is not clickable
I am using a span inside anchor tag which are inside <li>. Due to some unknown reason, one anchor tag is clickable and other is partially clickable (only the <span> part). Below is the code: <div id="catIcons"> <ul class="catList"> <li><a href="" title="" class="catAir"><span>Travel & Airline</span></a></li> <li><a href="" title="" class="catEcom"><span>eCommerce & Coupons</span></a></li> </ul> <ul class="catList"> <li><a href="" title="" class="catSearch"><span>Classifieds </span></a></li> <li><a href="" title="" class="catSocial"><span>Social Media & UCG</span></a></li> </ul> <div class="clear"></div> </div> CSS Used: .catList{width:142px; float:left; margin:0 7px 0 0;list-style:none;padding:0;} .catList li{margin-bottom:5px;} .catList li a{display:block;padding-top:60px;} .catList li span{font-size:11px;font-weight:normal; color:#fff; text-align:center; padding:2px 0; margin:0 auto; display:block; background-color:#2A79B2; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} .catAir{background:url('/images/category_icons.jpg') no-repeat 44px 8px;} .catEcom{background:url('/images/category_icons.jpg') no-repeat -492px 8px;} Please refer to this link for more information: http://184.106.132.165/index.php Thank you
Try assigning a value to the href attribute on each anchor. For example: <a href="#" title="" class="catAir">...</a>
0.777778
assigning a value to the href attribute
Google Apps login in wordpress
I manage a google apps domain with plenty of users; I would like to join Google apps with a Wordpress based intranet app we're creating. Which level of integration could I expect to achieve? Our hope is to create users in wordpress using their google apps email and let them login using their google apps password, so that they don't need to remember two different passwords. How would you suggest we should implement this?
This question was asked a while ago, but for anyone else facing this problem, we have developed a plugin that allows users to login using the latest Google OAuth2 without needing a separate WordPress password. Google Apps Login is designed specifically for intranets (or any WordPress site) where the organization is running their email entirely on Google Apps. http://wordpress.org/plugins/google-apps-login/ The plugin is fully supported, through support licenses and a premium version which can save you a lot of time on user management - domain admins no longer need to separately manage WordPress user accounts.
1
Google Apps Login allows users to login using the latest Google OAuth2 without having a separate WordPress password
Does this statement make any sense?
I am asking this question completely out of curiosity. The other day, my roommate, by mistake, used 'Light year' as a unit of time instead of distance. When I corrected him (pedantic, much), he said the following: "Units are relative. And according to Fourier Transforms, units can be changed so Light year is a unit of time." That got me thinking and I read up Fourier Transforms on wikipedia but couldn't find anything about using a unit in one domain as a unit for another measurement. I do agree that units (particularly, base units are relative. eg: the meter), but does his statement make any sense? EDIT Thank you everyone for all the answers. It isn't so much to in it in or prove a point as it is to understand the concept better. Anyways this is his response after I showed him this thread. Any comments would be appreciated. His response: Nevermind, for the first time I accept I was wrong. BUT using lightyears to measure time is possible. My example didn't make sense bacause I was wrong when I meantioned that I'm still measuring dist. If you have a signal in time domain and ...take the FT, I get a signal which DOES NOT HAVE to be in frequency domain. Clarify this to the guy who posted last. Now the new signal is in a domain defined by me and so is its units. This signal although not equal to the original signal, still represents that if ya take an inverse FT. So, the idea of time will still be there. Now coming back to our case: lightyears here is not the lightyears you are used to read when dealing with distance. It represents time.
His response: Nevermind, for the first time I accept I was wrong. BUT using lightyears to measure time is possible. It's possible if you rape physics, definitions, and just organize things so that you actually, in the end, obtain time from dimensional analysis. The idea would go along this line of reasoning: I know a man walks 5 km/h, hence space is a unit of time because I can say 10 km is equivalent to two hours, hence I can measure time by specifying a distance. Let's meet in 5 kilometers at the pub 200 meters from here. But that's not a unit definition. it's just a deep misrepresentation of concepts: using this approach, you can define everything in terms of anything else, assuming there's a relationship among them. you could define time in terms of weight of apples a man can move from the tree to a box. Also, the whole setup is pretty circular in definition. You define time as space traveled by something at a constant speed for a defined time, so in the end your pulled you own bootstraps. My example didn't make sense bacause I was wrong when I meantioned that I'm still measuring dist. If you have a signal in time domain and ...take the FT, I get a signal which DOES NOT HAVE to be in frequency domain. A Fourier transform is nothing but finding the coefficients of a linear combination of plane waves. When you find these coefficients, you can express the original function as the linear combination of these coefficients and a plane wave. If you note, there's a unit relationship between the domain before the FT and after. seconds -> seconds^(-1) = Hz. So even if you want to do fourier decomposition of a space-based periodic or aperiodic system, the resulting domain will be in meters^(-1), which is eventually a wave number. Clarify this to the guy who posted last. Now the new signal is in a domain defined by me and so is its units. Nope, it just turns out from the dimensional analysis that this is not the case. Clearly, you can always transform your frobbles units into Hertz through an ad-hoc transformation you invent (see the man-apples above) but that would still not change the final dimensional analysis of your FT, and you would, in any case, introduce an arbitrary constant (in our case above, the walking speed) which, in the end, likely produces a circular definition. This signal although not equal to the original signal, still represents that if ya take an inverse FT. So, the idea of time will still be there. Now coming back to our case: lightyears here is not the lightyears you are used to read when dealing with distance. It represents time. Lightyears is a measure of distance. It is a product of two well defined constants: the speed of light and a well defined amount of time. Simple dimensional analysis tells you it's a distance. Edit: non-tech note. there's nothing wrong not to know things. Tell your friend it's not my intention to mock him. There's, however, something wrong to pretend to be right through misunderstood justification. It looks like he is mature enough to understand he is wrong, which is the spirit we should all live with. I hope my answers clarifies his doubts. Note that I could be wrong myself. I don't know the technicalities of standard unit definitions, and my exposition could be patched by someone who knows more than me on this field. The approximation I present here is good enough for the purpose of explanation, but it is wrong nevertheless when we go down to the gritty details, and I am ready to accept criticism on this regard. This is how we progress.
0.777778
Lightyears is a measure of distance .
How do I list all files a given grunt task depends on for a Makefile?
As Grunt doesn't support only rebuilding what has changed, I'd like to wrap a Makefile around it, to just compute the set of "input" files and not invoke grunt at all, unless any of them have changed since last build. Can you tell grunt to just list what files a given task would depend on on stdout somehow?
Based on jsoverson's answer, I managed to cobble together a proof-of-concept that defers dependency tracking to the Gruntfile, so I can add Makefile rules that invoke the grunt bits to build the project. This project uses coffee-script (use http://js2coffee.org/ to convert to js if you want to reuse this for some non-coffee project), so in my Gruntfile.coffee I added gruntGetPaths = (fn) -> -> taskConfig = grunt.config @args.join '.' grunt.task.normalizeMultiTaskFiles(taskConfig) .forEach fn ? (files) -> files.src.forEach (path) -> console.log path grunt.registerTask 'src', gruntGetPaths grunt.registerTask 'dst', gruntGetPaths (files) -> console.log files.dest giving me the grunt src:... and grunt dst:... rules that produce grunt-junk-wrapped file lists. It seems the junk is guaranteed to be colorized / adds a trailing empty line (at least with grunt v0.4.1 / grunt-cli v0.1.9), so chopping that off by piping their output to egrep -v '\e|^$' worked. Near the top of my Makefile I added some macros for that: define GRUNT $(shell grunt --no-write $1 | egrep -v '\e|^$$') endef define SRC $(call GRUNT,src:$1) endef define DST $(call GRUNT,dst:$1) endef ...and then rules that borrow knowledge from the Gruntfile: $(call DST,stylus:compile): coffee $(call SRC,stylus:compile) grunt stylus $(call DST,coffee:glob_to_multiple): coffee $(call SRC,coffee:glob_to_multiple) grunt coffee $(call DST,uglify:my_target): coffee $(call SRC,uglify:my_target) grunt uglify coffee: npm install 2>&1 | tee $@ ...which has corresponding setup looking like this: @initConfig pkg: grunt.file.readJSON "package.json" stylus: compile: options: paths: ["src/stylus/"] import: ["nib"] files: "stylesheets/foo.css": "src/stylus/foo.styl" "stylesheets/foo-dev.css": ["src/stylus/foo.styl", "src/stylus/foo-dev.styl"] coffee: glob_to_multiple: expand: true cwd: 'src/coffee/' src: ['*.coffee'] dest: 'javascripts/' ext: '.js' uglify: my_target: files: "javascripts/foo.min.js": ["javascripts/foo.js"] This works, but is slow. Given a bare grunt stylus run that takes 2.94s to run, running these make rules to regenerate css takes another 5.41s of pure overhead, which is sort of horrible - and if I nuke all the generated files and try to regenerate the min.js, there is no dependency resolution as the glob rules can't be traced back to find all intermediate files. So while it's possible to do this, it did not end up being a solution to the problem "running grunt is slow and stupid, when no source files have changed", as running grunt stylus coffee uglify in this project takes 3.25 seconds to reproduce what was already there, and a bare make run that just resolves dependencies and finds nothing relevant changed takes over five. It would of course be great if grunt had its own dependency management to know when it can exit immediately, like our grandfather's tools would. :-)
0.888889
How to defer dependency tracking to the Gruntfile?
How does the colour of ambient lighting affect colour rendition?
How does the colour of ambient lighting affect colour rendition? For example: If I stand under a sodium-vapour (orange) streetlight and calibrate my camera's white balance, what effect would this have if I were to take a photo of a colour test chart? Presumably, white would still render as white due to the white balance calibration, but how would other colours be rendered? How would the result differ under primary and secondary coloured lighting, e.g. a red or yellow light? Thanks.
mattdm has it spot on - it's not the colour temperature that matters, it's the width of the spectrum. Here are some examples that illustrate the difference nicely. Here's an image I shot a while ago at a bonfire. Straight of camera, without the white balance set it looks massively orange: And here's an image shot just now under sodium vapour streetlights (I spent a while looking for any image I'd shot under streetlights, which number very few until I realised I just had to step out my front door!) Looks similar. But if you play with the white balance in the first image, you can pull it back to somewhere near neutral. This is because the fire being an incandescent (hot) lightsource, emits a broad spectrum. It just happens to be centred on yellow rather than white like sunlight (which is another incandescent source, but much hotter!). We can simply shift the colours to obtain something more similar to daylight: Now you can now make out the difference between foliage, skintones and denim. The streetlight image, on the other hand is lit with a fluorescent lightsource. These lights emit very narrow frequency spikes, the light is not just centred on orange, it's orange alone and no other colour! If you try to shift it so the spectrum is centred on white like we did with the bonfire image, we end up with this: Which is effectively monochrome, even after massive saturation boost - the colours just aren't there. The apparent colours at the top and bottom are actually a lens defect that's been brought out due to the lack of colour information and exaggerated by the saturation boost (+50 in Adobe Camera Raw). For completeness here's a Gretag MacBeth colour rendition chart shot under the same streetlight. White balance was set in ACR based on the "grey" tile: As you can see the image might as well be monochrome. No amount of gelling of the light, or white balance adjustment can save the image. The colour information simply is not present! If you only have line spectra, all that you'll get back is how much of that particular frequency your subject reflects. Getting technical, colour is a vector-valued variable, that is it consists of several coordinates in the colour space. You can't record a point in colour space with a single value (just like you can't describe your point on a map with one value) which is what you have when you illuminate your scene with only one wavelength of light. This is why fluorescent lights are bad, many of them emit very narrow spectra (though broader than your average streetlight). In particular many are missing a chunk of the red part of the spectrum which results in unnatural greenish skintones. Not all fluorescent lights are bad, here's the chart illuminated by the fluorescent lights in my house which were specifically chosen for their wide spectrum (as described by the CRI (colour rendering intent) number of 93 (sunlight is 100)): No colour problems here!
1
What's the difference between yellow and white?
Running something in a cron environment?
Cron executes whatever program is sent to it in such a fashion that anything written to STDERR causes either the kernel (or cron I'm unsure) to receive SIGPIPE. How does this functionality work? Is cron sending SIGPIPE or is the kernel? How can I get that same effect, without running something in cron? Could someone tell me for instance how to run a Perl script such that #!/usr/bin/env perl warn 'foo'; print "bar; Receives a SIGPIPE when it tries to write 'foo' to STDERR, and never writes 'bar'? I want to see Perl terminate and shell variable $? return 255.
You can do that by redirecting STDERR to the write-end of a pipe, then closing the read end: #!/usr/bin/env perl pipe R,STDERR; close R; warn 'foo'; print "bar";
0.555556
STDERR to the write-end of a pipe, then closing read end
multiple keys via HKDF - whats better, one or two applications of HKDF-extract
Assume for the sake of the question that I have two variable-length bit strings, each with 128 bit cryptographic randomness, and I want to extract two 128 bit keys via HKDF-SHA256. Which alternative is better (if any), and why? Use a single HKDF-extract on the concatenation of the two strings, and two HKDF-expands with different info strings to get two 128 bit keys. Use two HKDF-extract operations, one for each bit string, and use a single HKDF-expand on each to get two 128 bit keys. Or in other words, is it better to HKDF-extract on a longer IKM string and use multiple HKDF-expands, or is it better to use HKDF on independent but shorter IKMs. My intuition tells me that, if my randomness strings are really as good as I claim, then two independent HKDF extracts are better, but using a single one on the concatenation is, in practice, just as safe, and safer if my input randomness is not actually as good as assumed, so two HKDFs might be more robust in practice.
Realistically, it probably doesn't matter, if all of your premises are accurate. If it were me, I'd probably concatenate the inputs, then apply a HKDF to the concatenation to derive two keys -- but honestly, it's unlikely to matter. This is very unlikely to be the weakest link in your system. Pick something that's easy to implement and easy to understand, and move on: focus your energy on some other aspect of your system.
1
Concatenate the inputs, then apply a HKDF to the concatenation to derive two keys
Codeigniter login page missing
i was copying my friend's project that was created using codeigniter. i copied all files from her www folder including mysql data and paste to my www folder and mysql data, but when i try run on my localhost it show "Not Found The requested URL simrm/login was not found on this server. i'm newbie using codeigniter,so how to fix this problem?
You can check baseurl path (ie, path to your project) whether you have given it correctly in config.php. Path to config.php is application/config/config.php or inside system/application/config/config.php $config['base_url'] = 'your_project_url'
0.888889
baseurl path is application/config/config.php
Change in Wavelength of a Photon Relation to Energy (specifically Compton Effect)
Given a photon dropping from $\lambda_1$ to $\lambda_2$, its energy will drop from $\frac{hc}{(\lambda_1)}$ to $\frac{hc}{(\lambda_2)}$. However, I was wondering if there is any significance in the energy of the change in wavelength itself. For $\Delta \lambda = \lambda_2 - \lambda_1$, this change in wavelength has an energy $\frac{hc}{(\Delta \lambda)}$, yet this value does not correspond at all (as far as I can see) with $\Delta E = \frac{hc}{(\lambda_1)} -\frac{hc}{(\lambda_2)}$. Is this just a subtlety in the math, or is there actually meaning behind the value $\frac{hc}{(\Delta \lambda)}$?
One common way that this happens is through spontaneous parametric down-conversion. From Wiki: an important process in quantum optics, used especially as a source of entangled photon pairs, and of single photons. A nonlinear crystal is used to split photons into pairs of photons that, in accordance with the law of conservation of energy, have combined energies and momenta equal to the energy and momentum of the original photon, are phase-matched in the frequency domain, and have correlated polarizations. Say an example of a photon dropping from λ1 to λ2: * a green photon λ1=630 nanometers, hc/λ1 = 1.97 evolts * splits in two and one photon is λ2=830 nanometers, hc/λ2 = 1.49 evolts The difference in energy, hc/λ1-hc/λ2 = 0.48 evolts and would end up with the other photon. the other photons wave length would be 2583 nanometers based on its 0.48 evolts energy. The difference you reference Δλ = λ2−λ1 of 200 nanometers converted to hc/Δλ is quite high at 6.2 evolts. There is not much sense to the quantity hc/Δλ and I dont think there is any particular meaning to it.
0.888889
A nonlinear crystal is used to split photons into entangled photon pairs .
CakePHP displayField usage
can you help me how to use CakePHP's displayField directive, I can not figure out how to use it... so, in a model file, i have following code... <?php class Task extends AppModel { var $name = 'Task'; var $displayField = 'projectName'; //The Associations below have been created with all possible keys, those that are not needed can be removed var $belongsTo = array( 'User' => array( 'className' => 'User', 'foreignKey' => 'user_id', 'conditions' => '', 'fields' => '', 'order' => '' etc... how can i use this, to display fied projectName in select form field? thank you in advance!!!
So, you have Task belongsTo Project (FK: project_id). You want to make a project select box in tasks/add and tasks/edit views. The problem is that the projects table doesn't have a field called name or title so the select box is empty. You wouldn't have any problems if there was a name or a title field, right? Well, here's the solution, in the Project model add this: var $displayField = 'projectName'; http://book.cakephp.org/view/71/Model-Attributes So you were going in the right direction, just messed up the models a bit. I hope you understand it now ;]
1
Task belongsTo Project (FK: project_id)
If starting fresh, is a 140 character limit for tweets/status updates in general a good limit?
According to Why 140 characters and how to write more the limit on tweets was 140 because the SMS message limit is 160. They wanted tweets to be sent in one text (with space for username). However, if a limit was not already in place, what would be a good limit? Would 140 still be chosen? Have their been studies on the balance of enough space to get your point across and a short enough limit to keep updates quick and easy to read. Would it be better for example to limit on number of words?
Friedhelm Hillebrand, who set the 160 character limit for SMSes in the first place, took his cue by analysing the average lengths of typical kinds of 'short' messages: Alone in a room in his home in Bonn, Germany, Friedhelm Hillebrand sat at his typewriter, tapping out random sentences and questions on a sheet of paper. As he went along, Hillebrand counted the number of letters, numbers, punctuation marks and spaces on the page. Each blurb ran on for a line or two and nearly always clocked in under 160 characters. Still, his committee wondered, would the 160-character maximum be enough space to prove a useful form of communication? Having zero market research, they based their initial assumptions on two "convincing arguments," Hillebrand said. For one, they found that postcards often contained fewer than 150 characters. Second, they analyzed a set of messages sent through Telex, a then-prevalent telegraphy network for business professionals. Despite not having a technical limitation, Hillebrand said, Telex transmissions were usually about the same length as postcards. -- LA Times Twitter's tremendous success seems to confirm this analysis!
0.888889
Friedhelm Hillebrand set the 160 character limit for SMSes in the first place
Magento: Display custom product price in product listing, view page and also set same price after adding product to cart
I need to display custom price for each product where the admin will set different price for each product. and this product price only should be displayed in product listing and product view page, without changing the product actual price. And also the same price should apply to the cart. I tried with catalog_product_get_final_price observer, but It shows the price as special price but it will not change the display of product price. Please give me an idea, how can I do this? Thanks in advance:)
on list page and view page just check whether your custom price is null nor not if it is null show original price and if it not null show custom price. create a event in config file **checkout_cart_product_add_after** as given below <events> <checkout_cart_product_add_after> <observers> <unique_event_name> <class>modulename/observer</class> <method>modifyPrice</method> </unique_event_name> </observers> </checkout_cart_product_add_after> </events> create new file **Observer.php** class namespace_modulename_Model_Observer { public function modifyPrice(Varien_Event_Observer $obs) { // Get the quote item $item = $obs->getQuoteItem(); // Ensure we have the parent item, if it has one $item = ( $item->getParentItem() ? $item->getParentItem() : $item ); // Load the custom price $price = $this->_getPriceByItem($item); // Set the custom price $item->setCustomPrice($price); $item->setOriginalCustomPrice($price); // Enable super mode on the product. $item->getProduct()->setIsSuperMode(true); } protected function _getPriceByItem(Mage_Sales_Model_Quote_Item $item) { $price; //use $item to determine your custom price. return $price; } }
0.777778
Check if your custom price is null or not if it is not null show original price
Generate a custom Enterprise WSDL
I am trying to generate a WSDL that expose only some of my objects and methods. The Enterprise WSDL expose every object and method that my org has. I know that it could be possible "cutting" the generated XML by hand taking care the dependences, but is there any tool to resolve those dependences? or to regenerate a WSDL from other WSDL choosing the exposed methods?
The usual method is manual editing, although it should be possible to use the Eclipse IDE's WSDL editing mode to trim out the extra functions that you don't need. You'll still need to take care not to delete dependencies that are actually required, because Eclipse cannot validate what is or isn't necessary directly.
1
Eclipse IDE's WSDL editing mode can delete dependencies that aren't required directly
Using regular expressions to find img tags without an alt attribute
I am going through a large website (1600+ pages) to make it pass Priority 1 W3C WAI. As a result, things like image tags need to have alt attributes. What would be the regular expression for finding img tags without alt attributes? If possible, with a wee explanation so I can use to find other issues. I am in an office with Visual Web Developer 2008. The Edit >> Find dialogue can use regular expressions.
This works in Eclipse: <img(?!.*alt).*?> I'm updating for Section 508 too!
0.888889
This works in Eclipse:
How can I reliably make myself a cup of coffee in my hotel room that doesn't suck?
Like most people, I have a habit, and that habit is Coffee. Unfortunately, this can be an expensive habit. There are plenty of methods of making it less expensive, but in my experience, most of them are pretty bulky and not conducive to being carried around the country. Others are more portable, but taste dire (looking at you instant coffee, cheap cup from a gas station, etc...) Assuming the coffee maker in a given hotel room isn't capable of doing anything besides producing hot water competently, how can I make myself a decent cuppa, easily, cheaply, and effectively? What sort of equipment would I want to look into buying or using to do this? Cost effectiveness and ease of use is as important as portability/quality here. I'm open to cold-brew solutions, though hot coffee is definitely preferred. As far as resources that can be assumed: Hot water and tap water is 90% of what can be relied upon. A fridge or microwave is occasionally present, but I wouldn't count on either.
If you have to use the coffee maker in the room, here's what I do: 1) Clean it out by running it with water only. Throw that water away. 2) The coffee makers don't tend to heat the water enough, so run it again with water and ... 3) Put the water that's been heated once into the reservoir, and then put the coffee grounds in - the water will be hotter and it will do a better job of extracting what little flavor there was.
1
Clean the coffee maker out by running it with water only
With the hook entry_submission_end, is it possible to know if the entry is inserted or updated?
I'm working on an extension that indexes the content of the entry when publish form is submitted, but I need to know if the entry is a new one or an updated one, and in both case, I need the entry_id (the new one juste created or the old one). Do you know a way to do that? Should I use an other hook? --Solution-- In fact, entry_submission_end come with 3 parameters: entry_id, meta and data. If the entry is a new one, entry_id contains the new entry_id but $data['entry_id'] is 0, so you can have a condition on that to check if you are editing or creating an entry.
You can compare $meta['edit_date'] with $meta['entry_date']. You will need to bring both dates to same format of course, as entry_date contains current timestamp, while edit_date is formatted as '%Y%m%d%H%i%s'
0.777778
Compare $meta['edit_date'] with "entry_date"
Why is Senketsu the only Kamui that can talk?
There are three Kamui in the show: Senketsu, Junketsu and Shinra-Kōketsu (Omnisilk Kōketsu). Shinra-Kōketsu is on another level in comparison to other Kamui, but Junketsu is the same with Senketsu, but he never talk. Is Senketsu different from other Kamui?
There might be many reasons: First, Senketsu was created specially for Ryuuko. This might have created link, that allows them to understand each other. It is clear that Senketsu doesn't really "talk" using his mouth. It is more like telepathy. This telepathic link might have been created either intentionally or accidentaly when Senketsu was made. Second, there is question of relationships. Ryuuko and Senketsu are partners or friends. For them, it is symbiotic relationship. Satsuki on the other hand uses her willpower to dominate Junketsu so it can be used as a tool. And as such, there was no reason for her to listen to it, so even if Junketsu did talk, Satsuki would simply make it shut up, because Junketsu talking isn't what she need. Ryuuko and Senketsu were partners so it was obvious they would talk to each other. And last is simply about production: The creators simply didn't think of Junketsu as character. And as such, they didn't give it any voice. Senketsu was individual character from early start and as such it made sense to make him talk. And as such, he helped character development of Ryuuko. Junketsu on the other side was just something used by Satsuki.
1
Senketsu was created specially for Ryuuko .
How can I prevent a faucet retaining nut from freezing to a steel washer?
My real question, after several hours spent removing the old faucet (progressing from tapping the basin wrench with a mallet, to an overnight soak in penetrating oil, to cutting it off with an air grinder) is "what idiot engineer uses a mild steel washer in a wet environment?" But it looks like they all do, or at least the ones who designed the new faucet do, so ... On the assumption that I or someone else will someday want to change the faucet, what can I use to prevent the nut from freezing to either the washer or the faucet body? If I were working on a car, I'd use thread sealing compound. Does that make sense in this application? Or are there any professional tricks that aren't quite as messy?
Anti-Seize Lubricating Compound Make sure it's waterproof Pipe Dope Make sure it's Anti-seize I do not specifically recommend nor endorse either product, they are only used as examples.
1
Anti-Seize Lubricating Compound Make sure it's waterproof Pipe Dope
What are the benefits of owning a physical book?
I have seen this question about updates of the D&D 4th Edition books, and it got me thinking. Since I got my Kindle I have not read a single paper novel; they have fewer drawbacks compared to digital copies than rpg rulebooks. Dead-tree types have some benefits like looking good on a bookshelf, but any ebook reader weighs less with 100 novels than the usual hard-cover book. If you want to look for the damage of Ares Alpha, even with a half-decent tablet it takes less than 2 seconds. Digital copies do not get worn, they never get unwanted earmarks, but you can bookmark them. Rulebooks do get updates, and unless you are willing to take a pen to your book, your hard copies will never contain them. The pdfs can be edited and resent to the buyers. Even better is the WotC approach with the DDI, you can look up any monster or item or (almost any) rule, in the most recent form, for 3 years at the cost of seven books. I think this is the way to go, even considering the horribly slow character builder. Although I must admit good illustration can help build the athmosphere. So what am I missing? Why are people buying rpg rulebooks in paper format? Why are books even published, I do not need to know if feats are supposed to be on the right page and skills on the left, I just want a list of them, filterable any way I want. Is this just a necessary part of earning money? I understand that pdfs are copied illegally, but the Compendium is not.
For novels and fiction I prefer a e reader. For reference I prefer paper. Why? The design teams for e readers focus on novels with the assumption that if you are going to do serious research you will use a computer. This is not a problem that can't be fixed, just one that hasn't been.
1
Design teams for e reader
Should a scientific paper have copyright?
Should a scientific paper have copyright? I guess not. It seems to me that science and copyright are not compatible. Let's say I wrote a very important paper in, say, cell biology. Suppose I have the copyright for the paper(I think so under the copyright law of the US). Then I also have the derivative-work copyright. Can I exercise the right? For example, can I refuse other people to use the original idea of my paper? Or can I forbid them using an original technical procedure described in my paper? Or what about copying graphs or figures?
Copyright does not protect ideas, just how they are expressed. Copying text generally violates copyright (although there are exceptions in which quoting is permitted), but copyright places no restrictions whatsoever on using ideas. For example, can I refuse other people to use the original idea of my paper? No, using your ideas is not enough to turn another paper into a derivative work. Or can I forbid them using an original technical procedure described in my paper? No, copyright is not relevant. It keeps people from copying your description of the procedure; instead, they have to rewrite it in their own words. However, copyright has nothing to do with using the procedure. Patents could be relevant, if the technical procedure is patented, but that's completely different from copyright (and there are no automatic patents, the way people automatically get copyright). You could certainly debate whether patents are a problem for science, but this has nothing to do with copyright. Or what about copying graphs or figures? Copyright does prohibit reproducing graphs or figures (again with some exceptions, such as fair use in the U.S.). However, it's OK to create a different graph/figure that conveys the same information.
1
Copyright does not protect ideas, just how they are expressed
Why does my switch need to be wired in this fashion?
Today was my first foray into electronics since high school, in the form of some simple Raspberry Pi experiments. I managed to get a circuit working where a switch controlled an LED with a potentiometer to control the brightness of the LED. However, I am confused by the wiring of the switch. Firstly, here's a photo of my amazing work: NOTE: the black lead on the potentiometer is not connected to anything (hard to tell in the photo). Also, I realised afterwards that I could have just inserted the potentiometer into the breadboard rather than soldering wires to it. Noob mistake (one of many). Here's an attempt at a schematic (also probably wrong because I don't know what I'm doing): simulate this circuit – Schematic created using CircuitLab As you can see, I used a PiFace, which comes with the four switches located at the left and towards the bottom of the photo. It is the wiring of this switch that befuddles me. Since each switch has two terminals, I was expecting one terminal to act as an input and the other as an output. That is, I just feed my circuit through those two terminals and job done. But that didn't work. I managed to find this image online: This is what prompted me to guess the configuration below, which works. However, I don't understand why it works. Nor do I understand why there are two terminals for each switch if only one seems to be used. I suspect the clue is embedded within the text in the above image: The four switches, numbered S1 to S4 are connected in parallel to the first four (0-3) inputs However, I do not understand what this means. Perhaps a practical example of how I would use each terminal and an explanation of why the grounding is necessary would help my understanding.
For the grounding it's easy. Basically a switch can have not 2 but 3 state. Basically High when pressed Undefined when unpressed and not grounded Low when unpressed and ground simulate this circuit – Schematic created using CircuitLab Grounding it will allow you to make sure the output low, without that it's a short circuit. So basically you'll use a pull-up or pull-down resistor for that. They are connected in parallel means they are not connected one after each other but side to side. Example simulate this circuit So from what I read in your question, the switch sound like a "master switch" who can act on both of the 3 other switch. If pressed, it's like all the switch are pressed. But hard to tell without precise schematics.
0.888889
CircuitLab Grounding
Thunderbird 2.0: Inbox size is 4GB on disk: how do I reduce it?
Mozilla Thunderbird 2.0: I have set Thunderbird never to delete a message that is on disk...Thus, after four short years, I have a 4GB Inbox file. Thunderbird needs about 10 minutes to read it, and even then I can't compact it. Anyone have some suggestions?
There is definitely a 4GB limit on Windows due to Windows limitations which means you will have problem with individual Thunderbird mail folders that are larger than 4GB. And I thought the 4GB limit existed on Mac and Linux as well (so I am curious as to how emgee can have a Thunderbird folder that's 7GB! emgee: perhaps you are referring to a Unified Folder being 7GB but your individual folders are < 4GB?) Nick's suggestion (i.e. move to new, multiple Thunderbird folders each of which is <4GB. please clarify emgee) should work. More info with a complete procedure (change "Sent" to "Inbox"): http://getsatisfaction.com/mozilla_messaging/topics/version_3_1_2_still_has_the_missing_sent_message_bug#reply_3235232
0.777778
emgee can have a Thunderbird folder that's 7GB
Is grout required when installing luxury vinyl tile flooring?
My wife and I are redoing two bathrooms. My wife hates ceramic tile due to mold issues here in the South Eastern US and generally not liking the grout which requires frequent cleaning and resealing. My questions are on the use of Luxury Vinyl Tile (LVT)flooring - my wife would prefer to go with either the LVT, or a high end single sheet product that is tough and will hold up to water. Her preference is to use the LVT without grout. However, I'm skeptical on how well the LVT will hold up to moisture without the grout and cleaning will be an issue. And am I right about the need for waterproofing or would the flooring work well any way? Is there a way to waterproof the joints on LVT without grouting? Also, do the vinyl flooring grouts have the same issues as the ceramic tile grout?
Instead of trying to force fit a product not really intended for a shower wall maybe you would want to consider installing the molded fiberglass one-piece type tub / shower enclosure in place of your existing installation. These pretty much eliminate any need for grout joints, are easy to clean and can look surprisingly nice. (My house has three of them, two showers and a tub, and whilst they came with the house when I purchased it I am quite happy with them).
0.833333
Installing molded fiberglass tub / shower enclosure
"Find ten apples and oranges" Do I find 10 or 20?
If I read the sentence Find ten apples and oranges. Do I need to find ten or twenty pieces of fruit?
It's like someone saying they "have three brothers and sisters". Is that a total of six siblings or three? Do they have two brothers and one sister, or two sisters and one brother? As a result we can read the OP's sentence as Find ten apples [and oranges] = 20 pieces of fruit (ten oranges being implied) Find ten [apples and oranges] = 10: any combination of the two types of fruit. Possible variations which would avoid this ambiguity: Find ten of each fruit: apples and oranges. (20) Find ten apples and ten oranges. (20) Find ten apples or ten oranges. (10) Find ten fruit which are apples and oranges. (10)
1
Is that a total of six siblings or three?
Referencing (not Bibliography) in Harvard Style using Write Latex
I am relatively new to Latex and I am trying to write my first project thesis. I am using WriteLatex, which is an online Latex environment. I was successful in obtaining the references from many sites, imported them into a .bib file in Bibtex and cite them in Author Year title format. My problem arises when I cannot see the References at the bottom in Harvard style. What I want to see is this [Alpaydin,2004] Ethem Alpaydin, Introduction to Machine Learning, MIT Press, 2004. What I get is just this under the name Bibliography Ethem Alpaydin, Introduction to Machine Learning, MIT Press, 2004. I am using the following packages \documentclass[a4paper]{report} \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsthm} \usepackage{graphicx} \usepackage{natbib} \begin{document} \addcontentsline{toc}{subsection}{Bibliography} \bibliography{Ref} %My .bib file \bibliographystyle{plainnat} \end{document} Edit: The Bibliography files are of the format: @book{alpaydin2004introduction, title={Introduction to machine learning}, author={Alpaydin, Ethem}, year={2004}, publisher={MIT press} } Can someone please help me get the Harvard style referencing even at the end of the document in the style I mentioned above. Thanks in advance
To get the appearance of the entries in the references, keep using the plainnat bibliography style but do not load the natbib package. You'll get: \documentclass[a4paper]{article} % to keep output all on one page \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage{amsmath,amssymb,amsthm,graphicx} %\usepackage{natbib} %% deliberately commented out \bibliographystyle{plainnat} \usepackage{filecontents} \begin{filecontents*}{Ref.bib} @book{alp:04, author = "Ethem Alpaydin", title = "Introduction to Machine Learning", publisher= "MIT Press", year = 2004, } \end{filecontents*} \begin{document} \cite{alp:04} \bibliography{Ref} \end{document} If you do not want square brackets surrounding the citation callout, i.e., if you want it to look like Alpaydin(2004), you should also provide the following instructions in the preamble: \usepackage[noadjust]{cite} \renewcommand\citeleft{} \renewcommand\citeright{} If you did load natbib -- and, of course, didn't load the cite package as well -- you'd get the following look, which is, I gather, not what you want:
1
Use plainnat bibliography style to get the appearance of the references
Key-agreement protocol in a REST API
I have a C# REST API which exposes some methods over the HTTP protocol. The API is intended to be used my my Android applocation (Java) which is currently in the makings. Since the app is in an early development stage, and hasn't been released yet, I access the API methods using http://example.com/resources/item17 without any additional security. However, as soon as the app is released, I don't want anyone but my app users to access the API. My idea is to generate some kind of unique key in my C# + Android code. A simplified version to give you the idea: int key = DateTime.Now.Minute * Math.PI * 5; This would make the request look something like: `http://example.com/resources/item17?key=1234567` The C# API would verify this before sending a response. The only way to figure out how the key is generated would be to reverse my Android code (which will be obfuscated at that point). Does this sound like a good solution, or do you have any other suggestions?
It seems like a motivated person could determine the key if they wanted to. Would it be possible to send a unique key along with each instance of the application when it is downloaded? A GUID or a UUID might be good for this and it would be much harder to predict. When someone downloaded the application you would send that key along with the instance and then insert it into a database that you control. Then when a request is submitted you can confirm that it exists in the database. This would also allow you to track the number of requests coming from a specific key. With the original, any way to identify if the code has be compromised. For example if you have 100 users and are getting 1000 requests a day and then it bumps up to 1100 requests a day that would probably look normal. If you identify the number of requests from each key you can see that normally you get 10 requests a day from each of your keys, but if it bumps up to 1100 requests and a single user goes from 10 to 110 requests, you can probably say that that key was compromised and disable it.
0.666667
How to identify if the code has been compromised?
Good travel games for two players, especially for playing on trains?
I would be interested to hear if anyone had recommendations for 2-player games that are particularly suitable for playing while travelling on trains. (I ask this as someone who mostly enjoys games like Carcassonne, Power Grid, Agricola, Pandemic, etc. around the table at home.) To be specific, the things that I think are important properties for these games are: Needing minimal table space. Most trains have a small table you could use, but not much more. Being quiet to play, so that other passengers won't be disturbed. For example, I imagine that games that involve repeatedly rolling dice wouldn't be appreciated. Packing down small, so that they don't take up much luggage space. Not requiring batteries or a power socket. (I appreciate that an iPhone or a Nintendo DS for each player might be a good solution more generally, but it's not what I'm after in this case.) Not being so delicate to arrange that motion from the train will unduly disrupt the play. I think it would be best to recommend one game (or class of games) per answer, if that's appropriate, and explain why you think it's particularly suitable. (Incidentally, I've read the guidance on good questions about game recommendations and hope this question meets the criteria.) Update: Thanks for so many excellent suggestions - we certainly won't be short of games for our next long train journey :) Update 2: Unfortunately, I can't really playtest this many great games in any reasonable time period, so I'm going to accept the top-voted answer (Cribbage) and try out the others as soon as I can. Thanks again...
I know you suggest avoiding dice games, but I strongly suspect that Roll Through The Ages: The Late Bronze Age would fit the bill quite nicely. Reasons: 1) The box it comes in acts as a nice sound-dampening dice-rolling tray, making it far less disruptive than your average dice game. I can imagine playing it on a train without disturbing other passengers. 2) Packs small, plays small, resistant to jostling. 3) Plays two players just fine, and scales to three or four (just in case). 4) On that note: It's relatively quick to teach (to gamers).
1
Roll Through The Ages: The Late Bronze Age
Binary tree traversal without using recursion
Can anyone help to to create a binary tree and do a non recursive preorder traversal of the binary tree in c?
As pre-order can be done via depth-first search, it could be done in this way; note that depth-first search is a recursive approach. That being said, I does not need to be implemented by recursive function calls but can be implemented by using a stack as an auxiliary data structure, which effectively is used to generate the visiting sequence which would otherwise be generated by recursion. In pseudocode, this can be done as follows, where visit would be the function to actually visit a node. push the root of the tree to the stack; while (stack is not empty) { Node = top of stack; visit Node; if Node has unvisited left child push left child of Node else if right child of Node is Not visited push right child of Node else pop; }
0.888889
depth-first search is a recursive approach .
Exit Google Chrome from terminal
Is there a way to cause google-chrome to quit, from the terminal, besides using killall google-chrome? I would like to be able to close it from a script without killing it.
Perhaps wmctrl could be of some assistance. You could use the -c option that closes a window gracefully: wmctrl -c chrome The string chrome is matched against the window titles. Note that the window might not close if some message pops-up (e.g. when you have multiple tabs open).
0.777778
wmctrl -c chrome Closes window gracefully
How old is Captain America when he receives the 'Super-Soldier Serum'?
Steve Rogers is said to have been born in the 1920's. WWII started roughly in 1939 with the invasion of Poland by Germany. Rogers attempts to enlist in the US Army in 1940, however due to his frail physical state he is denied entry. Having been observed by certain key Army officials attempting to enlist several more times after being denied, he is inducted in to Project Rebirth as its first candidate for Dr. Erskin's Super-Soldier Serum. After receiving said serum, and becoming the pinnacle of human potential he operates in the European theater of war for several years alongside Bucky Barnes and, on occasion members of the Invaders. On his final mission during the war he and Barnes are presumed dead when the experimental bomb they are attempting to stop from destroying Washington DC explodes dumping Cap in the Arctic waters to be frozen and preserved for many years before he is found and revived by the founding members of the Avengers. I'm trying to figure out how old he was when he received his serum treatments and became Captain America, and/or how old he was when he was frozen in the ice.
According to Captain America's biography on ComicVine; The comic version of Steve Rogers was born on July 4th, 1920. He was given the Super-Serum in March 1941 (aged 20). This is flatly contradicted by the film version which states that he was born on July 4th, 1918 and turned into a superhero aged 21. Both versions agree that was frozen in 1945 (aged 25 and 27 respectively).
1
The comic version of Steve Rogers was born on July 4th, 1920 .
tar -c Error Messages and Source Files?
During a tar archiving operation with tar -cvf archive.tar source does the resulting tar archive that reports a file changed as we read it error still contain "some version" of the source file that it reported the error on or does it completely abandon archiving that source file and move on?
tar is for tape archive and it is stream based. tar can't go backward to erase what it has already written. So, that message is to tell you that what's in the archive may not be consistent as it changed while being written. What happens is that for each file, tar writes a header that includes the path to the file, metadata (ownership, permission, time...) and the size (n bytes) and then proceeds to dump those n bytes by reading it from the file. If the size of the file changes while tar is dumping its content, tar can't go back and change the header to say, no after all the size was not n but p. All it can do is truncate the content to n bytes if p is greater than n or pad with zeros if it's smaller. In both cases, you'll get an error message.
0.777778
tar is for tape archive and it is stream based.
Not Proper Table Alignment in Bootstrap
I'm trying to develop an application with help of Bootstrap in order to respect Desktop, Tablet and Mobile. Currently I'm facing an issue with the table responsiveness Below I have provided the screenshot and the code, kindly let me know where i do a mistake. You can see from the second screenshot, where the second getting aligned to responsiveness but the other not. Screenshot 1 :: Perfect alignment on tablet Screenshot 2 :: Not perfect on mobile CODE :: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="../../favicon.ico"> <title>Fixed Top Navbar Example for Bootstrap</title> <!-- Bootstrap core CSS --> <link href="js/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="js/libs/bootstrap/customcss/navbar-fixed-top.css" rel="stylesheet"> </head> <body> <!-- Fixed navbar --> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Project Title</a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Home</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Mission <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li class="divider"></li> <li class="dropdown-header">Nav header</li> <li><a href="#">Separated link</a></li> <li><a href="#">One more separated link</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Request <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li class="divider"></li> <li class="dropdown-header">Nav header</li> <li><a href="#">Separated link</a></li> <li><a href="#">One more separated link</a></li> </ul> </li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="../navbar/">Default</a></li> <li><a href="../navbar-static-top/">Static top</a></li> <!--li class="active"><a href="./">Fixed top</a></li --> </ul> </div><!--/.nav-collapse --> </div> </div> <div class="container"> <!-- Main component for a primary marketing message or call to action --> <div class="jumbotron"> <h1>Project Title</h1> <p></p> <p></p> <p> <a class="btn btn-lg btn-primary" href="../../components/#navbar" role="button">View navbar docs »</a> </p> </div> <div class="row"> <div class="col-md-12"> <div class="panel panel-warning"> <div class="panel-heading"> <h3 class="panel-title">Panel title</h3> </div> <div class="panel-body"> <div class="col-md-12"> <table class="table table-bordered table-condensed files" border="1"> <thead> <tr> <th>Emp Id</th> <th>Emp Name</th> <th>Start Date</th> <th>End Date</th> <th>Days</th> <th>Status</th> <th>Status</th> </tr> </thead> <tbody> <tr> <td>123456</td> <td>Employee First & Last Name</td> <td>04/DEC/14</td> <td>30/JAN/15</td> <td>35</td> <td> <button type="button" class="btn btn-success"> <i class="glyphicon glyphicon-ok-sign"></i> <span>Validated</span> </button> </td> <td> <button type="button" class="btn btn-warning"> <i class="glyphicon glyphicon-question-sign"></i> <span>Pending</span> </button> </td> </tr> </tbody> </table> </div> </div> </div> </div> </div> </div> <!-- /container --> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <script src="js/libs/jQuery/js/jquery-2.0.3.js"></script> <script src="js/libs/bootstrap/js/bootstrap.min.js"></script> </body> </html>
Here is working fiddle' http://jsfiddle.net/52VtD/9293/ <div class="container"> <!-- Main component for a primary marketing message or call to action --> <div class="jumbotron"> <h1>Project Title</h1> <p></p> <p></p> <p> <a class="btn btn-lg btn-primary" href="../../components/#navbar" role="button">View navbar docs »</a> </p> </div> <div class="row"> <div class="col-md-12"> <div class="panel panel-warning"> <div class="panel-heading"> <h3 class="panel-title">Panel title</h3> </div> <div class="panel-body"> <div class="table-responsive"> <table class="table table-bordered"> <thead> <tr> <th>Row</th> <th>First Name</th> <th>Last Name</th> <th>Email</th> <th>Biography</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>John</td> <td>Carter</td> <td>[email protected]</td> <td> <button type="button" class="btn btn-warning"> <i class="glyphicon glyphicon-question-sign"></i> <span>Pending</span> </button> </td> </tr> <tr> <td>2</td> <td>Peter</td> <td>Parker</td> <td>[email protected]</td> <td> <button type="button" class="btn btn-warning"> <i class="glyphicon glyphicon-question-sign"></i> <span>Pending</span> </button> </td> </tr> <tr> <td>3</td> <td>John</td> <td>Rambo</td> <td>[email protected]</td> <td> <button type="button" class="btn btn-warning"> <i class="glyphicon glyphicon-question-sign"></i> <span>Pending</span> </button> </td> </tr> </tbody> </table> </div> </div> </div> </div> </div>
0.777778
Main component for primary marketing message or call to action
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?
It looks like you have two different issues, it's easiest to discuss each of these separately. 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. This one is rough. You can't punish someone due to plagiarism before they submit work. The best policy, in my opinion, is twofold. First - if a student brings plagiarized work then you should simply say "I'm sorry, I cannot help you with work that is not your own." and point to you university's policy regarding academic dishonesty. Repeat offenders should be put on notice. Second - If you grade the final assignments or are involved consider spending a bit more time plagiarize-checking these particular student's submissions. These students have shown that they were willing to claim other's work as their own, being a bit more stringent in checking their work for originality is, in my opinion, completely fair. 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". This sounds like a communication problem. After meeting with a student there should be no confusion about what will improve the student's work. For something like a paper it should be "In order to improve this paper you should: extend the intro, go into more detail here, etc" Students returning for additional assistance should have some sort of checklist that they should complete prior to returning for more assistance. Make this clear and obvious and, if there are multiple tutors a student could work with, something that is kept in some sort of notes system.
1
Students can't punish someone due to plagiarism before they submit work
Login users/start session with PDO
Im trying to create a login section on my website using PDO. So far I've the following... config.php // Connect to DB $username = '[email protected]'; $password = 'pass'; try { $conn = new PDO('mysql:host=localhost;dbname=db', $username, $password); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $e) { echo 'ERROR: ' . $e->getMessage(); } ?> header.php // DB Config include '/assets/config.php'; // User Session $login = 'liam'; $pass = 'password'; $sth = $conn->prepare("SELECT * FROM access_users WHERE login = ? AND pass = ?"); $sth->bindParam(1, $login); $sth->bindParam(2, $pass); $sth->execute(); if ($sth->rowCount() > 0) { // session stuff, // refresh page } ?> My browser doesn't display the page however, and when I view my source theres no data contained within, can anybody see where im going wrong?
You have set PDO::ERRMODE_EXCEPTION. This means, you should wrap your statements in a try/catch block and test execute()s return code: try { $sth = $conn->prepare("SELECT * FROM access_users WHERE login = ? AND pass = ?"); $sth->bindParam(1, $login); $sth->bindParam(2, $pass); if (!$sth->execute()) { $info = $sth->errorInfo(); echo 'Error: ' . $sth->errorCode() . ' (' . $info[2] . ")\n"; } elseif ($sth->rowCount() > 0) { // session stuff, // refresh page } } catch (PDOException $e) { echo 'Exception: ' . $e->getMessage() . "\n"; } and put some trace statements in, of course.
0.888889
PDO::ERRMODE_EXCEPTION
Is the molecule of hot water heavier than that of cold water?
We know that the molecule of hot water($H_2O$) has more energy than that of cold water (temperature = energy) and according to Einstein relation $E=mc^2$ ,this extra energy of the hot molecule has a mass. Does that make the hot molecule heavier?
I am going to take a different approach from DavePhD and Floris. "Hot"ness or temperature more generally is a thermodynamic idea, and can't really be applied to an individual molecule. Dave and Floris have avoided the issue by simply comparing and energetic molecule with a less energetic one, and that is reasonable, but it makes their answers frame-of-reference dependent. Presumably they are working in the rest frame of the macroscopic samples from which they drew their test particles. All very reasonable. I'm going to make my usual argument about scale of inspection. A mole of hot water is more massive than a mole of cold water because when examined at the human scale you can't differentiate the kinetic energy of the molecules from any other form of internal energy (and energy is mass). The scale of this change is that figured by Floris. Examined at the level of a single molecule than each particle has the same mass--properly defined as the Lorentz scalar formed by contracting it's four-momentum with itself: $m^2 = \bar{p}\cdot\bar{p}$--and the fast molecule has more kinetic energy--$T = E^2 - m^2 = (\gamma - 1)m$--than the slow one. This approach follows the conventions of particle physics where we don't use the term "relativistic mass". The upshot is a "Yes and no" answer, or perhaps a "You're not quite asking the right question".
1
"Hot"ness or temperature more generally is a thermodynamic idea and can't be applied to an individual molecule
Best action to call add_rewrite_rule
In Codex I found that the best action to call add_rewrite_rule is the init action. So in this way the function is called every time the site load. But to save the rule in rewrite_rules option it would be better to call it in register_activation_hook?
Rules should be added on init because other code might flush rewrite rules, which would cause your rules to disappear.
0.777778
Rules should be added on init because other code might flush rewrite rules
Converting the output of df -h into an array in Bash
I am trying to do a very basic thing, which I though I should be able to manage all on my own, but alas.. What I am attempting to do, is to get hold of the values returned by "df -h", and to be able to store these values in a bash script array. The purpose is to combine it with other data (like the current timestamp) and output this to a new file/overwrite an existing file. The following two commands give me what I want on the commandline, but I cannot for the life of me load the output into an array that I can iterate over. The followng gives me the disk utilization in percent for each disk: df -h | grep -vE "^Filesystem|shm|boot" | awk '{ print +$5 }' And the following gives me the disk path: df -h | grep -vE "^Filesystem|shm|boot" | awk '{ print $6 }' However, I am unable to assign the output of this into a variable inside a shell script that I can iterate over. ANY ideas and help would be very much appreciated!!
You can use this. #!/bin/bash arr=(`df -h | grep -vE "^Filesystem|shm|boot" | awk '{ print +$5 }'`) for v in "${arr[@]}" do echo $v done (Note only works with bash, not /bin/sh)
0.666667
echo $v done for v
Is the intersection of two star-shaped sets star-shaped?
Is the intersection of two star-shaped sets star-shaped? I don't think so but can't think of an example.
Intersection of two star shaped domain is again a star shaped domain provided previous two domains are star shaped with respect to same point. Otherwise the result is not true in general.See the counterexample given by Scott.
1
Intersection of two star shaped domain with respect to same point
When cellphone providers give "unlimited social networking", how do they identify the traffic?
Some providers will give unlimited traffic for things like Facebook, Twitter, LinkedIn and even YouTube in some rare cases on smartphones. I'm wondering if there's any documented way they identify this traffic. Not for malicious purposes but from an ethical standpoint I'm curious as to how they keep the data at bay. On first glance, I would assume an IP filter and payload size checks but I wonder if anyone has any better theories or resources?
I would think that a combination of checking DNS queries and IP filters would be the easiest way. The IP addresses for the allowed list of sites should be known. I can't think of any reason they would need anything more advanced.
0.888889
How to check DNS queries and IP filters?
Two sets came to an intersection
Challenge: Print set intersections. Specifications: Your program should accept as its first argument a path to a filename. Each line in the file is a test case. Each test case contain two semicolon delimited sorted lists of numbers in ascending order, whose numbers are separated by a comma. Print out the ascending order sorted intersection of the lists, one per line. Print empty new line in case the lists have no intersection Solution: import java.io.File; import java.io.FileNotFoundException; import java.util.LinkedHashSet; import java.util.Scanner; import java.util.Set; public class SetIntersection { public static void main(String[] args) throws FileNotFoundException { Scanner input = new Scanner(new File(args[0])); String[] parts; while (input.hasNextLine()) { parts = input.nextLine().split(";"); System.out.println( findIntersection( toIntArray(parts[0].split(",")), toIntArray(parts[1].split(",")) ) ); } } private static String findIntersection(int[] foo, int[] bar) { Set<Integer> intersection = new LinkedHashSet<>(); for (int i = 0, j = 0; i < foo.length; i++) { while (foo[i] > bar[j] && j < bar.length) { j++; } if (foo[i] < bar[j]) { continue; } else { intersection.add(bar[j++]); } } if (intersection.isEmpty()) { return ""; // none found } String result = intersection.toString(); return result.substring(1, result.length() - 1); } private static int[] toIntArray(String[] array) { int[] nums = new int[array.length]; for (int i = 0; i < array.length; i++) { nums[i] = Integer.parseInt(array[i]); } return nums; } } Sample Input: 9,10,11;33,34,35 3,7,8,22;11,22 11,12,13,14;14,15,16 20,21,22;45,46,47 77,78,79;78,79,80,81,82 33,35;3,18,26,35 Sample Output: 22 14 78, 79 35 I wanted to take advantage of the fact the lists were sorted, but I fear my efforts only served to render my code convoluted and inefficient. What do you think?
This is a fine implementation. It's well-formatted and nicely written. I find the idea of using a LinkedHashSet quite clever and interesting. There are a couple of points to improve though. You have a bug Do you notice something fishy here? while (foo[i] > bar[j] && j < bar.length) { j++; } if (foo[i] < bar[j]) { The condition in the while checks foo[i] > bar[j] before j < bar.length. So when j reaches bar.length, this will throw an ArrayIndexOutOfBoundsException. Flipping the && may seem like an obvious remedy. But it won't be enough, because of the next if statement after the while loop, you'll again have the problem if j has already reached bar.length. An example input to demonstrate this issue: 33;3,4 Unit testing It's always handy to have some unit tests around when solving challenges like this. For example: @Test public void test_9_10_11_x_33_34_35() { assertEquals("", findIntersection("9,10,11;33,34,35")); } @Test public void test_3_7_8_22_x_11_22() { assertEquals("22", findIntersection("3,7,8,22;11,22")); } @Test public void test_11_12_13_14_x_14_15_16() { assertEquals("14", findIntersection("11,12,13,14;14,15,16")); } @Test public void test_20_21_22_x_45_46_47() { assertEquals("", findIntersection("20,21,22;45,46,47")); } @Test public void test_77_78_79_x_78_79_80_81_82() { assertEquals("78,79", findIntersection("77,78,79;78,79,80,81,82")); } @Test public void test_33_35_x_3_18_26_35() { assertEquals("35", findIntersection("33,35;3,18,26,35")); } @Test public void test_33_x_3_4() { assertEquals("", findIntersection("33;3,4")); } An alternative implementation Consider this alternative implementation that passes all the tests: private String findIntersection(String input) { String[] parts = input.split(";"); String[] arr1 = parts[0].split(","); String[] arr2 = parts[1].split(","); return findIntersection(arr1, arr2); } private String findIntersection(String[] arr1, String[] arr2) { StringBuilder builder = new StringBuilder(); for (int pos1 = 0, pos2 = 0; pos1 < arr1.length && pos2 < arr2.length; ) { int value1 = Integer.parseInt(arr1[pos1]); int value2 = Integer.parseInt(arr2[pos2]); if (value1 == value2) { builder.append(value1).append(","); ++pos1; ++pos2; } else if (value1 < value2) { ++pos1; } else { ++pos2; } } if (builder.length() == 0) { return ""; } return builder.substring(0, builder.length() - 1); } This implementation has an advantage and disadvantage compared to yours: Advantages: It doesn't always convert all input values to integers. For example when you have a long list and a short list, and it turns out that they cannot have an intersection, the rest of the long list will not be converted to integers It should be faster to generate the output from a StringBuilder than from a LinkedHashSet Disadvantage: in common cases it converts input values to numbers twice. This is because in every step of the while loop, when only one of the positions advance, then on the next step the other number will be converted to integer again. There is possibly one more advantage: it's not clear if in the output the values should be separated by single commas, or by comma + space as in yours (and in the output of Set.toString). Since the values are separated by , in the input, I would assume the same rule for the output as well, but I could be wrong. But if I'm right, then to get the right output you would have to strip the spaces from the result of the Set.toString call.
0.888889
LinkedHashSet Disadvantage
Words for meat differ from the words for the corresponding animal
In English we have: "beef" for "cow", "cattle" "veal" for "calf" "pork" for "pig" "mutton" for "sheep" I'm not aware of this separation for "fish", "goat" or "chicken" (Spanish has "pollo" and "gallina") and other poultry. Are these words used simply to distinguish the meat from the animal (i.e. to avoid saying "cow meat") or is there a psychological separation to avoid the association? I doubt the latter since these words developed when people were likely less squeamish than some are today. Why are there not meat words for some animals? What are some others I didn't list?
For psychological reasons, the names of most meats are different from the animals they come from. The meat industry has always tried to disassociate the meat from the animal. For example, most meat eaters are fine with eating "beef," but if it were labeled "cow," they might think twice about eating it. Same with sheep, goats, pigs, and deer.
1
The meat industry has always tried to disassociate meat from the animal
Usage of "might" and "would" to indicate doubt
Do the sentences She might be only 28, but Jodie Whittaker.... and My parents would have walked along the Barrow wrongly suggest doubt, or are they normal usage? Are there names for these constructions? Taken from Irish Times . I googled "would have spent their time". Many cases were counterfactuals ("... otherwise they would have spent their time...”) But plenty simply describe past events, as the in the usage sited above. I couldn't detect a regional bias. As an Irish-English speaker this usage is unremarkable for example I might say This is the exact spot where Caesar would have crossed the Rubicon I think the intention is to evoke the event rather than just record it.
Let's take them one at a time. The first, She might be only 28 is an example of great understatement, similar to when we say, You know you might have helped us. The person is actually making a dig at the person by using might to imply "it's the least you could have done." I think that this is another example of understatement. The person is saying something like "yeah, she's only 28 but wow... " In one possible scenario, I can see that there could be some doubt but in the other I envision I don't see any doubt. In the first scenario, a child, maybe an orphan who found out who their parents were, makes a judgement that the parents, who, having lived close to the Barrow [a river?] must have walked along that __. The second, it's a child who grew up with his parents and is describing a routine that the parents were seen to have engaged in. This is the would of reminiscing. Examples: I remember when I was sick, my mother would stroke my head and sing softly to me. When I was a young lad, my father would take me fishing every Saturday morning after chores.
0.666667
a person is making a dig at the person by using might to imply "it's the least you could have done"
Embedding Applet in JSP
So I'm learning how to embed an applet into a jsp page. But the thing is, when I run the index.jsp, there's always an error. The error says that the class for the applet is missing, and I don't know how to fix that. I put the full class name of the applet in the index.jsp, and the jar file for the applet was made. Here is the code for the applet and jsp. package HelloApplet; import java.applet.Applet; import java.awt.Graphics; public class HelloApplet extends Applet { @Override public void paint(Graphics g) { g.drawString("Hello applet!", 50, 25); }//end paint }//end class <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <h1>Hello World!</h1> <br> <applet code="HelloApplet.HelloApplet" archive="HelloApplet.jar" width="600" height="480"/> </body> </html>
Can the code attributte be a .jar ? Everything in the right directory? Try something like this: <applet code="HelloApplet.class" name="HelloApplet" archive="HelloApplet.jar" width=300 height=300> <param name="bgcolor" value="ffffff"> <param name="fontcolor" value="000000"> Your browser is not Java enabled. </applet> For more help, use this link
0.777778
Can the code attributte be a .jar
How should one reconcile a wrong against another person?
When someone commits a wrong against another person, what is he supposed to do to make things right? Is seeking forgiveness from God sufficient, or do you first need to set things right with the other person? If the latter, what are you obligated to do -- apologize, make amends (what kinds), something else? Does the answer depend on the type of damage done? For example, is gossip different from property damage, or injury? Does the answer depend on who was wronged? Is the obligation to a fellow Christian different than one to a non-Christian? I'm looking for a general Christian teaching on this subject. If there's a wide range of opinions on this, I'd like to know what the teachings are, and the Scriptural support for them. I am not Christian and thus am not asking what I should do in this case. I know what is expected of me as a Jew if I have wronged somebody else, and I am curious about how that compares to what your religion teaches about what is expected of a Christian who wrongs another. I'm not asking about the other side of the case, the obligation to forgive.
This is one of those questions that should have a clear, easy answer, but when you ask "what do Christians believe about this" you will likely get a lot of different answers. I'm going to put a preface explaining why those answers vary, and then go into a purely Scriptural view, which is the view you will likely hear from the pulpit of any Church you visit. Why the answers may vary. In Christianity, there is a concept of being "free from the Law of Moses" through the perfect substitutionary sacrifice of Christ. The central theme of Christianity is that we can never be "good enough" to get to Heaven on our own, and that Jesus is the promised Christ - His sacrifice is what gets us to Heaven, not our own good works. One of the questions that varying groups differ (and they differ wildly) is what, exactly it means to be free from the Law of Moses. There are other questions already on this site that explore that topic, but in a nutshell, there is debate over whether we are obligated to tithe, to refrain from certain things, to perform certain ceremonies, etc. This applies to your question directly because some groups believe that we are under no obligation to obey the Old Testament commandments regarding this, and others will say we are. Some will tell you that the Law of Love dictates that we will meet or exceed the requirements of Mosaic Law, and some would accuse those people of Legalism. That said... One common teaching The teaching with which I am the most familiar with comes from the mouth of Jesus, as recorded in Matthew 5:20-24 (King James version) 20 For I say unto you, That except your righteousness shall exceed the righteousness of the scribes and Pharisees, ye shall in no case enter into the kingdom of heaven. 21 Ye have heard that it was said of them of old time, Thou shalt not kill; and whosoever shall kill shall be in danger of the judgment: 22 But I say unto you, That whosoever is angry with his brother without a cause shall be in danger of the judgment: and whosoever shall say to his brother, Raca, shall be in danger of the council: but whosoever shall say, Thou fool, shall be in danger of hell fire. 23 Therefore if thou bring thy gift to the altar, and there rememberest that thy brother hath ought against thee; 24 Leave there thy gift before the altar, and go thy way; first be reconciled to thy brother, and then come and offer thy gift. This is commonly taught as doing whatever it takes to make it right. If you have sinned against someone, or even if that person thinks you have sinned against them, and you hadn't intended to, the priority is to reconcile and heal the relationship. Per His words in verse 24. reconciliation with an offended person takes priority over worship. (How can we come to God with a clean heart, if we are carrying the stain of sin?) Clarke's Commentary on the Bible expands on this: Leave there thy gift before the altar - This is as much as to say, "Do not attempt to bring any offering to God while thou art in a spirit of enmity against any person; or hast any difference with thy neighbor, which thou hast not used thy diligence to get adjusted." It is our duty and interest, both to bring our gift, and offer it too; but God will not accept of any act of religious worship from us, while any enmity subsists in our hearts towards any soul of man; or while any subsists in our neighbor's heart towards us, which we have not used the proper means to remove. A religion, the very essence of which is love, cannot suffer at its altars a heart that is revengeful and uncharitable, or which does not use its utmost endeavors to revive love in the heart of another. The original word, δωρον, which we translate gift, is used by the rabbins in Hebrew letters דורון doron, which signifies not only a gift, but a sacrifice offered to God. See several proofs in Schoettgen. The answer to most of your sub-questions are simple, if we take His words at face value: Is seeking forgiveness from God sufficient, or do you first need to set things right with the other person? We need to first make it right with the other person. If the latter, what are you obligated to do -- apologize, make amends (what kinds), something else? Whatever it takes to reconcile. This may be as simple as an honest confession of your sin to the other person, and a sincere apology, it may involve paying something back, it may mean doing something you really don't want to do (so long as that thing isn't sinful). You may have to apologize before the Church, or admit to peers/friends/families that you've done wrong. There may be cases where the other offended party will not accept any offer of reconciliation, at which case, we can only do our best. God knows our hearts and minds better than we can, and He knows both your mind and that of the person who holds something against you. Does the answer depend on who was wronged? Is the obligation to a fellow Christian different than one to a non-Christian? No. Absolutely not. The obligation to a fellow Christian is no more or less than to a non-Christian. I've taken the liberty of finding a few teachings on the subject: http://blog.beliefnet.com/markdroberts/2010/09/what-to-do-when-you-sin-against-someone.html discusses the importance of attempting to reconcile with the person you've wronged. http://carm.org/christianity/devotions/confession echoes the fact that going to God alone isn't enough, you must go to the person you've sinned against. http://www.victorious.org/churchbook/chur29.htm Discusses practical, Scriptural guidance for resolving disputed between believers. http://jpsmind.wordpress.com/2007/01/30/do-we-need-to-confess-our-sins-to-those-we-have-sinned-against/ Speaks to how our relationship with each other reflects our relationship with God. http://www.gotquestions.org/restitution-Bible.html Compares Mosaic Law with the New Testament teaching on forgiveness and Repentance
1
How to reconcile with a non-Christian?
CSS Div Footer When Resize The Browser
I working on a page with a footer. The footer's positioning is like it should, but I have an problem when i resize the browser from bottom to top. For details, you can see the image below : Here it's my css footer code : .footer_page { color: #fff; text-align: center; bottom: 30px; width:100%; position:absolute; } Someone have an suggestions ? Thanks.
The bottom 30px signifies bottom of the window. Calculate the distance from top you need your footer to have and give top:500px A better way is to give a large div id="page" around your entire page with required height, say 1000 px, and then footer with bottom 30px. #page{position:absolute;height:1000px} #page #footer{position:absolute;bottom:30px} If this seems too much or height of page is variable, let footer be part of flow of the document.In such cases it is better not to use absolute positioning. You can also do this with some javascript magic. What I am saying is, suppose total height of your page is 1000px. Put a wrapper around entire page with id page, give absolute positioning and height 1000px, then put footer in the end.
0.888889
Calculate the distance from top you need your footer to have
migrating a document library from sharepoint 2010 to sharepoint 2013 without using 3rd party tools
I have to migrate a document library from sharepoint 2010 to sharepoint 2013 without using any 3rd party tool. any nice approach to achieve it?
For simple migration you can use: Open both libraries in explorer view and simply copy paste the files on both the libraries. Using powershell script http://gallery.technet.microsoft.com/office/Copy-all-SharePoint-Files-0999c53f Try saving your list as template and create new document library with that template. Free tool available at codeplex to migrate documents http://spdocsmigrator.codeplex.com/
0.777778
Free migration tool available at codeplex
High-Tech Dungeon Crawling in Hard Sci-Fi
I've started playing Eclipse Phase with a group of friends. Most of them have a Dungeons and Dragon history, and love getting magic items and such. I've already made up my mind to take the party on more dungeon raids, but what specifically can I do in the way of loot? It is a hard science fiction setting; no magic. It's noted in the core book that some brand-name weapons and items will have special features, and there is something called Psi that is basically watered-down psychic abilities. What are some recommendations you would make for drops and treasure caches?
Treasures? Self-mobile plot-hook - NPC similar to Princess Leia in SW Ep IV in role. In distress, but of use down the road Illegal goods of use to the party Better weapons than the party has... if they can take them from the current owners. Rescue a trainer who can provide them esoteric skills training maps to other places to raid Entry Tokens to Eroticon 6 (HHGTTG reference...) repair parts almost untraceable bulk cargo of high value Readily traceable very high value cargo worth black marketing (ADVENTURE HOOK FROM H***) parts for improving their gear manuals for various bits of gear objects d'arte
1
Rescue a trainer who can provide them esoteric skills training maps to other places
Increasing voltage source frequency
I am trying to simulate a simple circuit using a simulation program like SPICE. In the beginning of the circuit I have a pulse train voltage source, later it is connected to a normal LPF. The voltage source frequency is set as 1 kHz, my question is how to increase this frequency? The only options that I have is to change the time of the cycle and the voltage. If I set 1 ms and 5V, the frequency will be 1 kHz. If I change the time to 0.5 ms, the result will be 5V for 0.5 ms and the rest is 0. (The second cycle will not start after 0.5 ms, so the frequency is same 1 kHz). Strange! How do I increase the frequency of the voltage source?
First of all, frequency is not voltage dependent. Secondly, I'm not really sure what you want to achieve. What kind of waveform do you want to have (Pulse, Sinus...)? If you want to have a pulse voltage output you can use PULSE(0 5 0 0 0 0.5m 1m 100) which will generate a 5V pulse voltage with a frequency of 1kHz and 50% Duty Cycle. The pulse will be repeated 100 cycles.
0.777778
What type of waveform do you want to have?
I want a pre-configured SharePoint 2010 Environment
I want a pre-configured SharePoint 2010 Enviornment where everything is configured properly and "just works". Is there a cloud-based solution available that's inexpensive and suitable for development or a VM I can download from somewhere and run on my development PC?
As far as I know the only choice is CloudShare which has best price of $60/month. You can even try for 1 month free. You can also setup your own VM on your computer if you have 6-8 GB RAM in your computer, and it is easy to do it. If you need someone, you can look for freelance guys at Elance, oDesk, or Freelancer and someone will do this for you at good price. You need VM software. Get free one from VirtualBox. Windows Server 2008 or 2012, get the trail for 180 days (6 months) from Microsoft site. MS SQL Server 2012 trail for 180 days (6 months). SharePoint Foundation is free and for SharePoint 2010 Server you can also get 180 days (6 months) trial.
1
CloudShare which has best price of $60/month .
Looking for advanced GeoServer tutorials
What are sources where I can learn how to use GeoServer? I know of these two sites: http://geoserver.org/ - which in fact is not working (at least at the moment) http://workshops.opengeo.org/geoserver-intro/ - not only (tutorials) for GeoServer But I am interested in more complex information, and not to read only documentation.
If you want to learn with video and example , here is the nice link to learn. Here it has been shown that how to publish shape files(point,line and polygon) to geoserver. https://www.youtube.com/watch?v=FiH4K1NLOZA
1
How to publish shape files(point,line and polygon to geoserver
Who should pursue a Ph.D degree?
I am asking myself the question "Should I do PhD or should I leave academia and go for an industrial career?" My life-goal is being a professor. And I love to do research. PhD is surely a bite that not everyone can chew. But I wonder who can chew it? I never was good at tests and exams. My BSc. GPA was 2.84/4.00 but finished my MSc. with 3.50/4.00 However, currently I am working on a conference paper and I feel like even that is too much for me. It has been nearly 3 months and still, the paper draft is to be improved (not the wording but the content). I am surely a hard-worker but not always. Sometimes, I let go of my work and absorbed in other stuff (composing, amateur radio etc). If this period is too wide, I have to spend double effort to warm-up and remember where I left. I don't know how things work in PhD. It usually is 5-6 years. It is the one of two most-challenging milestones in academic career (the other is getting the title Assoc. Prof). Should I completely be a "nerd" and work on my thesis systematically (something I could never make in my entire life) or working periodically but with extra effort is still sufficient? So, here's my question: If I say "I'm considering to do PhD" and ask your advice, what would you ask me? What kind of skills/characteristics do you look for a potential academician? I know it is way too late for me to ask this kind of question, as a person who almost finished his master's degree. But better lose the saddle than the horse.
Among the people who should pursue a PhD degree are the ones who can write: My life-goal is being a professor. And I love to do research. This is the number one reason to get into grad school. However, it's not clear at this point that you have an accurate idea of what it means, on a daily basis, to work in research. Sure there are fun times fiddling with the knobs of expensive equipment, drawing equations on napkins until late in the night, traveling to exotic conference locations like Baltimore, etc. There are also these brief moments when you feel like an undergrad actually learned something from you, and those where you share inside jokes that you can tell for sure only your advisor and yourself can understand. I recall a quote from a senior researcher in my field saying "Can you believe that they pay us to do what we love?". But there are other aspects that are less glamorous. Administrative work, data bookkeeping, actual bookkeeping, wondering what you will do with your life, filing grant applications, etc. There is the anguish about funding, the frustration of aborted projects, the time and energy wasted in dealing with department politics. And there is teaching which can be both a joy and a pain in the neck. My BSc. GPA was 2.84/4.00 but finished my MSc. with 3.50/4.00 I don't know what GPA is, nor how to interpret your grade, but the context tells me that you think they could be better. Passing exams and conducting research are different jobs, not being excellent at one does not mean you can't be good at the second one (a) although it often helps; b) the reverse is also true). It will make things harder for you when applying to grad school, but after that it becomes irrelevant. What matters more is what you actually learned, some people have ok grades but understood a great deal of the concepts. I let go of my work and absorbed in other stuff That you will have to work on. There is an infinite number of things that you can do but work on your research. Nobody will force you to do it since pretty much the only one who will suffer from your procrastination will be you. The good news (sort of) is that you are not alone... What kind of skills/characteristics do you look for a potential academician? There are many, and most of them overlap with what it needs to achieve a successful career in the industry. But I don't know any successful researcher who is not thorough. Being creative sure is necessary, but it's the easiest part. What will make you stand out is when you can discipline yourself into rigorously testing them. It also help if you know how to sell your ideas. Researchers hate to admit it but a significant factor in their success relates to how well they can convey a message. (Note that bad communication is an indicator of bad science, but it gives a lot of false positive).
1
What do you look for a potential academician?
Migrate to new server 2008 file server but keep old server name (under domain AD)
i am moving to a new file server under Server 2008 Standard 32bit edition. I will refer to the older server as just "server", the new one i named as server2. i have updated server2 and patched it. I have also joined the domain as member server and set up the raid structure. I have also moved the data over to the right spot. BUT here is what i am not 100% sure on. The company wants to keep the old name of "server", i did not want to do that and was thinking of just making a cname alias in AD DNS forward lookup zone to point to the new ip address of server2 but you can reference it as server. In order to do the alias i would naturally remove or rename the old server or just unjoin it from the domain altogether. I have read that you can just rename a computer to a previous name in AD as long as you have unjoined and removed it from the appropirate list under Active Directory? Can i just rename a server that is a member server in a domain? Do i have to change the sid or run newsid? Just looking for some best practices. thanks in advance. gd
I am assuming that SERVER and SERVER2 are both member server computers and not domain controller computers. When I replace old server computers I try and assign the name of the old server computer I'm replacing to the new machine. This is a common practice. (If you're consolidating servers then that's a a whole different "can of worms".) There's no problem with renaming a domain member server computer after it's joined to the domain. (Supposedly you can rename domain controllers in the Server 2008 version of Active Directory, but I haven't tried it yet.) Of course, in the case of re-using a name that was already assigned to another computer, you'll want to either take the original computer holding that name offline or rename it. I've done what you're describing many, many times with various versions of Windows. From the point you've described, I'd rename "SERVER" to "OLDSERVER", and "SERVER2" to "SERVER", leaving both joined to the domain throughout the process. You don't have to disjoin "SERVER" from the domain in this process. Once you've renamed "SERVER" while joined to the domain to "OLDSERVER", the object in the AD previously named "SERVER" will change to "OLDSERVER", freeing the name "SERVER" to be assigned to "SERVER2". As an aside: I have no idea why you'd be running "newsid" unless you installed the system from a disk image (and even then, you should be using SYSPREP to change the SID). You don't need to regnerate the SID unless the SID is a duplicate of another machine's (like if the machine is a disk cloned image of another machine).
0.5
Renaming a domain member server computer after it's joined to the domain
Good backup options for Mac pre-TimeMachine
I have a friend with an iBook G4 who is looking for a cheap backup option for her Mac running OS 10.4. Money is tight, so getting 10.5 is not really an option (in addition to buy a backup drive etc, yes money is really that tight). What suggestions can you offer for backups that's better than trying to remember to burn a CD once a month?
Assuming you can get a backup drive or separate volume, try Crashplan. It's free if you're backing up to an external HD.
1
Crashplan is free if you're backing up to an external HD
Superlatives with "the"
What is the rule regarding using the with superlatives? For example: John is the fastest among his friends. John is fastest among his friends. Both appear to be correct. I have seen both formats in a variety of places.
I don't know of a study that's looked at this formally, so I'm going "off the top of my head". It seems to me that the difference is that if you say "David is fastest", you are implying that David is the fastest among the small group of people that you have seen, but implying that it is likely you would find somebody faster in the wider world. If you say "David is the fastest", you are slightly more implying "He is the fastest among this group and also is not likely to be beaten easily by other people". Omitting "the" seems slightly more informal as well, to my UK ear.
1
If you say "David is fastest", you are implying that "he is the fastest among this group"
Where to find ferry flights and empty leg flights?
Based on this question Avoiding crew fatigue on empty leg flights I learned that there are "empty leg" flights or "ferry flights". These seem a good option but I would like to know more about them. Where are these announced? How can one travel this way?
Private Aircraft Others have answered for the commercial and chartered sectors, which is increasingly being strangled due to regulation. This answer will focus on the private sector. Where are these announced? The short answer is they are not announced, at least publicly like on a web site. Any kind of advertising or public communication kicks them into the charter or commercial spheres. When you know that a private pilot is planning to fly, you can ask if he wants to take you along. It's that simple. Meeting people and making personal contact replaces the internet. I think it's OK to exchange emails with somebody who already knows you and met you personally or through a club, but they are not going to warm up to somebody out of the blue. Also in terms of 'where are these announced', some discretion can be in order. If you go around identifying your contacts by name on your Facebook page, it may not be appreciated and you're likely to find your emails unanswered after that. If you know something is on a pilot's bucket list, like flying a Nanchang CJ-6 (a vintage two seater on many dream bucket lists), you can keep your eyes open for that kind of opportunity. Whatever gets you talking to pilots and in the air is key towards empty leg travel. Another example... In 2018, there will be a competition to fly around the world in Bristol Bulldogs. For people who live on the route and are aware that Bulldogs need to land for maintenance and fuel at the drop of a hat, there's an opportunity to offer some hospitality and a quick tour of your city. A really great calling card is the ability to speak different languages and to let people know you're happy to translate. I have also done pet-sitting, baby-sitting, driving, tour guiding, and cabin clean up/dish-washing. Having multiple passports also gives you a slight edge because you don't face visa issues. How can one travel this way? Some important things to point out about this... Timing. If you haven't done it before, it's not going to happen overnight unless you're very lucky. It takes a long time to get oriented and to establish yourself as an enthusiast. Flexibility. You don't always go exactly when you want and where you want. Instead, you go where the pilot is going and that may leave you with additional transportation to reach your destination - or even stranded for a while. For example, a flight into Heathrow or Gatwick would be extraordinarily rare; the general case is they are headed for a private airport like Cotswold or even as far out as Humberside. There are about 20 - 25 airports in the greater London area and home counties, but not every type of plane is cleared for their type of strip(s). On the plus side and if you are younger, being 'stranded' at some random field gives the opportunity to hang around the terminal and meet pilots who might be flying to some place else (note: I never went 'total gypsy' myself, but have spoken with people who managed to hop respectable distances over the course of say, a year; others have found that the demands of being flexible became unpleasant as they got older). Regulations. It's getting worse and worse. Airpooler is now moribund because of US regulations. BlackJet was supposed to have Uber's business model, but now appears to be offering very expensive pay-only arrangements to avoid being shut down. And the EU has jumped in with stricter interpretation of Regulation 965/2014, which is making some pilots reluctant to do anything at all unless they know you well. How to learn more about it? In comments, you wrote you're looking to know more about it... The best way to find out more is to join local aviation clubs and read aviation magazines oriented to private pilots. A simple Google search 'aviation clubs near London' returned two pages of results. I am in two for example. Source: Club event at Rochester Airport, Kent, fair use For aviation magazines, I can suggest "Pilot Getaways" (mostly US audience), "Pilot Magazine (UK version)" (UK general interest), "Plane and Pilot", (US, mixes private and business, more technical). Some other helpful entry points... You can attend events and festivals, like the annual one at Shobdon Field where anybody can go and enjoy the event while expressing enthusiasm for the sport. You can be a volunteer in Project Orbis, or raise donations in a challenge event. The Corporate Angel Network also takes in volunteers for data entry (with no direct path to flying) but leading to a wealth of knowledge about flight schedules, pilots, fractional owners, private car operators, airports, and all the rest. Check out newly converted or upgraded airports like Conington. Check out their engineering and repair facilities, what kinds of certifications they offer. Even Wifi and broadband. It's all useful knowledge. Finally, having some kit, like a Delorme Communicator or a Zulu class headset can be a tremendous help. Certainly the pilot will have his own, but it helps to establish you as a serious enthusiast who uses his own stuff.
1
How to get oriented to private pilots?
Do we say "shabbat shalom" on Tisha b'Av that falls on Shabbat?
Yesterday I said "shabbat shalom" to someone and he said we don't do that on Tisha b'Av that falls on Shabbat. I thought that Shabbat trumps the day (and that's why we move the other observances). Neither of us knew a source, and it hasn't come up yet in 9 be-Av on Shabbos .
The Shulchan Aruch (i will try to find the exact place) says that on a shabbos thats also tisha b'av you should mour n for the bais hamikdash b'tzinah (privately) verbally not saying good shabbos/shabbat shalom is not exactly private and he was doing it because the day was tisha b'av. Although he might have a special minhag (custom) to not say good shabbos/shabbat shalom, you might want to ask your friend about that.
1
Shulchan Aruch says that on a shabbos thats also tisha b'av you should
Important non-technical course for programmers?
What kind of non-technical training course do you suggest for a programmer? Example could be public speaking course, presentation skill, English, business writing, or anything not related to programming or software engineering itself.
Logic. Algebra. Statistics. Calculus. English. Critical thinking. Physics? Behavioral analysis? It depends what you want get into, and what you're naturally good at. There are tonnes of courses that will benefit you in some way. Many answers have suggested communication courses, which you seem to already know -- other than that, think long and hard about how you want to apply programming and take the courses that complement your goal.
1
Logic. Algebra. Statistics. Calculus. Behavioral analysis?
Is there any documentation about using Client ID / Token with REST API to access Group and Professional Editions?
I have seen information about using Token with SOAP API, but REST API documentations doesn't say anything about it. Did anybody find useful hints on getting Token to work with Rest API?
If you have a partner app you should now be able to get your OAuth client whitelisted for api access, talk to your contact in the partner group. Source: Does the REST API support Client ID?
1
Does the REST API support OAuth Client ID?
Why does hand sanitizer leave your skin feeling cool?
I noticed, and perhaps many others have too, that the application of hand sanitizer (mainly ethanol), leaves one's hands feeling rather chilly after application. What is responsible for this phenomena? Is it the high heat of vaporization of hand sanitizer? However, explanation doesn't hold water; water has a standard heat of vaporization of 40.65 kJ/mol while ethanol has a heat of vaporization of 38.56 kJ/mol. Could it be the low boiling point of ethanol? Hand sanitizer disappears (vaporizes) within seconds upon rubbing the hands together. Water, however, does not. Additionally, how does one square a high heat of vaporization with a low boiling point? If it takes a lot of energy to vaporize something, then how can that something have a low boiling point?
Hand sanitizer leaves your hands feeling cool because the particles in the gel which posses the most amount of energy are able to evaporate from the gel and off your hands. This results in only the particles with low energy levels to be left on your hand which therefore reduces the hands overall temperature.
1
Hand sanitizer leaves your hands feeling cool because the particles in the gel which posses the most amount of energy are able
3 images side by side
I want to position 3 images side by side. Actually I am doing like this, but they don't get side by side (see the pic on the bottom). Also is there any way to show only 1 caption for these 3 figures? \begin{figure}[ht] \begin{minipage}[b]{0.3\linewidth} \centering \includegraphics[scale=1]{i/houghtrain.png} \caption{default} \label{fig:figure1} \end{minipage} \hspace{0.3cm} \begin{minipage}[b]{0.4\linewidth} \centering \includegraphics[width=\textwidth]{i/houghframe.png} \caption{default} \label{fig:figure2} \end{minipage} \hspace{0.3cm} \begin{minipage}[b]{0.4\linewidth} \centering \includegraphics[width=\textwidth]{i/houghspace.png} \caption{default} \label{fig:figure3} \end{minipage} \end{figure} They are not good positioned: We can go outside the margin of the document if it is needed
If you just want three images side by side they can be positioned just as you would position three letters or boxes, no need for minipage wrappers etc. I also added p to your optional argument as not having it makes it more likely the float will go to the end of the document. \begin{figure}[htp] \centering \includegraphics[width=.3\textwidth]{i/houghtrain.png}\hfill \includegraphics[width=.3\textwidth]{i/houghframe.png}\hfill \includegraphics[width=.3\textwidth]{i/houghspace.png} \caption{default} \label{fig:figure3} \end{figure}
0.666667
If you want three images side by side they can be positioned just as you would position three letters or boxes, no need for minipage wrap
What are the .efires files on OS X Lion's Recovery HD?
If you mount the Recovery HD that enables OS X Lion File Vault 2, Safari mode, and certain recovery options, you see several .efires files. What format are those and what do they contain?
These files contain resources required for displaying the boot screen of OS X Lion before loading the actual operating system or in cases there is no system partition (or when it's broken). They contain a flat list of files (no hierarchy), and each file has a name of up to 64 characters. The file format is as follows; all numbers are little endian, i.e. least significant byte first. Two bytes 0x0200 with unknown purpose Two byte short integer with the number of file entries (e.g. 0x3800 is 56 files) Now there will be one record for every file entry: 64 bytes ASCII file name, with NUL bytes used to fill up 4 byte integer offset of the file data within the archive file 4 byte integer length of the file data within the archive file There is an additional unused record after the file entries consisting of 72 NUL bytes. Now there is the actual file data. There are no gaps or separators, the file entries described above position the data of all files right next to each other. The first file's data offset in e.g. an archive file with 56 entries is 0x0C10, or 4108 bytes, by default: 2 bytes unknown + 2 bytes file count + (56+1 file entries) * 72 bytes each = 4108. The second file's data offset in the same file is 4108 plus the length of the first file's data. These files are recreated automatically whenever you change a setting relevant for the boot login screen, e.g. whether to enable Safari mode in Security & Privacy preference pane in System Preferences). It uses default system resources to do this, so if you want to change e.g. the Apple icon, it is sufficient to edit the regular resource and have the system recreate the corresponding .efires archive file.
0.333333
The file format is as follows; all numbers are little endian, i.e. least significant byte first
Circuit to control a impulse solenoid valve from a movement detector
I have a movement detector sensor that generate a pulse (3.3V TTL) for 60 seconds when something moves in front of it. On the other hand, I have a impulse solenoid valve that close on a negative voltage (-3.6V) and open on a positive voltage (+3.6V). What would be the simplest and cheapest way to drive the solenoid from the movement detector? The circuit or chip should produce +3.6V output for at least 30ms when the input signal goes to 3.3V and then produce -3.6V for at least 30ms when the input signal goes low (0V). (I also have available a solenoid that work on 4.5V rather than 3.6V if this can help) Links: Valve Movement detector 24/08/2013 Update Inspired by the answer of Jim, will a circuit like this one work?
Normally I wouldn't do a bespoke design (especially for free) but this problem has a lot of common themes with other questions being asked so I thought it would be a good exercise to go through it in the hope that my solution (or parts of it) could be used elsewhere. Apologies for its length. MOSFET types should be able to switch a few amps and be of the 'digital' type (low gate turn on voltages). Problems: (1) the solenoid valve requires a positive pulse and a negative pulse (of about 30mS) to open an close it. (2) the sensor outputs a single pulse of about 60 seconds. (3) the Pump requires a 3v6 pulse at about 500mA Assumptions: (1) the pump valve stays ON or OFF depending on the last pulse (2) You want to turn the valve ON at the beginning of the sensor pulse and OFF at the end. I noticed the valve has only two wires so rather than positive and negative pulses its more reversing current direction. For a single supply that would suggest some form of changeover switch or an H bridge. I chose to go with a MOSFET H bridge and worked out from there. The circuit: THE H BRIDGE: Q3,Q4,Q5,Q6 MOSFETs Q3,Q4,Q5,Q6 and Diodes D1,D2,D3 and D4 form a fairly conventional H Bridge using P channel MOSFETS at the top and N channel at the bottom. IC1d is a CMOS schmitt inverter gate that switches the opposite sides of the bridge. A LOW on the gate turns Q3 ON and turns Q4 OFF. The inverter output (HIGH) turns ON Q6 and turns Q5 OFF. Current direction will be left to right through the valve (current forward). A HIGH on the Q4 MOSFET gate turns it Q4 ON but turns Q3 OFF . The output from the inverter (LOW) turns Q5 ON and turns Q6 OFF. The output current direction is now right to left. (Current reversed). CURRENT PULSE POWER CONTROL: (Q1,Q2) If the H bridge was powered all the time the valve would burn out. Q1 is normally held OFF by R1. This part of the circuit only allows the H Bridge to work when it is Q1 is turned ON. When the gate of Q2 is taken HIGH by the 30mS pulse it switches ON and pulls the gate of Q1 to ground, turning it ON as well. When the pulse returns to LOW it is turned OFF TIMING CIRCUIT: (R3,C1, IC1b, IC1c and IC2a) I could have used a simple 8 pin micro-controller for this section but chose to do it with with a few simple logic gates. IC1a acts simply as an inverting buffer taking the 60 second pulse at its input. One of the inputs to the XOR gate is taken through a simple RC delay circuit (R3, C1). When there is a change in the state (HIGH-> LOW or LOW->HIGH) of the incoming pulse this RC delay will cause the output of the XOR gate to go HIGH for the delay period. (Dual edge triggered monostable) Eventually the two inputs of the gate will be the same and then the output of the gate will go LOW. In other words we get a pulse after the rising AND falling edges of the input signal (frequency doubler). If we set this delay pulse to be about 30mS it is exactly what we require for the input to Q1,Q2. The direction of the current passing through the bridge is controlled by the input signal as it will be HIGH (detected) or LOW (timed out) at the time of the pulse.
0.888889
MOSFETs are able to switch a few amps
How to display a calendar on click of a textbox with jQuery?
I have a text box and a submit button. On clicking on text box,calender is showing. my problem is that the following code has css or js file which has url of Http etc.I want css or js file on my system from following link because i am working on IBM RAD and can't use external files. So,please help me. <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>jQuery UI Datepicker - Restrict date range</title> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css" /> <script> $(function() { $("#datepicker").datepicker({ minDate: "-6M ", maxDate: -60 }); }); </script> </head> <body> <p>Date: <input type="text" id="datepicker" /></p> </body> </html>
You are accessing jQuery and jQuery UI from CDN. Instead, you can download jQuery and jQuery UI and use these files from your local file system.
1
You are accessing jQuery UI from CDN
Get REQUEST_URI and don't overwrite
I tried storing the REQUEST_URI in a session with the code below. I need to store the very first REQUEST_URI when a visitor lands on a page on our site and not have it overwritten when they begin browsing pages. This isn't working as I browse the site i'm seeing a new URI displayed by the echo. session_start(); if ( !isset( $_SESSION['theuri'] ) ) { if ( !empty( $_SERVER['REQUEST_URI'] ) ) { $_SESSION['theuri'] = $_SERVER['REQUEST_URI']; } } echo $_SESSION['theuri'];
You must start the session before any output so the cookies can be set correctly. Wordpress is stateless and uses no sessions at all. You mention you put this code in the footer, so probably there is output already. A hacky solution would be to enter session_start() on the top of your index.php, or in wp-config.php.
0.777778
Wordpress is stateless and uses no sessions
Energy vs. Power
Is there a rule in English regarding when to use the word "energy" and when to use "power"? For example: I don't have the energy to deal with the problem now. It takes a lot of brain power to understand the problem.
In physics, energy is the ability to do work (or the work done), while power is rate of energy output. So if I push a boulder up a hill, I expend the same amount of energy regardless of how long it takes me. However, doing it in a shorter time period requires more power. I know you're probably not concerned with this technical distinction. But it is good to know. For example, now you know that it is correct to say "The car is very powerful: It can accelerate from zero to sixty in three seconds," and "It required a huge amount of energy to erect the ancient pyramids."
1
In physics, energy is the ability to do work (or the work done) while power is rate of energy output
When 'business' means a 'company', how do I use the word?
Business can sometimes mean company or firm. However, can it be used in the way company or firm are used? For example, can I say:- "He is the CEO of the business." "It's a TV business." "A business dealing with drugs."
Answer: Yes!! (Not always though..) Let's consider your examples again, Acceptable- "He is the CEO of the (biggest) business (in the history)." Incorrect- "He is the CEO of (the/our) business." Acceptable- "It's a TV (making) business." Incorrect- "It's a TV business." Informally acceptable- "A business dealing with drugs." (Should be "in" instead or "with".) So, as Barrie already pointed out, the usage usually depends on what came before and what follows the sentence. The word 'business' doesn't necessarily always mean a company.
1
Acceptable- "He is the CEO of the (biggest) business"
Printers Available in India That Work With Ubuntu 12.04
can anyone come up with multifunction laser printers available in India that work with Ubuntu 12.04? I'm asking because on most websites, I can't seem to find the models which are available on Indian markets/shopping websites. I know that sometimes that does happen, because new models replace old ones at a delayed schedule here.
I would ask this on an Ubuntu site that is related to India. As an example: http://ubuntuforums.org/forumdisplay.php?f=389 You are guaranteed to find people from India there with specific local knowledge. Also likely to be able of use: IRC: #ubuntu-in @ irc.freenode.net Mailing List: https://lists.ubuntu.com/mailman/listinfo/ubuntu-in But I agree with user68186 in comment: HP has always worked for me.
1
Ubuntu is related to India
how can i use regex to get a certain string of a file
with linux bash shell , how can i use regex to get a certain string of a file by example: for filename *.tgz do "get the certain string of filename (in my case, get 2010.04.12 of file 2010.01.12myfile.tgz)" done or should I turn to perl Merci frank
with bash, for the simplest case, if you know what you want to get is a date stamp, you can just use shell expansion #!/bin/bash for file in 20[0-9][0-9].[01][0-9].[0-9][0-9]*tgz do echo $file done else, if its anything before the first alphabet, for file in *tgz do echo ${file%%[a-zA-Z]*} done otherwise, you should spell out your criteria for the search.
1
Using shell expansion #!/bin/bash for file in 20[0-9] [0-9].
What is a *slightly* less extreme equivalent to being "fluent" in a language?
tl;dr: What is a less extreme (but still noticeable) alternative to the word "fluent", when saying e.g. "I am fluent in C++/Python/whatever?" I think I can call myself "fluent" in C#, because I know the language and runtime very well, and I'm very familiar with the .NET framework's APIs and classes, etc. I would like to claim the same thing for Python and C++. But while I can program in Python (I did so for an entire summer, making a website with Django), for example, I would not call myself fluent because my code isn't always "Pythonic" (e.g. using map/filter vs. list comprehensions), and I'm not too intimate with some aspects of the language and standard library yet (e.g. the introspection API, etc.). Is there a word or phrase I can use on e.g. a resume to describe what I know? I can think of "very familiar with", but is there a better word/phrase I can use?
Would "proficient" be useful, if not that, "competent". Both words suggesting a comfort with tasks given within a certain range.
1
Would "proficient" be useful, if not that, "competent"
Why is the result not 1?
int m = 0; m += m++; System.out.println(m); prints to 0 but i thought m will be post incremented and finally be 1. Would someone please explain. Note: i know how post increment works (atleast i think i do :P). But what i am trying to figure out is that when i say m + = m++ lets assume it means m = m + m++ which will evaluate m++ after sending the value of m, 0 in this case, and evaluate to m = 0 + 0 then increment the value of m because of the post increment. now if post increment has occured, why is m not 1
f is your code. g is an expanded version showing why they both print 0. class Test { private static void f() { int x = 0; x += x++; System.out.println(x); } private static void g() { int x = 0; int preInc = x; // preInc = 0 x += 1; // x = 1 x = preInc; // x = 0 System.out.println(x); } public static void main(String[] args) { f(); g(); } }
0.666667
f is your code.
GIS Software Choice for a small university research centre
I need to choose a GIS system for a small university research centre. We are handling a broad range of data, (for example, numerical tidal analyses, weather data, poverty, isolated economic activity, skills availability and renewable energy resource availability) and operate primarily in countries with relatively poor existing data sets. We interact with other groups, some of which use ARCGIS. Do I have to wade through every GIS software descriptor on the web, or can someone please give an indication of likely candidates?
Since most have mentioned open-source such as GRASS, I'll assume you have a few thousand for annual licenses within your department. Excelis ENVI+IDL, ERDAS Imagine, and possibly ArcGis Desktop (ArcInfo 10.1). Envi, Imagine, and ArcGis Desktop are all major, international providers of GIS software. Imagine is said to be the rosetta stone of GIS as it interfaces with just about every GIS format imaginable. I'm most familiar with ENVI+IDL myself and have had a good experience with it. There are also several, smaller utilities available that are free and useful. HDFView, Freelook (which is a free version of envi that's hard to find nowadays), Corpscon, 6S, etc. You'll have to prioritize and look at pricing as well as features & functionalities of each option. Good luck!
1
Excelis ENVI+IDL, ERDAS Imagine, and ArcGis Desktop are all major, international providers of GIS software