summary
stringlengths
15
147
text
stringlengths
1
19.3k
answer
stringlengths
32
22.6k
labels
float64
0.33
1
answer_summary
stringlengths
5
164
Silicone caulk for shower and tub?
I am about to seal the gap between my tub and the wall tile with caulk (it was originally grout which cracked so I chiseled out what I could). I was planning to use silicone caulk (GE II), but a contractor suggested that pure silicone is not ideal since all caulk will eventually need to be removed and replaced and silicone is very difficult to remove. There's some logic to this, so I'm wondering - is he right? If so, what kind of caulk should I use?
Whether it is hard or easy to remove is really not that important, when it comes to choosing materials for this type of operations. One other thing is far more important: Silicone is organic matter, and like anything organic it disintegrates, especially in rooms like bathroom, which are humid. You should use grouting materials, same (if possible) like you have used for ceramic tiles.
0.666667
Silicone is organic matter, and like anything organic it disintegrates, especially in bathrooms, which are humid.
Postfix or exim: Automated/Programmatic and forwarded email setup
I'm looking to replace our current use of an external smtp provider with an in-house installation. It should handle the following situations: Certain addresses should be forwarded to gmail addresses; we'd like to continue to use gmail as our primary email interface. Other addresses should be available as pop/imap mailboxes. Other addresses will be handled programmatically: they'll kick off various tasks, get logged, etc. These addresses should either kick off a process to the handle the email addresses, or should store in an easily processable format. It should also be fairly easily configurable with domain keys, spf, and anything else it takes to allow email deliverability. I've used sendmail in the distant past. It seems postfix and exim are the recommended options these days. My main question is: what's the best choice and setup for the forwarding of the addresses to gmail, and for the programmatic access? Is procmail still the way to go or are there better options these days? We're using linux/ubuntu servers.
for the programmatic stuff, you have to be aware of what UID the programs/scripts will be run as. For postfix, for example, scripts run from /etc/aliases (or any other root-owned aliases file) will be run as the 'nobody' user. postfix has the ability to have multiple aliases files and (here's the good part) programs run from an aliases file will be run as the user who owns that file (except for root - as mentioned before, aliases files owned by root are run as nobody). if you ever need to run a script from mail as root, then the easiest way (if you have sudo installed) is to configure sudo to allow 'nobody' to run it as root without a password and run it from a wrapper script that runs it with sudo. NOTE: whenever triggering scripts from mail, you have to remember that the data (i.e. the mail) is from an untrusted source (the internet)....so it is extremely unsafe to use the data from either the body or the header as arguments to commands executed by the script. this is basically the same issue as trusting user-supplied data in a CGI script - just don't do it. e.g. consider what a badly written script could do if the user-supplied data was something like " ... innocuousdatahere ...; rm -rf /". you might think it would be easy to check for obvious things like semi-colons and strip them out, but there's a lot of non-obvious things you'd need to check for as well and you'd just be setting yourself up for a failure since you're unlikely to think of or catch them all. far safer to eliminate the security risk entirely by just not trusting user supplied data ever. this is important no matter what UID the script will run as but is especially important when/if it is being run as root. Finally, to answer one of your direct questions, procmail is still a useful tool for what you want to do. as is maildrop and other similar programs. think of procmail etc as specialised tools for parsing body and headers to make decisions about what to do, so you don't have to have all that parsing code in your scripts. write your script to be just do its job, and use procmail to decide when the script should be run. for example, you could create a new user called, say, 'mailjobs' which has its own home dir and .procmailrc file. then create aliases that forward mail to that user. mailjobs' .procmailrc would then check the X-Original-To header to decide which script(s) to run.
1
if you ever need to run a script from mail as root, then configure sudo to allow 'nobody' to run
Can I use the following power supply as a constant fixed current source?
Might sound silly for many of all but is this device's knob for the current for obtaining constant current or limiting the max current? Can I use this Dc power supply to obtain a constant current regardless of the resisyances? If not what would u prefer as an adjustable current source? Here is the device: http://electronics123.net/amazon/datasheet/ps613u.pdf When feeding a DC motor with this the motor spins faster when increasing the current knob. Im a bit confused if it is only for limiting purpose or not.
Yes, you can use it exactly as a constant current source (within its limits). You set the Voltage to a maximum (with the knob - be careful that it can go to a maximum) and Current to a minimum (same warning) and then hook up the circuit and ramp up the current limit until you hit the value you want. If the power supply is wired correctly the voltage displayed will be the voltage across the load, from which you can measure the load value. An Ideal current source will change it's output voltage to conform to the requirements of the external circuit and will develop sufficient voltage to ensure that the current is constant. Up until the point that it can't. Like for example running unto the upper rail. You can't put out a voltage that is higher than what the Power supply itself can supply (but this may be higher than what the power supply puts out when in voltage mode). You will need to monitor the meters to make sure that it makes sense (not at the limits of voltage ranges) and regulation and control can be marginal at the minimums.
0.777778
The voltage displayed will be the voltage across the load
Planet orbits: what's the difference between gravity and centripetal force?
My physics teacher says that centripetal force is caused by gravity. I'm not entirely sure how this works? How can force cause another in space (ie where there's nothing). My astronomy teacher says that gravity is (note: not like) a 3D blanket and when you put mass on it, the mass causes a dip/dent in the blanket and so if you put another object with less mass it will roll down the dip onto the bigger mass. Is this true and is this what causes the centripetal force.
A centripetal force is a force directed towards the centre. It's just a characterisation of an existing force. "Centripetal" means "towards the centre" in Greek. So, in the solar system, the sun exerts a gravitational force towards itself, and it is a centripetal force. Regarding your other question: how does gravity work? According to general relativity, energetic or massive objects distort space, so that other objects passing through the distorted space do not go straight, but bend their trajectory. From their point of view, they experience a force (gravity), and consequentially an acceleration which changes their trajectory. So according to general relativity the medium through which gravity acts is actually the distortion of space. This is what your astronomy teacher called "a 3D blanket". Instead, according to Quantum Field Theory, forces are mediated by appropriate particles actually moving through space. Gravity would be carried by particles known as gravitons. In both these theories, there is no action-at-a-distance, so body don't exert forces on one another instantaneously, but there's always something "in the middle" that carries or represents the force.
0.777778
How does gravity work?
Determining sample size for a comparative study involving two unequal groups
I will like to know the formula for calculating the minimum sample size required for a comparative study involving 2 groups with unequal size. Group 1 is 10 times greater than group 2.
The generic formula for sample size at a given power in a regression is $$ N = \frac{2.84^2}{p(1-p)}\frac{\sigma^2}{MDE^2} $$ N is your sample size, p is the proportion getting the treatment, $\sigma$ is the standard deviation of the residuals, and MDE=the minimum detectable effect that you are powered for. 2.84 comes from alpha confidence of 95% and 80% power. The more explanatory factors you've got in your experiment the more $\sigma$ will shrink. Knowing how much it will shrink is tricky. At some point, analytical formulas collapse, and you're better off simply simulating your entire dataset, multiple times doing some sort of monte carlo, and fitting the desired model to each of the plausible datasets. Your power is the proportion of times you get the result you want. As with the analytical methods, you're only as good as your assumptions. Source is from memory, roughly following this. This answer is a verbatim copy/paste of my answer to this thread
1
The more explanatory factors you've got in your experiment the more $sigma$ will shrink .
Should I avoid credit card use to improve our debt-to-income ratio?
We put all our expenses on a credit card and pay it off every month in order to get maximize our cash back. We never charge more than we have in the checking account, so we always pay it off. Should we reconsider doing this in order to improve our debt-to-income ratio? Our goal is to be in the best position possible to get a mortgage in the next 3-12 months.
The answer depends on how much you spend every month. The DTI is calculated using the minimum payment on the balance owed on your card. Credit card minimum payments are ridiculous, often being only $50 for balances of a couple thousand dollars. In any case, when you get preapproved, the lender will tell you (based on your DTI) the maximum amount they will approve you for. If your minimum payment is $50, that's another $50 that could go towards your mortgage, which could mean an additional $10,000 financed. It's up to you to decide if $10,000 will make enough of a difference in the houses you look at.
0.666667
The DTI is calculated using the minimum payment on the balance owed on your card
Implementing a custom FormsAuthenticationProvider using Owin, Katana, and Nancy
I am working on implementing a custom FormsAuthenticationProvider and I'm getting a middleware conversion error. No conversion available between System.Func`2[System.Collections.Generic.IDictionary`2 [System.String,System.Object],System.Threading.Tasks.Task] and Microsoft.Owin.OwinMiddleware Parameter name: signature My stack includes Owin Katana Nancy My specific question would be any advice on where to look for an example on how to implement a custom FormsAuthenticationProvider? Unless someone can spot my problem. My implementation looks like: Startup.cs app.UseFormsAuthentication(new FormsAuthenticationOptions { LoginPath = "/login", LogoutPath = "/logout", CookieHttpOnly = true, AuthenticationType = Constants.ChainLinkAuthType, CookieName = "chainlink.id", ExpireTimeSpan = TimeSpan.FromDays(30), Provider = kernel.Get<IFormsAuthenticationProvider>() }); If I remove the app.UseFormsAuthentication(...) the application runs without error. Full Stack Trace [ArgumentException: No conversion available between System.Func`2[System.Collections.Generic.IDictionary`2[System.String,System.Object],System.Threading.Tasks.Task] and Microsoft.Owin.OwinMiddleware Parameter name: signature] Owin.Builder.AppBuilder.Convert(Type signature, Object app) +328 Owin.Builder.AppBuilder.BuildInternal(Type signature) +336 Owin.Builder.AppBuilder.Build(Type returnType) +42 Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action`1 startup) +650 Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action`1 startup) +86 Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build() +185 System.Lazy`1.CreateValue() +416 System.Lazy`1.LazyInitValue() +152 System.Lazy`1.get_Value() +75 Microsoft.Owin.Host.SystemWeb.OwinApplication.get_Instance() +35 Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +106 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +418 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296 [HttpException (0x80004005): No conversion available between System.Func`2[System.Collections.Generic.IDictionary`2[System.String,System.Object],System.Threading.Tasks.Task] and Microsoft.Owin.OwinMiddleware Parameter name: signature] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9874568 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254 Executable Source Code (Just F5 it and you'll get the error immediately) https://github.com/cnwilkin/ChainLink/tree/spike
Can you try updating the version of Microsoft.Owin.Host.SystemWeb package to the latest RC as well and try? You have all other Owin* dlls in rc but this is 1.0.0. Could be causing the issue. Also please use Microsoft.Owin.Security.Cookies instead of Microsoft.Owin.Security.Forms. The Forms package has been renamed to Cookies now.
0.888889
Can you try updating the version of Microsoft.Owin.Host.SystemWeb package to the latest RC
Analytical solution to PDE
I am trying to solve the following linear pde where $u=f(x,y)$ in the domain $y \in (0,\infty)$: $$y\dfrac{\partial{u}}{\partial x} = \dfrac{\partial^2 u}{\partial y^2}$$ with boundary conditions: $$u(x,0)=\sin(x) $$ $$\lim_{y \rightarrow \infty} u(x,y) = 0 .$$ Can someone please suggest how do I proceed to get the analytical solution for this equation? Solution: Using method of separation of variables, we assume solution to be of the form: $$u(x,y)=X(x).Y(y) $$ Inserting this to the pde, we get: $$yX'Y=XY'' $$ $$\dfrac{X'}{X}=\dfrac{Y''}{yY}=-\lambda$$ Now we get the following ode's $$X'+\lambda X=0 $$ $$Y'' + \lambda y Y = 0 $$ from which we get two general solutions of the following form: $$X(x) = c_1\exp(-\lambda x) \qquad Y(y) = c_2Ai(\lambda^{1/3} y) + c_3Bi(\lambda^{1/3} y) $$ where $Ai$ and $Bi $ are Airy's functions and the general solution can be expressed as: $$u(x,y) = c_1\exp(-\lambda x).(c_2Ai(\lambda^{1/3} y) + c_3Bi(\lambda^{1/3} y))$$ $c_3 \rightarrow 0 $ to satisfy second boundary condition since $Bi(\infty) \rightarrow \infty $ and hence, solution is of the form: $$u(x,y) = A \exp(-\lambda x) Ai(\lambda^{1/3} y) $$ Putting $y=0$, $$u(x,0) = A\exp(-\lambda x).\dfrac{1}{3^{2/3}}\Gamma({2/3}) = \sin(x) $$ How should I now proceed to find $A$ and $\lambda$, considering that $\lambda$ needs to be positive real value?
Hint: I have not solved the whole problem but I will give the approach: $f_{yy} - yf_{x} = 0$ Let $f = X_{x}.Y_{y}$ Then $X.Y^{''} - yY.X^{'} = 0$ $X.Y^{''} = yY.X^{'}$ $\frac{Y^{''}}{yY} = \frac{X^{'}}{X} = -\lambda$ ${Y^{''}} + y\lambda Y = 0$ ${X^{'}} + \lambda X = 0$ These are two ODEs in Y and X Boundary Values are Y(0) = 0 and $\lim$ ( y tending to infinity) $Y(y) = 0$ X(x) = 0 is trivial so just leave it. Boundary Values are used to find the general solution and the initial value is used to find the particular solution. Initial Value f(x,0) = sin(x) The method that I have used can be more generally summarized as follows The Method of Separation of Variables: Separate the PDE into ODEs of one independent variable each. Rewrite the boundary conditions so they associate with only one of the variables. One of the ODEs is a part of a two-point boundary value problem. Solve this problem for its eigenvalues and eigenfunctions. Solve the other ODE. Multiply the results from steps (2) and (3) Can you take it from here!! Thanks Satish
0.777778
Separate the PDE into ODEs of one independent variable
Is Start & Stop technology good or bad for my car? (Alfa MiTO)
I was recently in the lucky position to obtain an (almost brand new) Alfa Romeo MiTo, Progression. Like many new cars coming out these days, it has "Start & Stop" technology that turns the engine off when the car is stationary and is put in neutral and the clutch is released. When putting down the clutch again the engine fires back up. My question then is this: a) Is start-stop technology bad for my engine in any way? b) What impact might start-stop have on my battery? I.e. won't it deteriorate battery life with the constant turning on and off? (The radio, fans and lights remain on whilst in "stop"-mode, but not things like the aircon.) c) Will this technology really benefit me that much with regards to fuel-consumption? I can imagine it will be more economic when stops in heavy traffic become really long or traffic lights are red for long periods, but for the most part when driving the car doesn't turn off for longer than a minute at most before I have to "start" it up again. As many new cars lately have this technology I imagine that it can't be that bad, but I'm curious as to it's actual real benefits. I can turn this feature off, but I have to do so every time I start my car up for the first time and then I'm stuck with this glaring orange light in my dash, letting me know it's turned off.
Potential savings from reduced idling should greatly outweigh any increased wear and tear on starting and charging systems. I answered similar question about idling before (Is idling bad for your engine?). To summarise the negative effects of idling: Fuel combustion is incomplete, which leads to contamination of combustion chamber (glazing), spark plugs (wich reduces their effectiveness), exhaust system (including catalytic converter). Motor does not operate at optimal temperature, which leads to excessive condensation of water vapour in exhaust system, which leads to its corrosion (ergo premature replacement), and increased emissions. At the same time cost of wear and tear is low (American governmental agencies routinely cite $10 added per year). Roughly, it means if one would expect to replace the starter at 10–12 years normally, now one would do it at 8–10 (I pulled these numbers out of me arse, but they seem reasonable). To quantify fuel savings we need to consider savings from reduced idling, and savings from avoided performance losses. Research paper from Vanderbilt University (Amanda R. Carrico et al, “Costly myths: An analysis of idling beliefs and behavior in personal motor vehicles.”) based on the survey of 1300 U.S. residents estimates that on average Americans spend about 16 minutes a day idling (4 minutes warming, 4 minutes waiting, 8 minutes in traffic). Possibly, in more compact European or South African municipalities these numbers could be lower. Let us say we cut American number by about 60% and save around 6 minutes a day. 2.0L 4-cylinder petrol engine burns around 1 litre per hour idling. 6 × 365 / 60 = 36.5 hours/year, or 36.5 litres/year. Reduced efficiency can cost even more. If a car is driven 1500 km (930 miles) a month or 18000 km (11100 miles) a year, and consumes on average 9L/100 km (2.0L compact), 5% reduction in efficiency leads to 0.05 (18000 / 100 × 9) = 81 litres per year extra. So average Golf-class 2.0L 4-cylinder compact can consume extra ~120 litres (31 U.S. gallons) every year due to excessive idling. Multiply that by the price of petrol, and see potential savings on the fuel alone.
1
Savings from reduced idling should greatly outweigh increased wear and tear .
Should I use cement board or green board behind the walls of a neo angle shower?
I purchased a neo angle shower and I am installing it on the second floor of my house. I have the pan down and I am ready to drywall. which is safer to use, cement board or green board behind the shower panels?
I would always use cement board in the shower area. I would extend the cement board to where you shower unit will cover. You can go past that point just plaster with a nice joint compound, like durabond to join to the rest of the plaster board for a permanent bond. I typically do not use green board unless you expect the wall can get wet, like a basement. My bathroom is upstairs and my house would wash away before those walls got wet, therefore regular board is fine.
1
cement board in the shower area
What role is a "Heavy" supposed to fill?
Based on the name and my understanding of the TF2 class, a Heavy is a front-lines tanky soldier guy. But that doesn't really seem to be his role in XCOM. Assault soldiers are better at being in the front lines with their mobility and defensive abilities. What, then, is the heavy supposed to be doing on the battlefield? What are the general strategies that are useful for heavy soldiers?
Think of them as a heavy weapons team in certain games or in real-life combat: Relatively low mobility, but high damage output, specialized/explosive/armor-piercing weaponry, and suppressive fire. As you said, Assaults fill a "tankish" role as well as a scouting role. Heavies are the only class other than snipers that can shoot their primary weapon twice in a turn (with associated skill), which should indicate they can be more useful when used in a defensive capacity.
0.888889
Assaults fill a "tankish" role as well as a scouting role .
Get MS SQL Server to release disk space
A poorly managed database table has grown to be enormous. 48+gigs of orphan records. I am trying to clean it up and put my dangerously full hard drive back to a normal state. I will be deleting approx 400 million records from this table. This is running as I type. I notice that I am not seeing any drop in my hard drive space but I am seeing the memory drop on system table queries, I am running to get table size. The database is using "Simple Recovery Model". There are many questions similar to this with responses saying you need to shrink the database. But they go on to explain how bad/scary this is to do because of fragmented data etc. Since the database should not be this size. Is it still bad for me to shrink it? This is a production database. If I shrink it will it cause downtime or lock the database? In SQL Server Management Studio you have two options for shrink, database or files. Given my situation what would be the best option? is there a rule on the percentage of free space a DB should have? Even reading the tag description of shrink makes me not want to do it. Is there another way?
I will be deleting approx 400 million records from this table. Hopefully, you are doing it in chunks - to avoid bloating transaction log. notice that i am not see any drop in my hard drive space You wont, as you have to explicitly shrink the database file to release space. Just deleting the records, SQL server wont release the space back to the OS. Since the database should not be this size. Is it still bad for me to shrink it? It is generally a bad practice as databases should be presized properly. If you are 100% sure that your database is NOT going to be again this size, its OK for you to shrink the database (in your scenario). This is a production Database. If I shrink it will it cause downtime or lock the database? Shrinking a database is a very IO intensive. Its advisable to shrink using DBCC SHRINKFILE during maintenance window or when there is minimal activity. In management studio you have two options, Database or Files. Given my situation what would be the best option? You should use TSQL to do the shrink. (since you asked, shrinking FILE is the way to go instead of database). You can use shrink database in chunks - tsql script to do the shrink in chunks. Remember that when you shrink, you are fragmenting your indexes. is there a rule on the percentage of free space a DB should have? You can refer to Estimating Disk Space Requirements for Databases article. There is no fix rule, you have to take into account of how your database is expected to grow. You also have to take into account, autogrowth of your databases. References : Why Does the Transaction Log Keep Growing or Run Out of Space?
1
Is it still bad for me to shrink database?
Why a Transistor is considered to be an active device?
How it a Transistor an active device? Because it it not producing energy. We just feed it with energy and it amplifies it and that too not on his own but using a bias battery. So how it is considered to be an active device? Please can anyone provide full explanation?
That does not matter if it uses biasing to amplify input or not, the main thing here is that i can amplify the input. see you cannot carry such operation with resister or inductors
0.888889
amplify input without biasing
highcharts: stop chart from trapping mouse events, or capture mouse click on the ENTIRE chart
All, I'm using HighCharts in a web app I'm working on, and generally, I like it very much. However, I'm having a hard time figuring out how capture a mouse click on the ENTIRE chart. In other words - I'd like to know when the user clicks ANYWHERE on the chart (e.g., the plot area, the title, the x- or y-axis, the margins and padding around the chart elements, etc.) Or, I'd like to disable events altogether, so I can trap the event in the container itself. More detailed version... I have a DIV that contains my HighChart. I want to know if the user clicks ANYWHERE within that DIV. So - initially I tried attaching an "onclick" event to the DIV, but that never gets fired, presumably because the click is getting trapped by the HighChart. So, in the code that sets up the HighChart, I added this: var chart = new Highcharts.Chart({ chart: { renderTo: "container", events: { click: function(event) { // do something } }, ... } ... }); This works OK IF the user clicks somewhere within the plot area, but not if she clicks anywhere else in the chart (e.g., the x-axis, the y-axis, the title, the padding around the chart elements, etc.) So - how can I make the ENTIRE chart clickable? Many thanks in advance!
A very late answer, but still necessary, in my opinion. The highcharts documentation http://api.highcharts.com/highcharts#chart.events.click refers to a script that simply forwards an event to the chart's container: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/chart/events-container/ $(function () { $('#chart1').highcharts({ ... }); $('.chart-container').bind('mousedown', function () { $(this).toggleClass('modal'); $('.chart', this).highcharts().reflow(); }); });
1
script that forwards event to chart's container
Equivalent Key Signatures
I've noticed that a variety of pieces in the classical repetoire (certainly at least the piano repetoire), label what seems to be effectively the same key signature differently. That is, I am not aware of any differences in terms of key between a piece in "G Sharp major" and "A flat major" (or their equivalent minors). Is there any reason that sometimes a sharped key signature is used while at other times the equivalent flatted key signature is used? As a related point, I have undoubtedly noticed the preference of certain "equivalent" key signatures over others. For example, one encounters "E flat" significantly more than "D sharp" and likewise "C sharp" significantly more than "D flat". Is there any particular reason for this, or is it simply a convention that has been handed down to use through musical history?
Some of the answers have touched upon convenience for the player, but have missed one point about this. In making arrangements band and orchestral arrangements, I have found that wind players often prefer sharps to flats, preferring for example 7 sharps over 5 flats. This is noticeable particularly with transposing instruments. String players, on the other hand, seem to prefer flat keys to sharp ones.
1
String players prefer sharps to flats
How to crop a square at the exact centre of an image in Photoshop?
Given a square image, how can I crop, at the exact center, of the image? What if the image is not square itself? What if I'm using Photoshop CS6 or some older version? Is the procedure the same?
A simple method that works in all programs is to add another layer, and create a line from the upper left to the lower right corners, and the same for upper right to lower left. You can then select all, scale selection, and line it up on these lines. This will crop to the same aspect ratio, with a different overall size. Like this: While hardly being an elegant solution, it has the advantage of working on any platform.
1
Adding another layer to a line
I with my friends vs my friends and I
I'm pretty sure it's not correct to say I with my friends go to the cinema every weekend. However I sometimes hear it from other Russians. I have to use "and" instead of "with" and put this like this My friends and I go to the cinema every weekend. I'm still wondering what if... Am I right or wrong?
I would probably say either "I go to the cinema with my friends every weekend" or "I go to the cinema every weekend with my friends."
1
"I go to the cinema with my friends every weekend"
Can I restrict a vhost to only a local IP?
I have a subdomain I'd like to only be accessible by a local IP address. Is it possible to specify this in the vhost? I'm thinking it's not since I haven't found much on Google. If not, what's the best way to do this on an apache level? I forget the version of Linux we're using... but we have Samba running on it. The site I'm trying to restrict is our site's documentation.
Default Apache VirtualHost configuration has alias for /doc/ that redirects to Apache's documentation and access is restricted only to localhost. I think that is what you are looking for. Look at the Deny and Allow lines. Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory>
1
Default Apache VirtualHost configuration has alias for /doc/ that redirects to Apache documentation
Why would analysts recommend buying companies with negative net income?
Can anyone explain why some analysts recommend companies in the biopharmacy sector as a "buy" even though they have high R&D costs and no real profit? I followed three companies and I see the same story. The only positive number is income, and only in one case does it cover expenses after net borrowing. For the next four in a row, the net income the net income is below zero. Why are these companies a buy?
Most likely because they don't know what they're talking about. They all have a belief without evidence that information set X is internalised into the price but information set Y is not. If there is some stock characteristic, call it y, that belongs to set Y, then that moves the gauge towards a "buy" recommendation. However, the issue is that no evidence has been used to determine the constituents of X and Y, or even whether Y exists in any non-trivial sense.
1
No evidence has been used to determine the constituents of X and Y .
async & await - poll for alternatives
Now that we know what is in store for c#5, there is apparently still an opening for us to influence the choice of the two new keywords for 'Asynchrony' that were announced by Anders Heijsberg yesterday at PDC10. async void ArchiveDocuments(List<Url> urls) { Task archive = null; for(int i = 0; i < urls.Count; ++i) { var document = await FetchAsync(urls[i]); if (archive != null) await archive; archive = ArchiveAsync(document); } } Eric Lippert has an explanation of the choice of the current two keywords, and the way in which they have been misunderstood in usability studies. The comments have several other propositions. Please - one suggestion per answer, duplicates will be nuked.
It's worth noting that F# also uses the async keyword in its async workflows, which is pretty much the exact same thing as the new async functionality in C#5. Therefore, I'd keep that one the same For the await keyword in F#, they just use let! instead of let. C# doesn't have the same assignment syntax, so they need something on the right side of the = sign. As Benjol said, it functions the same as yield so it should almost be a variant of that.
1
F# also uses the async keyword in its workflows
Why is age 3 the age at which a girl is able to have intercourse?
In msh210's answer to this question of mine, he stated that: women...who physically could be [intimate with men], which is those who had reached their third birthday. In comments, he mentioned that: age three is the age at which a girl is halachically considered to be physically able to have intercourse. Could you explain why and where this comes from? Keep in mind I am not Jewish, so if it specific to some non-OT writings, please explain those as well.
The age at which a male is considered physically capable of intercourse is 9. That roughly corresponds with the onset of significant sexual desire and physical arousal. I cannot think of any comparable milestone in female development that occurs at age 3, nor am I aware of any sources discussing the topic. My best guess is that since we do not remember events which happened to us before about age 3, an event in which you were passive and which you cannot remember is not considered to be significant to you.
1
The age at which a male is considered physically capable of intercourse is 9.
How to wipe RAM on shutdown (prevent Cold Boot Attacks)?
My system is encrypted using Full Disk Encryption, i.e. everything except /boot is encrypted using dmcrypt/luks. I am concerned about Cold Boot Attacks. Prior work: https://tails.boum.org/contribute/design/memory_erasure/ http://tails.boum.org/forum/Ram_Wipe_Script/ http://dee.su/liberte-security http://forum.dee.su/topic/stand-alone-implementation-of-your-ram-wipe-scripts Can you please provide instructions on how to wipe the RAM once Ubuntu is shutdown/restarted? Thanks for your efforts!
Take a look at this thread http://ubuntuforums.org/showthread.php?t=1500936 If you still want to do it then: Look for secure-delete in Synaptic The Secure-Delete package comes with four commands: srm - Secure remove; used for deleting files or directories currently on your hard disk; smem - Secure memory wiper; used to wipe traces of data from your computer's memory (RAM); sfill - Secure free space wiper; used to wipe all traces of data from the free space on your disk; sswap - Secure swap wiper; used to wipe all traces of data from your swap partition. Source: http://ubuntuforums.org/showthread.php?t=1008111 And to make it run when you want: To execute a script upon rebooting Ubuntu Put your script in /etc/rc0.d Make it executable (sudo chmod +x myscript) Note: The scripts in this directory are executed in alphabetical order The name of your script must begin with K99 to run at the right time. To execute a script at shutdown Put your script in /etc/rc6.d Make it executable (sudo chmod +x myscript) Note: The scripts in this directory are executed in alphabetical order The name of your script must begin with K99 to run at the right time. Source: http://en.kioskea.net/faq/3348-ubuntu-executing-a-script-at-startup-and-shutdown If you do not know how to make a script: Make a text file in an easy to find directory: Code: #!/bin/bash COMMAND1 COMMAND2 COMMAND3` Use the shebang line that I have given. Replace COMMAND1 and etc with the command you would like the script to run. Save the text file and then you have to make it executable. For this I will assume that the the file is called "test.sh". To make it executable: chmod 775 test.sh Then you can run the script: ./test.sh Source: http://ubuntuforums.org/showthread.php?t=928839 Hope this helps, Leinardo
0.888889
Make a script executable in /etc/rc6
Which episodes of One Piece are filler?
I want to watch One Piece, but the anime has a lot of filler content not in the manga. I'd rather not watch the filler content and only watch the episodes which are directly related to the plot. To be clear, I'm defining a filler episode as one which is not based on any story in the manga or based on extra manga chapters which have nothing to do with the overarching story. Which episodes are filler? This question is taken from this question. I was curious about this myself after completing the One Piece manga, but to keep uniformity between similar questions, I took the same wording as Logan-M had used in his question about Bleach filler.
One piece fillers ^ pretty much tells what what to skip and what to watch: cannon - Watch filler - don't of and if your wondering, there are about 96 filler episodes.. (14% of the series) screenshot ->
1
14% of filler episodes
iTunes reject app for date of birth
I am iOS developer. I made an application for chat which required registration for go into app. In registration screen, it require DATE OF BIRTH. Apple reject my app for more than 3 times because of DATE OF BIRTH field. I have told them that into our privacy policy we described that user's age must be more than 17 so, we need to add this field for date verification. But, still they are rejecting my app. Please help me.
This isn't really something that anyone other than Apple could help you with. Here is a link to the guidelines for your app to be published. https://developer.apple.com/app-store/review/guidelines/ And here is a link to their support page. https://developer.apple.com/contact/ Best of luck.
0.888889
Apple's support page for your app
php regular expession convert to python code
i have this code written in php , and i want to convert it into python code $title_regex = "/<title>(.+)<\/title>/i"; preg_match_all($title_regex, $string, $title, PREG_PATTERN_ORDER); $url_title = $title[1]; /// fecth decription $tags = get_meta_tags($url); // fetch images $image_regex = '/<img[^>]*'.'src=[\"|\'](.*)[\"|\']/Ui'; preg_match_all($image_regex, $string, $img, PREG_PATTERN_ORDER); $images_array = $img[1]; i have tried this .. but it give me errors in pics part import re out=Data #web site html page .. title_regex = "/<title>(.+)<\/title>/i" #no need for this .. un used m = re.search("<title>(.+)<\/title>", out) print "title",m.group(1) #for pics i have tried this but it give me error .. pics = re.match(r"/<img[^>]*'.'src=[\"|\'](.*)[\"|\']/Ui", out)#the conversion is not correct print "grop",pics.group(1) my full code import re import urllib print "Start" url="http://www.deviantart.com" data=urllib.urlopen(url) out=data.read() print title_regex = "/<title>(.+)<\/title>/i" m = re.search("<title>(.+)<\/title>", out) print "first",m print "title=",m.group(1) title_regex = "/<title>(.+)<\/title>/i" pics = re.match(r"/<img[^>]*src=[\"|\'](.*)[\"|\']/Ui", out) print "pics>>",pics.group(1) how i can convert a php re>>"/]*'.'src=\"|\'[\"|\']/Ui" to a python re ?
the regular expression probably did not find anything. try this : also remove the /Ui at the end import re out=Data #web site html page .. title_regex = "/<title>(.+)<\/title>/i" #no need for this .. un used if m is not None: # NEW <---------------- m = re.search("<title>(.+)<\/title>", out) print "title",m.group(1) #for pics i have tried this but it give me error .. pics = re.match(r"<img[^>]*src=[\"|\'](.*)[\"|\']", out) if pics is not None: # NEW <---------------- print "grop",pics.group(1) for you 2nd question try this for filename in pics.groups(): print filename
0.777778
the regular expression probably did not find anything .
Making sure that you have comprehended a concept
Hi, I have a question that I've been thinking about for a long time. How can you assure yourself that you've fully comprehended a concept or the true meaning of a theorem in mathematics? I mean how can you realize that you totally get the concept and it's time to move on to the next pages of the book you're reading? Thanks in advance for your responses.
Here is a strategy that has worked well for me. Take a result you want to understand and try to prove it on your own. If you succeed, great! If not, peek at the beginning of the proof and close the proof the moment you reach an insight you weren't able to think up on your own. Try to prove this insight, and try to complete the proof with this insight at hand. If you succeed, great! If not, repeat. In my experience, trying and failing to prove a result gives you a good appreciation of the proofs that do work. Constructions which might otherwise seem artificial often make sense as overcoming some barrier or other that you stumbled upon.
1
Try to prove a result on your own
jQuery AJAX IE - skipped functions ajax
$("#multiselect").hide(); $("#multiselect_container").append('<img id="loader" src="/loader.gif" />'); Above 2 functions inside the $("#list").click() block are being skipped for some reason in IE, not FF, Chrome $("#list").click(function() { var selection = $(this).val(); $("#multiselect").hide(); $("#multiselect_container").append('<img id="loader" src="/loader.gif" />'); $.ajax( { url: 'include/ajax.php?id='+selection, async: false, dataType: 'json', success: function (json) { $("#loader").remove(); $("#multiselect").show(); //parse json } });//json }); What's going on: There is a button #list and a container #multiselect_container which holds #multiselect which is a select box of it's container's size. When #list is clicked, the select box is hidden and the container beneath it is shown, with a loading bar. When the ajax call is finished the loading bar is removed and the select box is shown again. In Firefox this works perfectly fine. In IE it does not. Things that I have tried: $('#list').ajaxComplete(function() {}); in the success section Sleeping the php file for 3 seconds. Same results, except with a delay. Removing the ajax block, those 2 calls are made properly. caching is not the issue, ajax calls are being made
You should change async: false to async: true. With async: false it would be normal behaviour for the display to not be updated until after the ajax call has completed. So that change might be enough to fix it. Otherwise read on... I've had a similar problem with IE before, where it just didn't want to update the display to show a "loading" type message while doing Ajax - even though the Ajax is asynchronous. It's not that the functions themselves are skipped, just that the display doesn't get updated until after the Ajax complete callback had executed too - and since the complete processing removes the "loading" message it's as if it never existed from the user's point of view. As with your code, my project worked fine in Firefox. It was a while ago, but if I remember rightly I got it to work in IE by introducing a short timeout on the Ajax call, something like this: $("#list").click(function() { var selection = $(this).val(); $("#multiselect").hide(); $("#multiselect_container").append('<img id="loader" src="/loader.gif" />'); setTimeout(function() { $.ajax( { url: 'include/ajax.php?id='+selection, async: true, // changed from false dataType: 'json', success: function (json) { $("#loader").remove(); $("#multiselect").show(); //parse json } });//json }, 5); });
0.777778
Change async: true to ajax
Reliable udp broadcast libraries?
Are there any libraries which put a reliability layer on top of UDP broadcast? I need to broadcast large amounts of data to a large number of machines as quickly as possible, and generally it seems like such a problem must have already been solved many times over, but I wasn't able to find anything except for the Spread toolkit, which has a somewhat viral license (you have to mention it in all materials advertising the end product, which I'm not sure our customer will be willing to do). I was already going to write such a thing myself (because it would be extremely fun to do!) but decided to ask first. I looked also at UDT (http://udt.sourceforge.net) but it does not seem to provide a broadcast operation. PS I'm looking at something as lightweight as a library - no infrastructure changes.
Though some research has been done on reliable UDP multicasting, I haven't yet used anything like that. You should take into consideration that this might not be as trivial as it first sounds. If you don't have a list of nodes in the target network you have no idea when and to whom to resend, even if active nodes receiving your messages can acknowledge them. Sending to a large number of nodes, expecting acks from all of them might also cause congestion problems in the network. I'd suggest to rethink the network architecture of your application, e.g. using some kind of centralized solution, where you submit updates to a server, and it sends this message to all connected clients. Or, if the original sender node's address is known a priori, then just let clients connect to it, and let the sender push updates via these connections.
0.333333
How to resend messages to a large number of nodes?
How do I delete nodes older than X days?
Does anyone have a snippet for deleting nodes that are older than 1 day? I would like to run this on cron tasks.
You could use the Auto Expire module. This module allows site administrators to set expiration times for content types. End users creating content that has auto expiry set cannot control the expiry time. They could be allowed to renew the content for one or more cycles. Before a node is expired a warning message is sent to the user that created that node. If the user has the proper rights he can then extend the node.
0.888889
Auto Expire allows site administrators to set expiration times for content types
PECL extension in Ubuntu 11.10
while setting up mediawiki on my local development machine, the installer told me that since i do not have PECL extension to php installed, i will have to do with slower page load speeds with traditional php page loading. Does PECL really increase page load speeds? How do i install it on my Ubuntu LAMP server?
sudo apt-get install php5-intl
0.888889
sudo apt-get install php5-intl
strtotime calculates wrong when moving over to linux (webhost) from windows (localhost)
I've some problem with make a simple PHP function to work on my webspace meanwhile it works like expected at my localhost server. The problem is the following calculation: echo $Formated = date("Ymd",strtotime("last day of next month")); This script dosen't seem to work b/c i simply gets the default date 19691231 instead of the correct one 20110630 when running it on my server. I use windows (XAMP) as my localhost server so i guess there must be some form of problem that lies within the two platforms way of handling it?
strtotime is notoriously problematic going cross-version, so I'd recommend a vast simplification. You can use the 't' character in the date format to represent the last day of the month, then reduce your strtotime call to simply return some timestamp for the next month. echo $Formated = date("Ymt", strtotime("next month"));
0.888889
strtotime is notoriously problematic going cross-version
What technique/sensor can I use to recognized tagged objects thrown onto a surface?
I am trying to implement a concept for somebody else. Basically, I want to create a smart surface. I want to create a surface I can throw one or more tagged objects on that should all be recognized. I am unsure how to this and what sensors I should use. I have been thinking about using one of the NFC ICs from NXP. However, designing a circuit board and buying this IC is too expensive for our idea. I'm also unsure of whether the surface area will cause problems, because it'll be quite large (think of a small coffee table). I've also been thinking about other ways to recognize objects, but I have not come up with anything yet. I am probably not using the correct term. Does anyone know of a type or sensor or technique to implement this? Note: I am a computer engineer, not an electrical engineer. I know the basics, but really not much more than that, so I prefer a solution that is available as a simple IC or a complete circuit board with the really complicated things done for me by the experts :)
Look for RFID tags, and RFID sensors. This RFID reader from SparkFun has a built-in antenna and a range of 200 mm and works with inexpensive 125 KHz RFID tags. Also, SparkFun has this USB RFID adapter to connect to a reader such as above, and provide USB data read off the tags directly to your computer or other device. If you need to span a large area such as a coffee table, your options are: RFID reader with external antenna port, or a number of integrated antenna RFID readers arranged around the periphery of the surface The mechanism used in some department stores, for instance, has their items tagged with RFID tags, and RFID antenna loops 3-5 feet tall and about a foot wide, on either side of the exit doors. The range is a few feet, which should serve the purpose. In your case, such an antenna would be a suitable loop of wire around the periphery of the surface. Note that this mechanism will not allow your system to distinguish between tagged objects actually dropped on the surface as opposed to held above it. If the "dropped on" parameter is crucial, then multiple smaller-range RFID readers would serve you better - or a metal contact surface that works as your antenna, designed for a very small read range.
0.888889
RFID tags, and RFID sensors from SparkFun
How do I join two cables outside so that they're safe and kept dry?
I have a new pond with a pump but the cable on the pump is far too short. I have some similar cable which will do the job to extend the length. My only concern is the junction outside. I need to make it dry and safe. What recommendations do people have? Can you buy a junction box that is suitable for outside use? If this helps I live in the UK.
Electricity is a funny thing and different applications apply for various situations. THis is UK/EU/US/Asia/Africa.. its all the same. If you are running a low voltage cable 0-48Volts DC/AC then you can use a pvc outdoor joiner (the screw caps have a rubber seal on them to prevent moisture from entering) If you are running high voltage (110AC/240AC) single phase then using a resin joiner is recommended! You might be tempted to do something like this (this example is of low voltage coax,tv,internet, etc) and is not recommended for outside situations at all! over time water will get in. That was undergorund application, you can also use these above ground, Notice the rubber seals- that is very important!
1
Electricity is a funny thing and different applications apply for different situations
What is crusty loaf bread?
I have a recipe for garlic crack bread (pull apart bread) that calls for a crusty loaf, preferably sourdough or Vienna. I have looked in the bakery sections and can not find. Is there possibly a different name I should be looking for?
It's any loaf with a crispy crust. There's not much more to it than that. If you can't find sourdough or Vienna, just use a standard white loaf with a crisp crust.
1
Use a standard white loaf with a crisp crust
Networking Questions: Serialization and Frequent Small Packets or Fewer Large Packets
I'm working with a socket server and I'm trying to decide how to update all of the clients. I'm currently sending few packets with entire objects serialized in JSON. In most cases this adds a lot of overheard in the form of unneeded data. This to me is a no brainer, get rid of the serialization and send only what is needed. Lets say I have four server-side AIs. Should I send all four of the AIs in one giant update, therefore serializing only the needed data or should I send each one in a separate update?
Generally speaking, if the game is fairly large or sends a lot of updates you should pack your packets small. However, if your game is only small and just something to play around with and scalability isn't a huge concern - just do what works.
0.777778
Pack your packets small if the game is large or sends a lot of updates
select additional columns not in dup checker query
In Access, I'm identifying duplicate records based on 28 columns. I want to also select a non-duplicate column but can't figure it out. tbl_1: bud_line | fund | name | amt 123 | ABC | BOB | $8 123 | ABC | BOB ROSS | $8 321 | ABC | BOB | $8 321 | AAA | BOB | $8 321 | AAA | BOB | $20 321 | XXX | JOHN | $10 321 | XXX | JOHN | $10 The only lines I want on the output would be: 123 | ABC | BOB | $8 123 | ABC | BOB ROSS | $8 321 | XXX | JOHN | $10 I was using a query like: select bud_line, fund, amt from tbl_1 group by bud_line, fund, amt having count(*) > 1 I get my dups, but I don't get the names BOB & BOB ROSS to identify them. I tried adding name to the select, but it errors because it's not part of the aggregate function.
In Access, you do this by joining back to the original table: select t.* from tbl_1 as t inner join (select bud_line, fund, amt from tbl_1 group by bud_line, fund, amt having count(*) > 1 ) as tt on t.bud_line = tt.bud_line and t.fund = tt.fund and t.amt = tt.amt order by bud_line, fund, amt; If you had a unique id on each row, you could do this with an exists clause, which could use an index and be faster: select t.* from tbl_1 as t where exists (select 1 from tbl_1 as tt where t.bud_line = tt.bud_line and t.fund = tt.fund and t.amt = tt.amt and t.id <> tt.id );
0.666667
Select t.* from tbl_1 as t inner join
Would it be a problem if all Amazon links were converted to affiliate links?
I'm thinking that one way Jeff and the Stack Overflow team could squeeze some extra money out of this site would be to automatically convert all Amazon links posted here into affiliate links, e.g. Stick "tag=codinghorror-20" (or more likely a new site-specific tag) onto every Amazon link. This would bring in some additional revenue every time someone purchased a book via a link on this site. They could do similar things with other links as well. Amazon's simply the most obvious choice. So my question is, would anyone have a problem with this? I know I wouldn't mind, but I don't know how other people would react. What does everyone think? Is this a horrible idea, a great idea, a waste of time?
(Two different respondents said:) Amazon affiliate links should be a bannable offense. I'd post any user-generated Amazon referrer link as offensive. Ok, WHY? If a person follows the link and buys a book, something is going to happen to the affiliate fee. Either it goes to a SO member, or Amazon keeps it. Why is it so vitally important that Amazon keeps it? Are you stockholders?
1
Amazon affiliate links are a bannable offense
Can this be a DoS Attack?
When I'm checking my log, I found like 15k events of " PAM service(sshd) ignoring max retries; 6 > 3 " I know this might be normal, and considered as Brute-Force attack, but can it be classified as DoS attempt? Sample of the log: | 8864611 | eros | 2014-08-11 18:18:38 | PAM service(sshd) ignoring max retries; 6 > 3 | | 8865352 | eros | 2014-08-11 18:46:59 | PAM service(sshd) ignoring max retries; 6 > 3 | | 8865364 | eros | 2014-08-11 18:47:13 | PAM service(sshd) ignoring max retries; 6 > 3 | | 8865693 | eros | 2014-08-11 19:00:39 | PAM service(sshd) ignoring max retries; 6 > 3 | | 8865700 | eros | 2014-08-11 19:01:55 | PAM service(sshd) ignoring max retries; 6 > 3 | | 8865706 | eros | 2014-08-11 19:02:11 | PAM service(sshd) ignoring max retries; 6 > 3 | | 8865716 | eros | 2014-08-11 19:02:28 | PAM service(sshd) ignoring max retries; 6 > 3 | | 8866965 | eros | 2014-08-11 19:59:47 | PAM service(sshd) ignoring max retries; 6 > 3 | | 8867068 | eros | 2014-08-11 20:00:18 | PAM service(sshd) ignoring max retries; 6 > 3 | | 8896353 | eros | 2014-08-12 17:31:33 | PAM service(sshd) ignoring max retries; 6 > 3 | | 8896363 | eros | 2014-08-12 17:31:49 | PAM service(sshd) ignoring max retries; 6 > 3 | | 8901992 | eros | 2014-08-12 21:40:48 | PAM service(sshd) ignoring max retries; 6 > 3 | | 8902001 | eros | 2014-08-12 21:41:03 | PAM service(sshd) ignoring max retries; 6 > 3 | | 8902007 | eros | 2014-08-12 21:41:18 | PAM service(sshd) ignoring max retries; 6 > 3
If this were a denial of service attack, you'd be seeing those 15k messages covering less than an hour -- probably far less. This is just the botnet-based brute-force attack on SSH passwords that constitutes part of the "background noise" of the Internet. Make sure you're using strong passwords (or better yet, key-based authentication) and that you've disabled root login over SSH, and don't worry about it.
0.666667
Denial of service attack on SSH passwords
Reliable udp broadcast libraries?
Are there any libraries which put a reliability layer on top of UDP broadcast? I need to broadcast large amounts of data to a large number of machines as quickly as possible, and generally it seems like such a problem must have already been solved many times over, but I wasn't able to find anything except for the Spread toolkit, which has a somewhat viral license (you have to mention it in all materials advertising the end product, which I'm not sure our customer will be willing to do). I was already going to write such a thing myself (because it would be extremely fun to do!) but decided to ask first. I looked also at UDT (http://udt.sourceforge.net) but it does not seem to provide a broadcast operation. PS I'm looking at something as lightweight as a library - no infrastructure changes.
Have a look around the IETF site for RFCs on Reliable Multicast. There is an entire working group on this. Several protocols have been developed for different purposes. Also have a look around Oracle/Sun for the Java Reliable Multicast Service project (JRMS). It was a research project of Sun, never supported, but it did contain Java bindings for the TRAM and LRMS protocols.
0.666667
Look around Oracle/Sun for Java Reliable Multicast
Make app notifications ring as loudly as the phone
I have a the IFTT app set up to send me very important ios notifications. I need it to wake me up at night. How can I make the notification sounds max loudness and ring for as long as a phone ring?
The phone ringing is, technically speaking, a notification sound, and uses the same volume setting as all other notifications (called Ringer Volume). As far as notification tone length, you would need to contact the app's developer. You cannot set custom tones (at least, outside the app) for 3rd-party iOS apps like you can with Phone, Messages, etc.
1
Phone ringing uses same volume setting as all other notifications (called Ringer Volume)
Suppress 'file truncated' messages when using tail
I'm tailing a log file using tail -f messages.log and this is part of the output: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eget tellus sit amet odio porttitor rhoncus. Donec consequat diam sit amet tellus viverra pellentesque. tail: messages.log: file truncated Suspendisse at risus id neque pharetra finibus in facilisis ipsum. It shows tail: messages.log: file truncated when the file gets truncated automatically and that's supposed to happen, but I just want tail to show me the output without this truncate message. I've tried using tail -f messages.log | grep -v truncated but it shows me the message anyway. Is there any method to suppress this message?
If grep doesn't get rid of the output, it's most likely being printed on standard error. The simplest way to get rid of that is to simply dump it: tail -f messages.log 2>/dev/null
0.888889
tail -f messages.log 2>/dev/null
Add targeting when posting to a page using Facebook API
I'm trying to post to a page on facebook using the facebook API. But I want to customize the post target. When I post to a page on facebook I get these results : You get Shared with : (languages...) and News feed targeting : (languages...) But when I post to a page on my custom website using the facebook api I get these results : I only get the News feed targeting and not the shared with... Does anybody knows what to use to get the Shared with options using the facebook API? To get the News feed targeting I'm using : var feed_targeting = { 'locales': ["1001", "1", "2", "4", "9"], }; But I want to know what to use for the Shared with option.... Thanks
Have a look at https://developers.facebook.com/docs/graph-api/reference/v2.1/page/feed/#pubfields – there’s feed_targeting and targeting, those are two different things. targeting: Object that limits the audience for this content. Anyone not in these demographics will not be able to view this content.
1
Object that limits the audience for this content
Can Noether's theorem be understood intuitively?
Noether's theorem is one of those surprisingly clear results of mathematical calculations, for which I am inclined to think that some kind of intuitive understanding should or must be possible. However I don't know of any, do you? Independence of time <=> energy conservation. Independence of position <=> momentum conservation. Independence of direction <=> angular momentum conservation. I know that the mathematics leads in the direction of Lie-algebra and such but I would like to discuss whether this theorem can be understood from a non-mathematical point of view also.
Well, I don't know about any intuitive explanation besides intuition gained by understanding the underlying math (mainly differential geometry, Hamiltonian mechanics and group theory). So with the risk of not giving you quite what you want, I'll try to approach the problem mathematically. If you know Hamiltonian mechanics then the statement of the theorem is exceedingly simple. Assume we have a Hamiltonian $H$. To this there is associated a unique Hamiltonian flow (i.e. a one-parameter family of symplectomorphisms -- which is just a fancy name for diffeomorphisms preserving the symplectic structure) $\Phi_H(t)$ on the manifold. From the point of view of Lie theory, the flow is a group action and there exists its generator (which is a vector field) $V_H$ (this can also be obtained from $\omega(\cdot, V_H) = dH$ with $\omega$ being the symplectic form). Now, the completely same stuff can be written for some other function $A$, with generator $V_A$ and flow $\Phi_A(s)$. Think of this $A$ as some conserved quantity and of $\Phi_A(s)$ as a continuous family of symmetries. Now, starting from Hamiltonian equation ${{\rm d} A \over {\rm d} t} = \left\{A,H\right\}$ we see that if $A$ Poisson-commutes with $H$ it is conserved. Now, this is not the end of the story. From the second paragraph it should be clear that $A$ and $H$ don't differ that much. Actually, what if we swapped them? Then we'd get ${{\rm d} H \over {\rm d} s} = \left\{H,A\right\}$. So we see that $A$ is constant along Hamiltonian flow (i.e. conserved) if and only if $H$ is constant along the symmetry flow (i.e. the physical laws are symmetric). So much for why the stuff works. Now, how do we get from symmetries to conserved quantities? This actually isn't hard at all but requires some knowledge of differential geometry. Let's start with most simple example. Translation This is a symmetry such that $x \to x^\prime = x + a$. You can imagine that we move our coordinates along the $x$ direction. With $a$ being a parameter, this is a symmetry flow. If we differentiate with respect to this parameter, we'll get a vector field. Here it'll be $\partial_x$ (i.e. constant vector field aiming in the direction $x$). Now, what function on the symplectic manifold does it correspond to? Easy, it must be $p$ because by differentiating this we'll get a constant 1-form field $dp$ and then we have to use $\omega$ to get a vector field $\partial_x$. Other way to see that it must be $p$: suppose you have a wave $\exp(ipx)$. Then $\partial_x \exp(ipx) = ip \exp(ipx)$ so momentum and partial derivatives are morally the same thing. Here we're of course exploiting the similarity between Fourier transform (which connects $x$ and $p$ images) and symplectic structure (which combines $x$ and $p$). Rotation Now onto something a bit harder. Suppose we have a flow $$\pmatrix{x \cr y} \to \pmatrix{x' \cr y'}= \pmatrix{\cos(\phi) & \sin(\phi) \cr - \sin(\phi) & \cos(\phi)} \pmatrix {x \cr y} $$ This is of course a rotational flow. Here we'll get a field $y {\rm d}x - x {\rm d} y$ and the conserved quantity of the form $y p_x - x p_y$ which can in three dimensions be thought of as a third component of angular momentum $L_z$. Note that the above was done mainly for illustrative purposes as we could have worked in polar coordinates and then it would be actually the same problem as the first one because we'd get the field $\partial_{\phi}$ and conserved quantity $p_{\phi}$ (which is angular momentum).
0.666667
How do we get from symmetries to conserved quantities?
What is the Gorel Hagra?
What is it? How is it performed? May one perform it? And, if so, when may it be used?
In this article from The Seforim Blog, under the heading "Bibliomancy", it says: Another interesting method found in this sefer is the method of gorel using a Chumash to find out what to do: ואני הצעיר הכותב קבלתי שצריך לעשות הגורל הנז' בחומש מכתיבת יד שאין בו כי אם חמשה חומשי תורה ואפילו לא הפטרות. והשלך שבעה שביעיות שהם מט, ומן שער החמישים יוצא כזה השלך ז' עלין... (עמ' קפט)‏ This concept has been used by many and is more recently the subject of two books, Gorel Hagra and Hegyon ha-Gorel from E. Martzbach. See also Bromberg's book, Me-Gedolei ha-Torah veha-Chasidut on the Marsham, pp. 129,144; Eliach in his book Ha-Goan, pp. 1110-1127; Alei Tamar, Shabbat, pp.83-4; R. Reuven Margolis, Mekor Chesed, p.214. I haven't actually looked up any of these sources, but I thought someone might find this useful.
1
Method of gorel using a Chumash
Where did the SIP settings go to on my LG Optimus 4X?
About 3 months ago I bought my LG Optimus 4X HD (aka P-880), which shipped with Android 4.0.3. I searched the settings up and down, and was quite surprised there were no SIP settings available. I'm very sure SIP support was added to AOSP with Gingerbread, so it had to be there with ICS! Did LG remove them from their Android installation? Is there any way to get them back?
That sip settings are hidden in "activities" below "Telefon", it took me a while to find it. Creating a SIP Account was possible but it was not stored permanently. After closing the sip settings and opening it again it's gone. Still using Vimtura Vimphone as sip dialer. LG P880 fw v.20b, Android 4.1.2
1
Sip settings in "activities" below "Telefon"
How do I make image-based tiled background for UIView so that it doesn't scale?
In iOS application, I have 250x85pt UIView. I would like it to have image-based tiled background. The original image is 398x398 px. I would like my image to tile. When I run application, my image tiles, but for some reason it scales as follows: I used the following code to achieve it: var image = UIImage(contentsOfFile: "myfilepath.png")! var uicolor = UIColor(patternImage: image) uiview.backgroundColor = uicolor Could you explain 1. why ios scales my image, and 2. how do I draw tiled image without scaling?
To expand on Banto's answer, the issue is that your view is 250x85 points, which, on retina devices is really 500x170 pixels. When your x1 image is turned into a pattern it is applied at the point level. The problem can be easily changed by setting the scale on the image to match the scale on the device: let view = UIView(frame: CGRect(x: 0, y: 0, width: 250, height: 85)) let image = UIImage(named: "myfilepath.png")! let scaled = UIImage(CGImage: image.CGImage, scale: UIScreen.mainScreen().scale, orientation: image.imageOrientation) view.backgroundColor = UIColor(patternImage: scaled!)
0.666667
Banto's answer is that your view is 250x85 points, which on retina devices is really 500x170 pixels
MVC4 jQuery UI does not work
I cannot get jQuery UI working in my ASP.NET MVC4 application. I tried dialog and datepicker. Here is part of the code of my view. <link href="../../Content/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" /> <script src="../../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script> <script src="../../Scripts/jquery-ui-1.8.11.min.js" type="text/javascript"></script> <script language="javascript" type="text/javascript"> $(document).ready(function () { alert('A'); //$('#datepicker').val('test'); $('#datepicker').datepicker(); alert('B'); }); </script> <h1>Test</h1> <form id="testForm" action="#" method="get"> <input type="text" id="datepicker" name="datepicker" class="datepicker" /> </form> The alert A is displayed. When I uncomment the next row, the value test is assigned. But datepicker is not working and alert B does not display. Thanks, Petr
I spent lots of time to figure out how to make it working. Finally the steps are following: Create ASP .NET MVC4 project Internet Application. Clean some of the last lines of the _Layout.cshtml so it should look like this <footer> <div class="content-wrapper"> <div class="float-left"> <p>© @DateTime.Now.Year - My ASP.NET MVC Application</p> </div> </div> </footer> @RenderSection("scripts", required: false) Change header like I did here <head> <meta charset="utf-8" /> <title>@ViewBag.Title - My ASP.NET MVC Application</title> <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <meta name="viewport" content="width=device-width" /> @Styles.Render("~/Content/css") @Styles.Render("~/Content/themes/base/css") @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/jqueryui") @Scripts.Render("~/bundles/modernizr") <script type="text/javascript"> $(document).ready(function () { // We will test DataPicker $('#datep').datepicker(); // We will test TABS $(function () { $("#tabs").tabs(); }); }); </script> </head> Delete all code after @section featured { section and add some html to Home/Index.cshtml A. Put some code from the view source link of http://jqueryui.com/tabs/ page (It is inside of < div id="tabs" > ... < div >) B. Add this < div > Date: < input id="datep" type="text" / > < / div > DONE!!!
0.777778
Create ASP.NET MVC4 project Internet Application
Front wheel shudder on Cyclocross brakes
I have a Javelin Primitivo with cantilever brakes. My front fork is carbon. When I brake the front wheel will "shudder". I replaced my wheels and adjusted my brakes (toed them in). I have even tried my road bike wheels. Any thought on solving this? I would like to upgrade my brakes but I want to keep the option for my wide tires.
The stutter comes from the way the brakes are actuated. From the picture on Javelin's site I see that the housing is held at the top of the head-tube. When you brake the fork flexes backwards causing the cable's tension to change. The brakes will be slightly released causing to fork to move again, re-tightening the brakes, pushing the fork backwards. This happens in quick succession thus the brake stutter. The way to cure it is to move the attachment of the cable-housing to the crown of the fork. There are front cable hangers that can be screwed to the hole where a side-pull brake would be attached. Google for 'Front Cable Hanger Fork Mount'
0.888889
The stutter comes from the way the brakes are actuated
How do you decide what to get first, Forge or Twilight Council?
Once you have a decently size ground force (~ 6 troopers?), you want to start upgrading them, right? Now ... if you're seeing some concrete threat like Mutas or Tanks, then you'll want a specific upgrade like Blink or Charge. But ... assuming you haven't found any concrete intel at this point, what do you lay down first, Twilight Council or Forge? While Forge in itself isn't that expensive, you can't seriously plan to build both Forge and Twilight Council and and have enough minerals / gas left to buy upgrades at both. One advantage of Twilight is of course enabling High/Dark Templars. So ... how (and when) do you decide which of them to get first?
I'll try to cover as much as I can in this answer. As I stated in my comment it depends on what race you are playing against, what you scout, and when you are trying to get both these buildings. Map size also factors into your decision as well. Since you are referring as to having to make a choice, I'm going to assume that you are trying to do this off one base on a relatively smaller map so all answers below will be tailored around that assumption. If it's a big map (like Tal'darim Alter) you can quickly get a second base and do something like a +1/+1 + charge or blink attack. So what race are you playing against. Terran If you are playing terran that is going a heavy bio start, a forge is a good choice with a small zealot, sentry, and stalker army. Getting a quick +1 armour will reduce marine damage to zealots to 1 with a guardian shield up (Guardian shield reduces damage by 2, zealots start with 1 armour, marines attack for 5) making them that much stronger against against a bio army. If you scout them and they're going a tech route then it will boil down to what you plan on doing with your army and what path you will be choosing. Archons and storms do significant damage to a terran army late game. The same can be said if you go with colossi and upgrades if they don't have vikings either. Zerg This is a tough one to make a choice because zerg can swap so quickly with their army composition. The safer choice between the two is to go forge first with a +1 attack upgrade. The +1 attack allows for zealots to 2 shot zerglings instead of 3. This increases the effectiveness of zealots versus zerglings by 33%. That said, if they go roaches and you're heavy zealot, they can be kited forever on and off creep so you need to make sure you are fighting on your terms. A few sentries thrown in will stop them from running away so you can deal your damage. It does also mean that blink stalkers will have a significant advantage over roaches as well. Even charge would work too. But it depends on what their army composition is so you sort of need the most well rounded army possible. Keep in mind, late game, storms are very helpful versus the swarm. Protoss Again this comes down to army composition. If it's a stalker vs stalker fight, the player with blink will win (assuming properly blink micro). If one of the players goes the colossi route later on, the one with the forge early with early attack upgrades will destroy the army of the guy that doesn't have the upgrades. This mirror match-up is difficult to theorize without scouting information. If you see a forge upgrading you need to get one in response, if you fall behind you will lose. It really depends on what you plan on going for a build. Generally speaking though forge is the safer bet. You can get quicker upgrades, and if you scout a Twilight council and dark shrine you have access to dropping a cannon to save you from Dark Templars as well without having to spend the money on a Robotics Bay and get an observer.
1
What race are you playing against in terran?
Generally speaking, how much does the Incredible Hulk weigh?
Once he transforms from his puny human form, how much does the Incredible Hulk weigh?
This wikia lists different weights for the different forms. As Banner he is 128lbs As the Savage Hulk he weighed 1040-1400lbs. As the grey Hulk he was 900lbs As the merged, intelligent Hulk he was 1150lbs.
1
wikia lists different weights for different forms
Is it ok to use self-signed certificates for smtp transport?
By "by ok to use" I mean: are MTA agents receiving emails from my server going to reject my email if not, are they going to make other kind of bad treatment for my emails (marking as spam, unsafe and so...)? ...or is it just better idea to stick with non-encrypted emails?
Like MadHatter said, at the moment encryption using a self-signed certificate is actually a step up in comparison to many other small time SMTPs if you are talking SMTP-relaying. There are a few drawbacks, however, but not of the kind you expect. The most important one being your SMTP-clients choking on encryption. There are many small SMTP-clients deployed in off-the-shelf solutions for common business problems that don't like SMTP encryption and fail -- often silently! So, if you are using standard software with built-in mail clients, check them before you switch. Other than that I'd say, if you are concernced about your mail being marked as spam, consider setting up SPF and DKIM. That helps very much.
1
Small time SMTP-clients choking on encryption
Earth-Moon orbiting each other after being engulfed by Red Giant
Recently some exoplanets were discovered which are thought to be the leftover cores of giant planets that had survived a star becoming a Red Giant and then shrinking back to a subdwarf. If giant planet cores can last the lifetime of a Red Giant, then maybe smaller planets can survive at least for a while. When the Sun becomes Red Giant, if the Sun engulfs the Earth and Moon before they have evaporated, what will happen to the Earth-Moon orbit ? Will they be crashed into each other, or will they drift apart or will the orbit remain stable for a while before they are melted and evaporated away? Edit: Newly found planets are 'roasted remains' BBC News, 21 December 2011 Edit: More planetary systems around white dwarfs (WD 0421+162 and WD 0431+126) that shows signs of planets being consumed by the stars. http://news.discovery.com/space/alien-life-exoplanets/hubble-discovers-planet-graveyard-130509.htm
The problem with answering your question is that red giant stars don't have a well defined edge. It's a bit like Earth's atmosphere. The density gets gradually lower as you move away from the centre but it's hard to draw a line and say "this the edge". So when you say the Sun engulfs the Earth, it depends on how deep into the Sun the Earth gets and how long it stays there. I'd guess you're talking about the planet orbiting V391 Pegasi, and this does seem to have originally orbited at about the Earth's orbit. However it's much much heavier than the Earth so there would have been more of it to evaporate and it would survive longer than the Earth. We don't know exactly what the planet's original orbit was, or how big V391 Pegasi got during it's red dwarf phase, and we don't know how much of the planet was evaporated. I think the best that we can say is it neither proves the Earth-Moon system will be destroyed nor proves that it will definitely survive. It does suggest that the possibility exists.
0.666667
Red giant stars don't have a well defined edge
Huffy Cranbrook 26" Ladies' Cruiser crank / pedal / chain "pop" sound...?
Before you say it's a cheap bike, what more do you want... I get that! :D But it's brand new, and as you pedal it... no matter the speed, you get a pop sound at a specific point on each rotation... What could / should I do to help silence this sound and make the ride more enjoyable. Please advise if you can! VIDEO UPDATE: I uploaded this video of the happenings ;)
I have the exact same bike with the exact same problem. After a while of riding the chain broke and fell off on the road leaving me without brakes headed into traffic. I suggest buying a new chain for these bikes. So far I've had to replace quit a few of the parts on this bike, including the plastic pedals, the handle bar grippers, the chain, and both inner tubes( which suddenly popped with no sign of a puncture). It's a good looking bike but just about everything on it is trash.
1
Chain broke and fell off on the road leaving me without brakes headed into traffic
What does chain worn indicators 75% mean?
I've bought a chain wear checker made by BBB, but not sure what the percentage of worn is about? It has 2 sides, one of them indicates that the chain is worn 75% and I should replace it in the near future. The other side shows, that the chain is 100% used and should replace it as soon as possible. My detailed question : What does these percentage mean? What is the equivalent of it in the metric system? Will 75% worn state affect my cogwheels also? Can I replace the chain to a new one without changing the drivetrain's other elements? I use a single-speed bike. Chain width is 1/8 inch. It consists 94 chain. (400km (250miles) / month)
That is not 75%, it is 0.75%. - as @Batman said. According to other sources, it is already too late to change the chain. (Than what the purpose of this tool? - would be the next question) From wikipedia : "Twenty half-links in a new chain measure 10" (254 mm), and replacement is recommended before the old chain measures 256 mm (0.7% wear)"
1
What is the purpose of changing a chain?
What does the different coloured smoke in Once Upon a Time mean?
In Once Upon a Time, when you use magic we usually see that magic looks like colored smoke/mist like in this picture. Is there a symbolic meaning behind the different colors when using magic or is it just for show? E.g. Rumplestilskins magic looks red, Zelenas is Green, Emmas is blue or maybe purple I think. Anyone know.
As far as I know, the meaning behind the colored smoke has never been explained. Each magic user seems to have their own personal color that tinges the magic they do, but if there is any deeper meaning to those colors it has not been specifically addressed. It has been addressed that the colors are intentionally distinct. Regina recognizes the "green smoke" as being a signature of the Wicked Witch from Oz. The colors do seem to be chosen intentionally to represent the person that uses them. Zelena's entire motivation now is jealousy (of Regina) so green fits her well, and Rumple is a very angry person, so he gets red. But I don't think it's as simple as the user's emotions choosing their color: remember that Zelena's magic was always green, long before her jealousy emerged and caused her skin to change. And Regina's purple smoke is the color of royalty, fitting her status as Evil Queen, but doesn't really match any of the emotions she tends to exhibit.
1
The meaning behind the colored smoke has never been explained . "green smoke" is a signature of the Wicked Witch from Oz
Verify $_POST script will work correctly
can someone read through this script really quick and verify that I didn't miss anything... I'm not getting any errors in my IDE so just have to make sure the structure is correct <?php require_once '/usr/local/cpanel/3rdparty/lib/php/Mail.php'; $db_server = 'localhost'; $db_user = '-----'; $db_pass = '-----'; $dbc = mysql_connect ($db_server, $db_user, $db_pass); if (!$dbc) { die(mysql_error()); header ('Location: /contact'); exit; } if ($_POST['contactsent'] != 'yes') { header ('Location: /contact'); exit; } else { if (is_array($_POST)) { foreach ($_POST as $key => $value) { $_POST[$key] = mysql_real_escape_string(stripslashes($value)); } } $RequestType = $_POST["RequestType"]; $ConsumerBusiness = $_POST["ConsumerBusiness"]; $GlobalLocation = $_POST["GlobalLocation"]; $FirstName = strtolower(str_replace("'","''",$_POST["FirstName"])); $FirstName = strtoupper(substr($FirstName,0,1)).substr($FirstName,1); $LastName = strtolower(str_replace("'","''",$_POST["LastName"])); $LastName = strtoupper(substr($LastName,0,1)).substr($LastName,1); $Email = strtolower(str_replace("'","''",$_POST["Email"])); $Title = strtolower(str_replace("'","''",$_POST["Title"])); $Title = strtoupper(substr($Title,0,1)).substr($Title,1); $Company = strtolower(str_replace("'","''",$_POST["Company"])); $Company = strtoupper(substr($Company,0,1)).substr($Company,1); $Address = strtolower(str_replace("'","''",$_POST["Address"])); $Address = strtoupper(substr($Address,0,1)).substr($Address,1); $City = strtolower(str_replace("'","''",$_POST["City"])); $City = strtoupper(substr($City,0,1)).substr($City,1); $State = $_POST["State"]; $Zip = $_POST["Zip"]; $Phone = $_POST["Phone"]; $F = $_POST["F"]; $ProductDesc = $_POST["ProductDesc"]; $Comment = $_POST["Comment"]; if ($GlobalLocation == "Canada"): $SendTo="[email protected]"; elseif ($GlobalLocation == "Central America"): $SendTo="[email protected]"; elseif ($GlobalLocation == "Europe"): $SendTo="[email protected]"; elseif ($GlobalLocation == "Mexico"): $SendTo="[email protected]"; else: $SendTo="[email protected]"; endif; function dbSet($fields, $source = array()) { $set=''; if (!source) $source = &$_POST; foreach ($fields as $field) { if (isset($source[$field])) { $set.="`$field`='".mysql_real_escape_string($source[$field])."', "; } } return substr($set, 0, -2); } // INSERT INTO DATABASE mysql_select_db("new_contact",$dbc) or die("Could not select new_contact"); $fields = explode(" ", "RequestType ConsumerBusiness GlobalLocation FirstName LastName Email Title Company Address City State Zip Phone F ProductDesc Comment"); $query = "INSERT INTO new_contact SET ".dbSet($fields, $_POST); mysql_query($query); // SETUP EMAIL $Bodycopy = "This information was submitted via the ------.com website and sent to you because of the location identified by the user. <br>If this has reached you in error, please forward this email to [email protected]"; $Bodycopy. "<br>----------------------------------------------------------------------------------------------<br><br>"; if ($RequestType != "") $Bodycopy. "What kind of information do you need? : " .$RequestType. "<br>"; if ($ConsumerBusiness != "") $Bodycopy. "What type of customer or vendor are you? : " .$ConsumerBusiness. "<br>"; if ($GlobalLocation != "") $Bodycopy. "Global Location : " .$GlobalLocation. "<br>"; if ($Company != "") $Bodycopy. "Company : " .$Company. "<br>"; if ($FirstName != "") $Bodycopy. "First Name : " .$FirstName. "<br>"; if ($LastName != "") $Bodycopy. "Last Name : " .$LastName. "<br>"; if ($Title != "") $Bodycopy. "Title : " .$Title. "<br>"; if ($Email != "") $Bodycopy. "Email : " .$Email. "<br>"; if ($Address != "") $Bodycopy. "Address : " .$Address. "<br>"; if ($City != "") $Bodycopy. "City : " .$City. "<br>"; if ($State != "") $Bodycopy. "State : " .$State. "<br>"; if ($Zip != "") $Bodycopy. "Zip/Postal Code : " .$Zip. "<br>"; if ($Phone != "") $Bodycopy. "Phone : " .$Phone. "<br>"; if ($F != "") $Bodycopy. "F : " .$F. "<br>"; if ($ProductDesc != "") $Bodycopy. "UPC or product description : " .$ProductDesc. "<br>"; $Bodycopy. "<br>----------------------------------------------------------------------------------------------<br><br>"; if ($Comment != "") $Bodycopy. "Comments : <br>" .$Comment. "<br>"; $Bodycopy. "<br><br>"; $Bodycopy. $IP = $_SERVER["remote_addr"]; // PROCESS EMAIL // mail server info... $from = $SendTo; $to = "Do Not Reply <donotreply@------>"; $subject = "Website Contact : " . $GlobalLocation; $body = $Bodycopy; $host = "mail.------"; $port = "25"; $username = "donotreply@-------"; $password = "-------"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'port' => $port, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else { echo("<p>Message successfully sent!</p>"); } // MAKE SURE DB CONN IS CLOSED mysql_close($dbc); // REDIRECT TO THANK YOU PAGE header ('Location: /index.php?option'); exit(); } ?>
Although it'll lenghten your code quite a bit, in my opinion it's worth checking if the $_POST variables are set (using isset), to avoid any exceptions.
1
Check if $_POST variables are set
How to convert particles to mesh
I need to convert a Particle System to a mesh object, so I can export it to Unity 3D. How could I do this?
This is pretty easy to do for hair particles. In Blender, particles are "stored" in a Modifier, which means it can be applied like any other; This only works for hair particles, for obvious reasons. To convert your Particles, go to the Properties editor and navigate to the Modifiers tab; Here, you'll find all modifiers applied to the selected object, including the Particle System modifier. You can then press Convert to convert your particles into a mesh.
0.777778
In Blender, particles are stored in a Modifier
iOS fetching from managed object context before saved
If I add entities to a moc and I execute a fetch request on that moc before its document gets a chance to save, will my fetch contain the newly added entities? (I'm unsure how to test this out because of the auto-save feature)
I guess you're using UIDocument when you say 'auto-saving'. If you aren't, then there is no 'auto-saving' (except when using Apple template code and the app delegate saves before termination). When you create the fetch request, you can choose whether it should include unsaved items using the includesPendingChanges property. It defaults to YES so by default you will see unsaved items in the results.
1
UIDocument when you say 'auto-saving'
Where exactly is the London Shoreditch National Express Coach Stop?
For some reason the rubbish website shows that the Shoreditch stop is just off the Ivory Coast. Any idea where it actually is?
The National Express website is presumably the one you mean, where it shows it off the African coast. However, if you look further down the page, it says: London (Shoreditch) Bethnal Green Rd (to Stansted Airport: Stop J opp Overground Stn; or from Stansted: Stop K) Bethnal Green road on Google Maps clearly shows the road running west-east, with the Overground station indicated on the same map. Hope that helps!
0.888889
The National Express website shows Bethnal Green Road off the African coast
rails rspec integration_tests and http authentication
I am using Rspec 2 and capybara and defined the basic integration test, i.e. describe "EeRequisitions" do describe "GET /ee_requisitions" do it "works! (now write some real specs)" do get ee_requisitions_path response.status.should be(200) end end end Since the app uses HTTP basic authentication and since capybara says it includes Rack::Test, I expected that adding the line: authorize 'user', 'password' would handle it (I've since lost the stackoverflow post that told me that). Unfortunately it didn't - it kept throwing a 'method not found' error. I finally found the solution in a comment to this post: Rails/Rspec Make tests to pass with http basic authentication where Matt Connelly pointed me to this gist: https://gist.github.com/mattconnolly/4158961 which finally solved my problem. However, I'm still wondering why the Rack::Test approach failed as it seems to have worked for others.
Does including the line include Rack::Test::Methods at the top of the tests make a difference?
0.666667
How do I include Rack::Test::Methods at the top of the tests?
Run commands on a different computer
Here's the situation: I have one server and two terminals. I want to run a semi-automatic backup that will be run on one of the terminals, which will, obviously, back up some files, etc. However, one of the commands which the back up should do is run a shell command that should be ran at the server (sql server command). How can I run a command on the server from the terminal? Right now I'm using batchrun for the backup, running it from a vnc on the server. EDIT: They're all Windows machines.
Use SysInternals PSExec. It allows you to remotely execute files on any Windows system you have administrator credentials for. You could add a psexec command to the batch file (or whatever you're using) on the terminal which will then run the desired commands on the server.
1
SysInternals PSExec
How do I fix a puncture?
I got a flat/puncture on my bike tube, how can I fix it myself without going to the nearest bike shop? What kind of equipment would I need?
I really recommend the park tool glueless 'Super Patch' - so much less faff, and all you need to carry are the tyre levers and the patches. No cementing, no sandpapering, you just stick it straight on. It Just Works. (Disclaimer, I've chucked my amazon associate tag in that link. I do not work for amazon or Park tool.)
1
'Super Patch' is a park tool glueless glueless patch
Is there any performance difference between ++i and i++ in C#?
Is there any performance difference between using something like for(int i = 0; i < 10; i++) { ... } and for(int i = 0; i < 10; ++i) { ... } or is the compiler able to optimize in such a way that they are equally fast in the case where they are functionally equivalent? Edit: This was asked because I had a discussion with a co-worker about it, not because I think its a useful optimization in any practical sense. It is largely academic.
As Jim Mischel has shown, the compiler will generate identical MSIL for the two ways of writing the for-loop. But that is it then: there is no reason to speculate about the JIT or perform speed-measurements. If the two lines of code generate identical MSIL, not only will they perform identically, they are effectively identical. No possible JIT would be able to distinguish between the loops, so the generated machine code must necessarily be identical, too.
1
JIT or speed-measurements if two lines of code generate identical MSIL
Text background colour cuts to shape and length of text
is it possible to make the background colour of a line of text fit to the edge of the text itself? Here is a visual example of what I'm trying to accomplish: The text is a <h3> inside a <div> and at present all I can achieve is a square block background.
Sure, set the display property of the h3 element to inline. You may also need to adjust the line-height property to match the font size. display:inline; font-size:20px; line-height:20px; jsFiddle example
0.888889
Set display property of h3 element to inline
How to combine 2 click function?
I have form that sends message me when enter Email and MessageText. I want to use both of jQuery Validation Engine plugin and ajax response to return result. For this I use same jQuery('#messageSendButton').click() function in every case. To return response from controller: <script type="text/javascript"> jQuery('#messageSendButton').click(function () { var url = '@Url.Action("SendQuickMessage", "Home")'; var email = $('#email').val(); var messageText = $('#messageText').val(); $.ajax({ url: url, type: 'GET', contentType: 'application/json', data: { Email: email, Message: messageText }, success: function (result) { if (result.success) { alert("Message sent! Thanks!"); } else { alert("Error occured!"); } }, complete: function () { $(".loading").hide(); } }); }); </script> And, to validate form: <script type="text/javascript"> jQuery(document).ready(function () { jQuery('#quickMessageForm').validationEngine('init'); jQuery('#messageSendButton').click(function () { jQuery('#quickMessageForm .loading').animate({ opacity: 1 }, 250); if (jQuery('#quickMessageForm').validationEngine('validate')) { jQuery.post('/Home/SendQuickMessage', { Email: jQuery('#email').val(), Message: jQuery('#message').val(), formname: 'messageForm', formtype: 'messageF' }, function () { jQuery('#quickMessageForm .loading').hide(); }); return false; } else { jQuery('#quickMessageForm .loading').animate({ opacity: 0 }, 250); return false; } }); }); </script> Separately, they both works alone, but together, firstly ajax function works, second validation works. it is not right.. How can I combine those in one? Firstly to validate form, then get ajax response. Edit: Here is form: <form action="#" method="post" id="quickMessageForm"> <div class="form_info cmsms_input"> <label>Email<span class="color_3"> *</span></label> @Html.TextBoxFor(model => model.Email, new { name = "email", id = "email", tabidex = 1, @class = "validate[required,custom[email]]" }) </div> <div class="form_info cmsms_textarea"> <label>Message<span class="color_3"> *</span></label> @Html.TextAreaFor(model => model.Message, new { id = "messageText", name = "messageText", tabindex = 2, @class = "validate[required,minSize[10]]" }) </div> <div class="loading"></div> <div> <input type="submit" name="messageSendButton" id="messageSendButton" value="Send" class="button_small" tabindex="3" /> </div> </form>
You can try like below. i.e. make your ajax call async:false $.ajax({ url: restmethod, type: "POST", contentType: "application/json", async:false success: function(data) { return data.d; } }); I hope this will help to you.
1
Make your ajax call async:false $.Ajax
iTunes reject app for date of birth
I am iOS developer. I made an application for chat which required registration for go into app. In registration screen, it require DATE OF BIRTH. Apple reject my app for more than 3 times because of DATE OF BIRTH field. I have told them that into our privacy policy we described that user's age must be more than 17 so, we need to add this field for date verification. But, still they are rejecting my app. Please help me.
Now, I am able to make app live on App store. I remove DATE OF BIRTH field and add AGE field where user just select age, not birthdate. And then, Apple make it live.
0.777778
Apple make app live on App Store
postgres: how to use subquery correctly?
I have the following query CREATE TABLE test_buffslip AS SELECT ST_INTERSECTS( (SELECT ST_Buffer(geom, 0.005) FROM segments where class = 7) ,geom) FROM segments; resulting in ERROR: more than one row returned by a subquery used as an expression I want to use the buffer created on the subquery to select features from the main table. Probably there are better ways to do this anyway. I am open to suggestions ;-)
Since you haven't shown the data, table defs, explained the problem, etc, I can't really show a specific query. The general idea is to use the subquery in FROM with an alias, like: CREATE TABLE test_buffslip AS SELECT ST_INTERSECTS(...) FROM ( SELECT ST_Buffer(geom, 0.005) FROM segments where class = 7 ) seg_buffers;
0.777778
SELECT ST_INTERSECTS FROM
Is there a single word that means "self flagellation" or "self punishment"?
In the back of my mind, I'm almost certain there are at least several individual English word that means to punish one's self. It doesn't have to be physical, necessarily, but it must be some kind of self-punishment. Are there such words? Clinical words are also accepted (i.e. psychological terminology).
Masochism is the first that comes to mind, but I seem to remember the word misogynist him being used as an alternate definition but I can't find verification for it on any of the online dictionaries.I realize that misogynist is most recognized definition is the hatred of women but I seem to recall it being used in the context that you're referring to. Hope this helps.
1
Misogynist is most recognized definition is the hatred of women
How to render a curve without creating meshes?
I am able to render a curve by bevelling it. However, for a scientific visualisation that I am working on, this doesn't render the way I wish it to. I would like the curve to render as a fixed width line irrespective of the distance from the camera. Currently, I have to adjust the bevelling amount based on camera distance, and also play with rendering samples to get a smooth looking line. Is there a cleaner approach that I am missing? I am currently using the "cycles" renderer, but I am open to suggestions for any other renderer. Thanks! Clarification: This is an animated visualisation. Hence, the distance from camera varies continuously. Here's an example video of what I am trying to do. The comet orbit is the curve I am worried about.
As the distance from camera to an object increases the apparent size of the object will decrease, in perspective things farther away always appear smaller. The only way to prevent that is to use an orthographic camera or keep all lines the same distance from the camera. As for increasing samples to get a clean result - that is the nature of cycles. It depends largely on the material and world settings. If you are using simple colours then the blender internal will be just as easy to setup without having to adjust sample amounts. You can also adjust the resolution of both the bevel and curve to get smoother surface results instead of converting to mesh if the surface of the curve is not smooth enough.
0.888889
Using an orthographic camera to increase the size of an object
C++ queue with multiple values
I am looking for a queue with multiple values but the default std::queue supports only two values like queue<int, int> myqueue; I have eight elements and want the same functionality of queue (PUSH, POP, etc.) like this queue<int, int, int, int, int, int, int, int> myqueue;
You're not using the queue correctly. By specifying queue<int>, you can use push and pop to insert as many elements as you want, see also: http://en.cppreference.com/w/cpp/container/queue If you want a container which can hold exactly 8 elements, you might want to use a boost::circular_buffer with a fixed size: http://www.boost.org/doc/libs/1_52_0/libs/circular_buffer/doc/circular_buffer.html If you want to push 8 elements at once, just use a std::vector as the queue item, or a 8-tuple tuple<int, int, int, int, int, int, int, int> or a struct with an array member: struct EightInt { int data [8]; }.
0.888889
Push and pop to insert as many elements as you want
Difficulties with re-using a variable
here is a part of my code : class projet(object): def nameCouche(self): valLissage = float(ui.valLissage.displayText()) return (valLissage) valCouche = nameCouche() # asks for a positional argument but 'self' doesnt work def choixTraitement(self): ui.okLissage.clicked.connect(p.goLissage) def goLissage(self, valCouche): if ui.chkboxLissage.isChecked(): print(valCouche) # result is False os.system(r'"C:\Program Files\FME\fme.exe" D:\Stelios\..... --MAX_NUM_POINTS {0}'.format(valCouche)) So I would like to use valCouche in goLissage method but it doesnt work. I thought that valCouche would have the argument of valLissage but instead it gives False as a value. I've tried different alternatives but still doesnt work.
you have to define an initialization function: def__init__(self) defining valCouche as an instance attribute make it accessible on all the method so we have the following class projet(object): def __init__(self): self.valCouche = '' def nameCouche(self): self.valCouche = float(ui.valLissage.displayText()) @staticmethod #here there is no need for self so it is a method of class def choixTraitement(): ui.okLissage.clicked.connect(p.goLissage) def goLissage(self): if ui.chkboxLissage.isChecked(): print(self.valCouche) # result is False os.system(r'"C:\Program Files\FME\fme.exe" D:\Stelios\..... --MAX_NUM_POINTS {0}'.format(self.valCouche))
0.666667
def__init__self defining valCouche as an instance attribute
D.C power supplies, regulated linear power supply question
Design giving the necessary ratings and characteristics the necessary for the transformer, bridge rectifier capacitor and regulator , a 12v , 2A regulated power supply . the available mains supply is 230v+10% @50hz so far I have : Regulator - Standard voltage regulator will require 2v to be maintained across it to prevent drop out , therefore input voltage should not drop below 14v Transformer - Va atleast 50% & volt drop = 24v Capacitor - the minimum peak voltage to the regulator input (24-10%) x 1.414 - 2 = 28.8v maximum peak voltage (24+10%+10%)x1.414-1.4 = 38.9v The minimum peak full hand voltage defines the minimum of ripple voltage (28.8-14) = 14.8 suitable reservoir capacitor ? I am uncertain if these figures are even correct , I think I am close but could do with some guidance thank you
As the comments to your question say, you need to find out a suitable capacitor value. You can then see what the valley voltage of your ripple is, add in the voltage drop caused by the rectifier diodes, then arrive at the MINIMUM transformer secondary voltage. You will then select the next highest available transformer secondary voltage, re-do all of the calculations, and finally find out how much heat that you need to get rid of. Note that you need to design for the minimum available AC Mains voltage available when choosing the minimum secondary voltage. You need to design for the MAXIMUM AC Mains voltage when calculating how much heat will be generated. Engineering is all about trade-offs. If the available transformer secondary voltage is higher than you like, you can choose a smaller reservoir capacitor such that the worst-case ripple valley voltage is still above the regulator drop-out voltage. This extra ripple translates into less heat wasted in the regulator. Do note that you must NOT allow the ripple valley voltage to drop below the regulator drop-out voltage or the resulting regulated DC supply will have AC Mains ripple present in the output. That can cause all manner of problems, especially in audio circuits. Finally, pay attention to the ripple current rating of the reservoir capacitor when choosing a suitable part. Note that the peak ripple current is substantially higher than the DC current output of the supply - the capacitor has to charge in only a small portion of the incoming AC sine-wave waveform.
0.888889
How much heat will be generated in a reservoir capacitor?
InstallHandler runs under a special ghost user. What rights does it have?
When you install a managed package with a post-install script, Salesforce creates a special ghost user under which all of the post install activities occur. I think this is undocumented. Here are some details. This can be great from an audit point of view (you can see which package has 'touched' all the data). But can problematic in several examples: Certain objects are inaccessible by SOQL (I've found CronTrigger and ApexClass so far) Scheduled Jobs (and any code they call) will forever run under the post-install context, Batch Jobs execute as the post-install user and suffer the same issues above, I've tried querying the user by id in SOQL to no avail, and the debug log monitor don't record anything. How crippled is this special ghost user? Does he have a documented profile? Edit: I've emailed myself some post install context UserInfo return values. Interesting ones in bold: UserType: LicenseManager (Aha! Who knows what privileges he has!?) ProfileId: 00eF0000000XXXXAAA (viewing URL gives Insufficient Privileges!) UserName: 033g0000000XXXXAAA@00df0000000XXXXAAA (package-id@org-id) UserId: 005F0000003XXXXAAA (viewing URL gives Insufficient Privileges!) Email: [email protected] DefaultCurrency: USD FirstName: null Language: en_US LastName: [managed package name] Locale: en_US Name: [managed package name] OrganizationId: [installing org id] OrganizationName: [installing company name] SessionId: null TimeZone: America/Los_Angeles UiTheme: Theme3 UiThemeDisplayed: Theme3 UserRoleId: null
After trial and error investigation, it appears the InstallHandler can run with unlimited privileges given one special condition; the InstallHandler implementor must have without sharing annotation. Running without sharing allows the install user context to: view all data modify all data interrogate system data (like CronTrigger and ApexClass) The install user context cascades into any Batch Apex and Scheduled Apex jobs that are invoked as part of the post install script. If those classes are also annotated without sharing, it offers the capability of long-running "super user" processes.
0.666667
InstallHandler running without sharing annotation
Powershell script to find permissions for a specific user
what am i doing wrong user.ps1 $user = "sp2010\systemsacct" $site = $gc | Get-SPSite sp2010 $site | Get-SPWeb -Limit All | Get-SPUserEffectivePermissions $user Out-GridView -Title "Web Permissions for $user"
This script gives you a table of user only permission, and permission via group membership. $urlWeb = "http://sp2010" Get-SPUser -Web $urlWeb | select UserLogin, @{name=”Exlicit given roles”;expression={$_.Roles}}, @{name=”Roles given via groups”;expression={$_.Groups | %{$_.Roles}}},Groups | format-Table -auto Reference: How to get user permissions report by using Powershell
0.666667
How to get user permissions report by using Powershell
what does to oneself mean in some sentence?
I just found a part sentence saying "Attractive and affectionate to oneself"? Does that mean your attractive to yourself?
It probably means that you are narcissistic or conceited narcissistic (adj) - Characteristic of those having an inflated idea of their own importance. conceited (adj) - Characteristic of false pride; having an exaggerated sense of self-importance If you found this in some horoscope, as it happens most of the times, that's fine. It shows the character of the people with that zodiac sign in general. Don't take too much pain. It should not be a heartfelt comment.
0.888889
conceited narcissistic - Characteristic of false pride .
Separating out Red component image from an RGB image in opencv 2.3
I want to get Red,Blue and Green component image from an RGB image in opencv 2.3.I am using vc++ 2010. Can anybody tell how to do this?
use the split() function. For the reverse operation, use merge();
0.888889
merge()
Artifacts in render, but not in preview?
I have spent hours figuring out how to do this piece of my object. Starting over with a new mesh a number of times. I punched the holes manually, after learning the evil that is boolean modifiers. But I just can't seem to shake my bad luck with this piece! Many artifacts show in render, but in render preview it looks nearly flawless. I don't have the option to leave out smoothing..it looks too poly without it. I have no idea how to fix this. Here is the rendered version: 1 Also notice how the metallic piece to the right (up against the glass) renders just fine, despite the fact that it is made with the same material. Here is how it looks in render preview: The mesh in edit mode: Here is a link to my blender file for you to go nuts with: https://www.dropbox.com/s/9lh6z9hyeqwneqn/sonicpublic.blend?dl=0
You have a duplicate of the cylinder with holes object called Circle.002 which is hidden in the viewport, but not in the render. If you enable it in the viewport, the effect becomes obvious: Also I'm pretty sure you don't need so much subsurf. Usually I don't use more than two subdivisions, sometimes three. With all objects set to one level of subsurf, your scene renders in about 2:48 for me. With the original subsurf settings, it renders in 3:50. The visual difference seems pretty negligible, but there is change some of the lighting/camera angle in between tests because I stupidly did the 1 subd test first, then had to reload the scene to get the original subserf levels.. There are also quite a few ngons (faces made up of more than 4 vertices). These usually don't play well with subsurf, and cause some distortion. Here is an example screenshot of some ngons (subsurf is disabled in the screenshot): I also noticed that you are getting a lot of noise from the environment texture. Enabling Multiple importance sampling in the world settings should help reduce that:
0.666667
Enabling Multiple importance sampling in the world settings
JavaScript Equivalent Of PHP __invoke
I'm developing a small framework (in JS) and for esthetic reasons and simplicity I was wondering if there could be a way to implement something like PHP "__invoke". For example: var myClass = function(config) { this.config = config; this.method = function(){}; this.execute = function() { return this.method.apply(this, arguments); } } var execCustom = new myClass({ wait: 100 }); execCustom.method = function() { console.log("called method with "+arguments.length+" argument(s):"); for(var a in arguments) console.log(arguments[a]); return true; }; execCustom.execute("someval","other"); Desired way to execute: execCustom("someval","other"); Any ideas? Thanks.
Just return a function that will form the public interface: function myClass(config) { var pubif = function() { return pubif.method.apply(pubif, arguments); }; pubif.config = config; pubif.method = function() { }; return pubif; } The rest of the code remains the same.
0.888889
Return a function that will form the public interface
If $f: \mathbb Q\to \mathbb Q$ is a homomorphism, prove that $f(x)=0$ for all $x\in\mathbb Q$ or $f(x)=x$ for all $x$ in $\mathbb Q$.
If $f: \mathbb Q\to \mathbb Q$ is a homomorphism, prove that $f(x)=0$ for all $x\in\mathbb Q$ or $f(x)=x$ for all $x$ in $\mathbb Q$. I'm wondering if you can help me with this one?
If $f$ is a homomorphism of rings, we know the kernel of $f$ has to be an ideal of $\mathbb{Q}$, but as $\mathbb{Q}$ is a field, the only ideals of $\mathbb{Q}$ are $0$ and $\mathbb{Q}$ itself.
0.888889
if $f$ is a homomorphism of rings, the only ideals of $mathbbQ
Making a C++ app scriptable
I have several functions in my program that look like this: void foo(int x, int y) Now I want my program to take a string that looks like: foo(3, 5) And execute the corresponding function. What's the most straightforward way to implement this? When I say straightforward, I mean reasonably extensible and elegant, but it shouldn't take too long to code up. Edit: While using a real scripting language would of course solve my problem, I'd still like to know if there is a quick way to implement this in pure C++.
If you only wish to call a function by literal name, you could use linker-specific functions. On POSIX-compliant operating systems (like Linux), you can use dlopen() and dlsym(). You simply parse the input string and figure out the function name and arguments. Then you can ask the linker to find the function by name using dlsym(). On Windows however, these functions aren't available (unless there's some POSIX environment around, like Cygwin). But you can use the Windows API. You can take a look here for details on these things: http://en.wikipedia.org/wiki/Dynamic_loading
0.666667
How to call a function by literal name?
Why do read links turn purple?
Today I saw a post on Facebook that had this pun: Clicked links turn purple because blue + "read" equals purple Is there any specific reason why a link is blue and when it is clicked/read, it turns to purple? Do these colors have any meaning?
Browsers render textlinks blue by default. Jeffrey Zeldman wrote an article stating Sir Tim Berners-Lee, inventor of the world wide web, reached it at random: http://alistapart.com/blog/post/why-are-links-blue I can't find any information on why visited links are purple. It does however seems logical to me to choose a color close to the link color, preferably one colorblind people can distinct too.
1
Why are textlinks blue by default
Netbook screen display is garbled (has black/white & horizontal line patterns, screen freezes, and/or wrong display position)
Upon powering my netbook on, its screen turns into a garbled display (has black/white patterns, horizontal line patterns, screen freezes and/or wrong display position). This distortion happens even at BIOS startup, continuing to Windows startup. Occasionally, the issue starts around 3 minutes after the Windows desktop appears. Pictures of the monitor (click on image to enlarge): More pictures at: http://imgur.com/a/ArME1 Details: This happens even in safe mode (the last picture above is of the netbook screen in safe mode). I connected the netbook to an external monitor (through VGA) and the display in the external monitor shows up just fine. I have been able to use the netbook without any issues with an external monitor. Aside from the monitor, the netbook still works (I can shut it down with keyboard shortcuts) and the files that it has shared through LAN can be accessed fine. The torrent client's web interface on the netbook can also still be accessed on another computer. The issue sometimes happens even at BIOS startup. The variations of the distortion will sometimes change randomly. Occasionally, the non-distorted screen display will simply freeze. The netbook didn't fall in the ground or get hit by an object. The netbook is mostly used as a torrent seeder and downloader. Its lid is opened and closed around 2 times a day only, but the netbook is powered on almost 24/7 (its lid is closed most of the time). It is mostly accessed through another computer through LAN and is not often used directly. The netbook was bought around 2 years ago. What are the possible causes of this? Any possible fixes or methods of repair I can look into? The netbook is now out of warranty. Netbook details: Model: Samsung NP-N150 OS: Windows 7 Starter Graphics Chip: Intel GMA3150 Monitor: Screen Size 10.1", LED Backlit Other specs here: http://www.samsung.com/us/computer/laptops/NP-N150-JA01US-specs
Putting a live linux distribution on a USB stick would let you test hardware vs software easily. Seeing what happens if you sit at the BIOS screen like Bobby suggested isn't a bad idea; but a pure textmode display will put significantly less load on the GPU than GUI desktop will. Since the problem doesn't occur immediately on powerup, the only cause that seems likely to me is overheating. Have you verified that the fan still spins. Taking the bottom off and blowing out any accumulated dust should help here. CoreTemp will let you monitor the CPU temperature; if it's really high the odds are your GPU is also overheating since the GPU and CPU are integrated but I'm not aware of anything to read the GPU temperature directly.
1
Putting a live linux distribution on a USB stick
What are the reasons to mix oil & coolant?
Frontal impact vehicle is there fan motor touches the oil cooler,oil cooler slight impact is there, in coolant tank oil and coolant mixed, what are the reasons to mix the coolant and oil in this situation.
I take it from the wording, English is not your first language. To answer you outright, there is no reason to mix coolant and oil, under no situation where a vehicle is concerned. If you are actually asking why oil would be fed through something containing coolant (radiator or such), the reason would be simple in that it is cooling the oil. By cooling the oil, the oil will stay viable longer as well as it will not want to build up sludge as much. It will also be able to cool the engine better, which means the engine itself will last longer. Using an oil cooler works especially well for supercharged or turbo-charged engines. I take it via the accident, the oil cooler was damaged in some way and it is now allowing oil to flow freely into the coolant? If so, about the only thing you can do is replace the oil cooler. You could possibly pick up a used one from an auto recycler for a lot cheaper than you could purchase one new.
0.833333
Why should oil be fed through something containing coolant?
What does "You tell him!" mean?
  "You know how I think they choose people for the Gryffindor team?", said Malfoy a few minutes later, as Snape awarded Hufflepuff another penalty for no reason at all." It's people they feel sorry for. See, there's Potter, who's got no parents, then there's the Weasleys, who've got no money – you should be on the team, Longbottom, you've got no brains."   Neville went bright red but turned in his seat to face Malfoy.   "I'm worth twelve of you, Malfoy," he stammered.   Malfoy, Crabbe and Goyle howled with laughter, but Ron, still not daring to take his eyes from the game, said, "You tell him, Neville."   "Longbottom, if brains were gold you'd be poorer than Weasley, and that's saying something." What does Ron mean by the phrase "You tell him, Neville"?
It expresses two things: I strongly agree with you I (strongly) think you are right to tell him this In other words, it expresses both agreement and support. Agreeing with the sentiment, and supporting the speaker in expressing that sentiment.
1
It expresses both agreement and support
PHP Fatal error: Call to undefined function plugin_basename
I'm receiving this error: [27-Jun-2012 18:22:39 UTC] PHP Fatal error: Call to undefined function plugin_basename() in /XXXX/public_html/wp-content/plugins/price-update/price-update.php on line 68: //We set the plugin basename here, could manually set it, but this is for demonstration purposes $this->plugin_basename = plugin_basename(__FILE__); in this block of code: class PriceUpdate extends mtekk_admin { protected $version = '0.0.1'; protected $full_name = 'Price Update'; protected $short_name = 'Price Update'; protected $access_level = 'manage_options'; protected $identifier = 'pr_upate'; protected $unique_prefix = 'prud'; protected $plugin_basename = 'price-update/price-update.php'; protected $opt = array(); /** * __construct() * * Class default constructor */ function __construct() { //We set the plugin basename here, could manually set it, but this is for demonstration purposes $this->plugin_basename = plugin_basename(__FILE__); register_deactivation_hook(__FILE__, array($this, 'deactivate')); add_action($this->unique_prefix . '_cron_hook', array($this,'cron_handle')); //Register some of our custom taxonomies add_action('init', array($this, 'wp_init'), 0); add_action('wp_footer', array($this, 'footer')); //We're going to make sure we load the parent's constructor parent::__construct(); } However, its defined above: protected $plugin_basename = 'price-update/price-update.php'; any ideas?
Perhaps you'd be better off using plugin_dir_path(__FILE__);? Example: <?php define( 'MYPLUGINNAME_PATH', plugin_dir_path(__FILE__) ); require MYPLUGINNAME_PATH . 'includes/class-metabox.php'; require MYPLUGINNAME_PATH . 'includes/class-widget.php'; ?> [EDIT - 06/29/2012] I believe you have your PHP OOP logic incorrect, but I could be wrong. You're defining a property in a child class which extends a parent class. You then call the parent constructor inside the child constructor. The code you provided shows that you assign the child class property $plugin_basename, but then you don't do anything with it after that. I'm assuming you're trying to set a property $plugin_basename for the parent class to handle. However, if that's the case, then you need to either define the property within the parent class, OR you need to call the parent method which makes use the property $plugin_basename. If that's NOT the case, then you need to be sure you make use of the property $plugin_basename, within the child class, AFTER it's been assigned like so: $this->child_class_method_name($this->plugin_basename); You could access the parent class method which handles the property $plugin_basename, and pass the property assigned by the child class to the parent class method like so: $this->parent_class_method_name($this->plugin_basename); I'm not really too certain how you have your plugin setup, given the minimal amount of code you provided. If you could provide more of an idea of what you do with the property $plugin_basename, after it's been assigned, I could possibly be of more assistance.
0.777778
How do you configure a property in a child class?
How often will my Comcast IP address change?
I had a Linux/Apache server in my house, a domain name hosted by 1and1 which points to my Comcast public IP (testing only, I know I am not allowed to host a site), and a D-Link router which forwards port 80 to the Linux server. Everything was working perfect. I then bought a new Linksys router, and things stopped working. Upon troubleshooting, I found that my home IP no longer matched the IP set in 1and1. Furthermore, the IP set in 1and1 is located hundreds of miles away. Is this normal? How often will the IP change? Is there anything I can do to prevent?
If you don't purchase a static IP from your ISP, your ISP has no obligation to keep permanent the one it leases to you via DHCP. So you should always treat your IP changing as a possibility regardless of what you or others have observed. Your IP changing is normal if you do not have a static IP from your ISP. There are "dynamic DNS" services - Dyn (formerly Dyndns) and No-IP being two of them - that will let you create an account, obtain a DNS hostname, and then run an "update client" somewhere on your internal network. The update client will periodically check your external IP and report changes to the service. So then this DNS will resolve to your public IP. Dyn used to be free, No-IP still is AFAIK (this may have changed). You'll still need to make sure NAT is set up correctly if you want external requests to reach a specific system inside your network. You also cannot use this DNS to reach hosts from inside to inside your network unless you run your own DNS server and resolve LAN-local names yourself.
0.777778
You should always treat your IP changing as a possibility regardless of what you or others have observed .
How can I speed up the rate at which putty dries?
We're (slowly) renovating the sash windows in our house and the current window is causing problems. What should have been a quick job (especially at this time of year!) has turned into a marathon because the putty won't dry. We had to replace a couple of panes of glass (one was cracked and we broke another when using a heat gun to remove the paint) so we knew it would take a little while. On a previous window the putty took over three weeks to dry enough to paint partly because (as we thought) there was too much oil. So this time we rolled the putty on newspaper first to try to remove the excess oil. It seemed to work, but after two weeks the putty is still soft to the touch. We've tried standing the windows next to a radiator but all that seemed to do was make it softer (which was obviously going to happen in hindsight). So given that we don't want to reputty the windows what can we do to speed up the drying process. We've had to seal off the room and cover the window as best we can in the meantime. I've found this advice on DoItYourself.com which doesn't really help as it says use other materials! The answers to this post on DIY-Forums are confusing at best and possibly contradictory as one recommends exposing the putty to moisture(!) to speed the drying process.
Wipe down the putty with mineral spirits, this should remove some of the oils and help it cure faster.
0.888889
Wipe down the putty with mineral spirits
When can an article be omitted?
I am aware that articles are the modifiers, which introduce a noun/noun_phrase in a sentence, and by the rules of English grammar we should use an article before referring to a noun in a sentence. However, I see that the above rule is not strictly followed. I have seen sentences where though a noun/noun_phrase is used in a sentence but an introductory article is not used. Eg : Login to desktop and start the paint application [ Desktop is a noun, hence I expect either "Login to a desktop and ...." or "Login to the desktop at the corner and ....."] So please help me understand, when can an article be omitted ? Thanks in advance.
There are various special cases, but in general: You need an article in English whenever you have a singular noun that is not a proper name. You do not use an article with a proper name. Articles are optional with plurals -- not in the sense that you can include them or not on a whim, but that they change the meaning. You should also not use an article when you use a possessive, like "my", or the adjective "one". (I'm sure I've seen other adjectives that take the place of an article, but I can't think of any right now.) Maybe that's not entirely clear, so here are some examples: "You can start the application." "Application" is singular, so an article is required. "You can start applications." "Applications" is plural, so you don't need an article. "You can start Microsoft Word." "Microsoft Word" is a proper noun, the name of one particular application, so no article is used. "You can start one application." "One" takes the place of an article. "You can start his application." "His" is a possessive that makes an article unneeded. If you use "the" before a plural, it indicates that you are talking about some particular set. Like if you said, "You can start applications", that would mean any applications, but if you said, "You can start the applications", that would indicate that you are talking about some specific set of applications, not any applications in the world. In your example, I would have written "You can log in to THE desktop". "Desktop" is not a proper noun and so requires an article. Or perhaps in this case the writer is referring to some specific product called "Desktop" and so he is thinking of it as a proper noun. If that's the case, it should be capitalized.
1
Articles are optional with plurals, so you don't need an article
Can you disavow a whole domain apart from the index page?
Many years ago I may have bought a few sitewide links for some of my sites, these have now come back to haunt me and I need to sort them out. I've tried to contact the owners but they're too lazy to bother changing the sites so I figure it's time to disavow the links. But is there a way to disavow all of the sitewide links on the domain apart from on the index page and would this be a benefit to leave the index or would it still be seen as spammy? Something like ... # Contacted owner of shadyseo.com on 7/1/2012 to # ask for link removal but got no response domain:shadyseo.com !shadyseo.com/index.php
There is no way to disavow a portion of a site. Here is the documentation for the disavow file format. It only supports three types of lines: Comments that start with a # Single URLs (each on a line by itself) Domain rules such as domain:shadyseo.com The disavow file does NOT support more complex matches such as: Folder matches Wildcard matches Regular expression matches. The only way to disavow all the links on a site other than on the homepage would be to make a complete list of all the pages with links on the site but then not include the home page.
1
Disavow file does NOT support more complex matches such as: Folder matches Wildcard matches Regular expression matches
cowsay not working?
I have Debian Squeeze installed on my Raspberry Pi and I'm trying to learn some basic Linux commands. I stumbled upon an article titled Funny things to do in the terminal and proceeded to install cowsay using. $ sudo apt-get install cowsay I get an error when trying to use it. bash: cowsay: command not found I then proceeded to install it again, but it let me know I have the latest version installed. I'm still new to Linux so I'm not sure if I'm going about this the right way. sudo / -name cowsay returns: /usr/games/cowsay /usr/share/doc/cowsay /usr/share/cowsay UPDATE The new Debian Squeeze aka Raspbian "Wheezy" aka the recommended distro as of 7/17/2012 doesn't have this problem anymore.
Running sudo find / -name cowsay verified that cowsay is installed. Since prefacing the cowsay command with /usr/games worked, the problem is that the /usr/games directory is not in your path. To fix this add the following PATH=$PATH:/usr/games export PATH to the .bash_profile file in your home directory. How to do it: Change to your home directory. $ cd ~ Then type the following command to edit your bash profile. $ sudo nano .bash_profile Append the following lines to the end of the file. PATH=$PATH:/data/myscripts export PATH` Save your changes and exit; then logout or reboot. Once you have done this you should be able to enter. $ cowsay “$USER is my friend”
1
Running sudo find / -name cowsay verified that cowsay is installed
Water Supply pressure
What size supply pipe must be used from a 5000 litre water tank to supply 4 bars of pressure to a house that is 20m below and 300m away from the tank?
It's a trick question, you can never get 4 bar of pressure with only a 20 m head. The pressure due to a vertical column of liquid is equal to the density x height of the column x the acceleration due to gravity (little g = 9.8 m/s2). Your height is 20m Density of water is 1000 kg/m3 g = 9.8 So, pressure is 196,000 Pascals 100,000 Pascal per bar, so you have 1.96 bar as the max pressure you could get, independent of flow rate or pipe size.
1
The pressure due to a vertical column of liquid is equal to the density x height of the column x acceleration due to gravity
Registration: Username and password or email and password
During a registration process what would the reasons be for using: username/password or email/password combinations to register the user? Is it a case of identification once in the system (may be preferable to refer to a user by their username instead of their email) Simplicity - using email means the user dont have to create two memorable items? What other reasons are there for choosing either option? Is there a relationship between the type of service?
For me personally it's about giving my complete details before I'm even a member. I'd rather just sign up with email/pw and then later figure out how I will fill out my profile, as me or a more obscurely titled me. Example: for Facebook I use my full name but on here I've abbreviated my last name. I think opting for email/pw will give you a higher influx of sign-ups because it requires less thinking. 90% of all apps/startups/sites I apply for are email/pw sign-ups, or social (fb/twitter) sign-ups. But that's just personal and not backed up by any study or anything...
0.777778
opting for email/pw will give you a higher influx of sign-ups .
Hostname resolution in a machine with multiple running eth ports
Consider a machine having 4 eth ports running on it. Then to which eth port's ipaddress will the hostname resolve to? Kindly guide me to some documentation to support your answers so that I could use them as proof in my project. Thanks
externally to whatever IN A entry you defined for the host name in its dns zone. locally to whatever you want the hostname to resolve to. to see how the resolver works, check out /etc/host.conf. a default ubuntu host.conf is: order hosts,bind multi on first line is the old style of saying "check /etc/hosts then query dns", second is the new style of saying the same thing. suppose you have eth0:10.0.0.1, eth1:10.0.0.2, eth2:10.0.0.3, eth4:10.0.0.4 and a hostname of "phony" defined in /etc/hostname (talking ubuntu, other distros may use different config schemes here altho i doubt it) you can have the following /etc/hosts entries: 10.0.0.1 phony then phony will resolve to 10.0.0.1 for local services if you have something like this in /etc/hosts: 127.0.0.1 phony phony will resolve to 127.0.0.1 if you have no declaration of phony in /etc/hosts then resolver will query the dns caches defined in /etc/resolv.conf, using the "domain" and "search" setups to build a dns compliant record (host) name. so if you want to control to what the hostname resolves to for your local services, define it in /etc/hosts. quick note: the hostname is normally just a dns label (that is, no "."). the domain name for your machine is normally defined in /etc/domainname
0.777778
Local to whatever you want the hostname to resolve to
How can I tell if a downloaded ISO is complete?
I just ran into a nasty problem with an ISO download from Microsoft. I successfully burnt it to a rewritable DVD, and copied the contents to the local hard drive on another machine, but when I went to run them they were corrupt. It turns out the download had been truncated. Now, OK, sometimes that happens - but it surprised me that the truncated file (which was only slightly more than 60% of the actual ISO) burnt successfully and seemed to be presenting me with a sensible file system, to the extent that I could (apparently) successfully copy the files. So, is there some way I could have tested the file to see if it was complete or not? The MS web site did not provide any information about the expected size, so I'm looking for a generic solution: given an ISO file which may or may not be truncated, is there some way to tell? Do commonly used CD/DVD (data) formats include any embedded information about how much data is supposed to be on the disk, or even better, some kind of CRC? A solution that detects most truncated images will be accepted, it doesn't need to be perfect. (I'd prefer something that doesn't give false positives, though.) [Addendum: a comparison of the disk burnt with the truncated image with the files extracted from the full image suggests that chunks of the data from many of the files were replaced with random information, perhaps from the contents of a previous burn to the same rewritable disk.]
The ISO from the download center is the same one you can get from MSDN. The MD5 is 61c2088850185ede8e18001d1ef3e6d12daa5692 vs2010sp1dvd1.iso I hope that helps. If you don't have a MD5, you can download one here. http://corz.org/windows/software/checksum/simple-checksum.php
1
The ISO from the download center is the same one you can get from MSDN
Factory panic alarm going off after changing battery [97 Toyota Camry]
We just changed the battery in our 1997 Toyota Camry now as soon as we connect the battery the panic alarm goes off and all the doors lock. How do we stop this / turn it off. ///note: the battery in our remote is dead///
If the alarm is a "factory" alarm, cycle the key in the ignition from off to on (where the dash indicators light up), 5 times. This is the reset procedure for the "factory" alarm. Otherwise look in the owners manual where there is a red button under the steering wheel, possibly behind a panel. These process is performed when doing maintenance. Either way, you want to make sure to re-engage it when you get it working or you will not have the alarm.
1
If the alarm is a "factory" alarm, cycle the key in the ignition 5 times
How to save viewstate in php (magento)
I'm Validating Address in Customer Register Page, it's working fine Error also displaying in same page. After displaying error message the form is lose viewstate (entered user data). my code is: public function createPostAction(){ $valid = $this->_validation(); $arguments = $this->getRequest()->getPost(); if( $valid === true){ parent::createPostAction(); }else{ $this->_redirect('*/*/create',$arguments); } } protected function _validation() { $errors = array(); $continue = Mage::helper('addressapi/data')->Address($this->getRequest()->getPost(), 'customer'); if (!$continue) { $errors[] = Mage::getSingleton('core/session')->addError('Please Enter the Correct Address details.'); } if (empty($errors)) { return true; } return $errors; } How can I bind viewstate data after form postback. Thanks in advance.
You can save the values send through post in the session. Something like this: public function createPostAction(){ $valid = $this->_validation(); $arguments = $this->getRequest()->getPost(); if( $valid === true){ parent::createPostAction(); }else{ Mage::getSingleton('core/session')->setAddressapiPostData($arguments); $this->_redirect('*/*/create',$arguments); } } Then in the template that renders the form check if there is any data in the session. $sessionValues = Mage::getSingleton('core/session')->getAddressapiPostData(true); The true parameter will make Magento retrieve the values and remove them from the session so you won't see the same values the next time you view the form. If there are any values in the var $sessionValues add them to the form. Each field for each input.
0.777778
var $sessionValues
RDP File transfer is really slow. Any way to speed it up?
The host is running Windows XP Prof SP3 and the client is running Windows 7 Ultimate SP1 x64. So ... I connect to the remote machine with a 15mbps of ADSL. Which ... I guess, got enough downstream. (~1.3 MB/s). The host machine got a 35mbps of upload. Which is again, fast enough to pump the data with max speed. All I get is like ~320-400 kbps transfer speed. That is really slow. Is there a way to speed it up?
I just had the same trouble with RDP transfer. Also, I had trouble setting up a windows share to transfer between windows machines. So, I used the simple and well understood sftp protocol by using a free ssh/sftp server http://www.bitvise.com/ssh-server-download and an sftp/ssh client http://www.bitvise.com/ssh-client-download. I transfered 300MB(megabytes) in 2 minutes.
1
sftp transfer between windows machines
Why do I have to update to the most recent iOS version?
I have an iPhone 4s that is still running iOS 5.1.1. Why is it not possible for me to update my device to a newer version of ios without going all the way to the latest?
Apple has decided to remove previous versions when a new (replacement) is released. You could scan the web and find other versions from someone else but not from Apple.
1
Apple has removed previous versions when a new (replacement) is released
What does one do when one needs to bentch gomel?
One who has recovered from a serious illness or accident is supposed to bentch gomel during the torah service. What do you need to know to do this? Specifically: When is the right time -- the first torah service that you're able to physically attend, or is there some stricter standard? What do you do that day in shul? Is the answer different for a woman or a minor? (Are they obligated to gomel? If not obligated, permitted?)
One should attend synagogue as soon as one can (preferably within 3 days). One should try to get an Aliya to the Torah. (This is considered a chiuv). http://www.chabad.org/library/article_cdo/aid/115308/jewish/The-Laws-of-the-Blessing-of-Thanksgiving.htm
0.777778
Getting an Aliya to the Torah
Convert the_geom to text and then transform
I have this query that returns the_geom as text. However how could I also apply a transform to the same query. I can do this separately with the second example. Though I would like to do this to all the rows in my table, and in that example I copied the st_astext output into the transform query. select sitename, st_astext(the_geom) from sites_tbl; sitename | st_astext Belfast A | POINT(145592 530021) ST_AsText(ST_Transform(ST_SetSRID('POINT(145592 530021)'::geometry,27700), 4326));
You can use ST_Transform in your first query too. select sitename, st_astext( ST_Transform( the_geom, 4326 ) ) from sites_tbl;
0.888889
ST_Transform in your first query