qid int64 1 74.7M | question stringlengths 0 70k | date stringlengths 10 10 | metadata list | response stringlengths 0 115k |
|---|---|---|---|---|
44,179,585 | I have installed LAMP in CentOS 7
When I placed my files in the default directory (var/www/html in my case)
I receive the following when I access my page:
>
> Erreur : PB de connexion au serveur mysql de la langue : fr
> Erreur : PB de connexion � la base de donn�es de la langue : fr
> Erreur SQL : SELECT \* FROM... | 2017/05/25 | [
"https://Stackoverflow.com/questions/44179585",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8064758/"
] | It seems using a simple `import 'angular-ui-router'` works. |
2,540,530 | I'd like to be able to determine which store the user connects to from inside my app, so that I can direct them to some appropriate content for their device AND store. Does anyone know how to get this information?
Basically, if the user is in the UK, and connects to the UK store, I want my function/method to return GB... | 2010/03/29 | [
"https://Stackoverflow.com/questions/2540530",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/186184/"
] | The approach of getting the country code of the user's locale will work ... but only if the user's iTunes store is the same as their locale. This won't always be the case.
If you create an in-app purchase item, you can use Apple's StoreKit APIs to find out the user's actual iTunes country even if it's different from ... |
36,312,509 | I wanted to first say this is a really nice plugin (<https://github.com/katzer/cordova-plugin-local-notifications>) but having some difficulties getting it working.
I am using an Android and Phonegap CLI. I have tried both CLI 5.0 and now Phonegap 3.5.0, this is my config.xml:
`<preference name="phonegap-version" val... | 2016/03/30 | [
"https://Stackoverflow.com/questions/36312509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/596952/"
] | I too have spent many hours trying to get this plugin working & I have, but i do find it to be one of the most temperamental.
Within your js -
```
var testNotifications = function () {
document.addEventListener("deviceready", function () {
console.warn("testNotifications Started");
// Checks for permission
... |
6,319 | Ever since upgrading to Google Maps 5.1.0 on my Droid X, I have often had Google Maps bog down and freeze to the point of completely crashing the phone. Anyone else seeing this crash? Anyone find a solution? | 2011/02/23 | [
"https://android.stackexchange.com/questions/6319",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/3078/"
] | You can usually uninstall updates from the app's page in the market. However, previous updates to Google Maps had similar problems for users that never turned their phones off. Try just restarting your phone. |
11,385,214 | By default Gson uses fields as a basis for it's serialization. Is there a way to get it to use accessors instead? | 2012/07/08 | [
"https://Stackoverflow.com/questions/11385214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1089998/"
] | The developers of Gson [say](https://groups.google.com/forum/#!topic/google-gson/4G6Lv9PghUY) that they never felt swayed by the requests to add this feature and they were worried about murkying up the api to add support for this.
One way of adding this functionality is by using a TypeAdapter (I apologize for the gna... |
21,006,390 | I need to consume the services of a number of third party systems on my applications homepage. The data pertaining to these downstream systems are updated at different intervals and ideally my system will surface the latest data. It's not a scalable solution for my system to generate requests to each of these downstrea... | 2014/01/08 | [
"https://Stackoverflow.com/questions/21006390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24481/"
] | Have the method accept an expression, just as the method you're passing it to does:
```
public class Foo
{
public void UpdateEmployeeOrders(IEnumerable<Employee> employees,
Expression<Func<Employee, object>> selector)
{
foreach (var employee in employees)
{
UpdateSpecificEm... |
60,362 | I'm coming from an understanding of the continuous-time Fourier Transform, and the effects of doing a DFT and the inverse DFT are mysterious to me.
I have created a noiseless signal as:
```
import numpy as np
def f(x):
return x*(x-0.8)*(x+1)
X = np.linspace(-1,1,50)
y = f(X)
```
Now, if I were to perform a *c... | 2019/08/26 | [
"https://dsp.stackexchange.com/questions/60362",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/33763/"
] | Let me summarize my understanding of what you're trying to do. You have a real-valued sequence $x[n]$, obtained by sampling a real-valued continuous function, and you computed its DFT $X[k]$. The sequence can be expressed in terms of its DFT coefficients:
$$x[n]=\frac{1}{N}\sum\_{k=0}^{N-1}X[k]e^{j2\pi nk/N},\qquad n\... |
7,060 | recently I bought 3 solar panels rated at 5V 200 mA each. I want to use them to charge a 5V battery bank to charge a phone. Thinking about the proper way to put them, I thought i can connect all in parallel to get maximum current, but realized that if the sun light was a little weak it will no generate full 5v thus pre... | 2016/01/23 | [
"https://engineering.stackexchange.com/questions/7060",
"https://engineering.stackexchange.com",
"https://engineering.stackexchange.com/users/1736/"
] | Putting a single panel in series with two other panels that are in parallel does not accomplish what you think it does. The overall current of such a setup is limited by the single panel to 200 mA, so the three panels will not produce any more power than you'd get by just putting two panels in series.
A single solar c... |
73,665,822 | Currently struggling to add the .is-active class to my header via javascript. If you add "is-active" to the header classes it works well. But I can't seem to work it out in javascript.
I just want the class to be added as soon as you start scrolling, and then removed when returning to the top.
Appreciate all the help... | 2022/09/09 | [
"https://Stackoverflow.com/questions/73665822",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17472782/"
] | Try this code:
```
window.addEventListener("scroll", function(){
var header = document.querySelector(".header");
header.classList.toggle("is-active", window.scrollY > 0);
})
``` |
276,351 | We live in an expanding universe - so I'm told. But how can that be possible? Everything imaginable is attracted by a bigger thing. So, why can't gravitation stop the expansion of the universe? I know the "Big Bang" theory, but is it possible that the expansion of the universe is caused by the attraction of a bigger ob... | 2016/08/25 | [
"https://physics.stackexchange.com/questions/276351",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/45820/"
] | Suppose you throw a ball up into the air. You could ask how the ball manages to move upwards when gravity is pulling it down, and the answer is that it started with an upwards velocity. Gravity pulls on the ball and slows it down so it will eventually reach a maximum height and fall back, but the ball manages to move u... |
2,798,089 | I would need to get tweets from my twitter account on my wordpress site. Okey, the basics i could do, but there is one special need. I would need to get only certain tweets. Tweets that have some #hashstag for example only tweets with hashtag #myss would show up on my wordpress site.
Is there ready made plugin for thi... | 2010/05/09 | [
"https://Stackoverflow.com/questions/2798089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336676/"
] | The twitter API is pretty good at doing this sort of thing.
You could use the Twitter Search API to construct a url like the following:
```
http://search.twitter.com/search.json?q=from:yourusername+AND+#hashtag
```
You could easily write some javascript to parse this.
```
$.getJSON('http://search.twitter.com/sear... |
37,156,313 | I want to display data from below url to html page:
<https://graph.facebook.com/1041049395967347/posts?access_token=616050815226195|bqcTMDgKwdzdDyOeD8uyIKEYZlo>
(to display latest post from facebook).
Here it the code so far:
```
<!DOCTYPE html>
<html>
<body>
<h1>Customers</h1>
<div id="id01"></div>
<script>
var... | 2016/05/11 | [
"https://Stackoverflow.com/questions/37156313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3657517/"
] | Try this
```js
$.getJSON("https://graph.facebook.com/1041049395967347/posts?access_token=616050815226195|bqcTMDgKwdzdDyOeD8uyIKEYZlo",null,function(result){
var out = "<table>";
for(i = 0; i < result.data.length; i++) {
out += "<tr><td>" +
result.data[i].story +
"</td><td>" +
... |
1,241,853 | I have written some code to experiment with opengl programming on Ubuntu, its been a little while but I used to have a reasonable understanding of C. Since c++ i'm told is the language of choice for games programming I am trying to develop with it.
This is my first real attempt at opengl with sdl and I have gotten to ... | 2009/08/06 | [
"https://Stackoverflow.com/questions/1241853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/152122/"
] | Remove the glLoadIdentity() call from DrawCube(). Replace it with glPushMatrix() at the beginning and glPopMatrix() at the end. Now pressing 'w' does something. (I am not entirely sure what it is supposed to do.)
The problem is glLoadIdentity clears all the previous transformations set up with glTranslatef and the lik... |
4,923,084 | I am working in an ISP company. We are developing a speed tester for our customers, but running into some issues with TCP speed testing.
One client had a total time duration on 102 seconds transferring 100 MB with a packet size of 8192. 100.000.000 / 8192 = 12.202 packets. If the client sends an ACK every other packet... | 2011/02/07 | [
"https://Stackoverflow.com/questions/4923084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/527992/"
] | **HTML5 is still a draft**. Firefox 3.6 doesn't completely support HTML5 yet.
And according to the [HTML4 spec](http://www.w3.org/TR/REC-html40/struct/global.html#edef-ADDRESS), `address` can only contain `inline` elements:
```
<!ELEMENT ADDRESS - - (%inline;)* -- information on author -->
<!ATTLIST ADDRESS
%attrs;... |
29,346,480 | I want to implement a logic for creating a three column table using foreach loop. A sample code will look like this.
```
$array = ['0','1','2','3','4','5','6'];
$table = '<table class="table"><tbody>';
foreach($array as $a=>$v){
//if 0th or 3rd???????????wht should be here?
$table .= '<tr>';
$table .= ... | 2015/03/30 | [
"https://Stackoverflow.com/questions/29346480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2775597/"
] | This should work for you:
(See that I added a `tr` at the start and end before and after the foreach loop. Also I changed the quotes to double quotes and made sure you append the text everywhere.)
```
<?php
$array = ['0','1','2','3','4','5','6'];
$table = "<table class='table'><tbody><tr>";
... |
70,053,288 | I have a **timeseries data** of **5864 ICU Patients** and my dataframe is like this. Each row is the ICU stay of respective patient at a particular hour.
| HR | SBP | DBP | ICULOS | Sepsis | P\_ID |
| --- | --- | --- | --- | --- | --- |
| 92 | 120 | 80 | 1 | 0 | 0 |
| 98 | 115 | 85 | 2 | 0 | 0 |
| 93 | 125 | 75 | 3 | ... | 2021/11/21 | [
"https://Stackoverflow.com/questions/70053288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I edited my suggestion.. hope I understood better what u looking for. |
24,582,319 | We have a developer team of 4 and have recently moved to Git. We want to learn best practices regarding workflow with branching and merging.
We are using a lightweight version of Git Flow. We have a dev, staging and a master branch which are all linear with each other.
* staging is branched from master
* dev is bra... | 2014/07/05 | [
"https://Stackoverflow.com/questions/24582319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1053611/"
] | This always depends on how do you want to work and the team agreement. That said.
1. A feature starts from the dev branch into its own branch. From the master branch you should only branch *hotfixes* because the **master branch should always be the stable** version of your software.
2. When a *feature branch* is done,... |
18,794,793 | How can I compare a single character from a string, and another string (which may or may not be greater than one character)
This program gives me almost 300 lines of random errors. The errors don't reference a specific line number either, just a lot of stuff about "char\* ", "", or "std::to\_string".
```
#include <io... | 2013/09/13 | [
"https://Stackoverflow.com/questions/18794793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1521753/"
] | `str[4]` is a `char` type, which will not compare with a `string`.
Compare apples with apples.
Use
```
test[0] == str[4]
```
instead. |
30,127 | I've pored over the PHBs, the Rules Compendium, and similar questions at this site and other forums and I'm still confused about how magical weapons enhancements/properties interact with character powers and proficiency. Specifically, I've got two circumstances I need advice on.
**First case**: An invoker in my group ... | 2013/11/14 | [
"https://rpg.stackexchange.com/questions/30127",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/9816/"
] | There are three issues here, I think: Keywords, the two different kinds of proficiency, and permission by omission.
But before I go into those, a word: As always there are explicit features/feats/enchantments which break the rules, and that's why we call D&D an "exception-based" system: it deals in rules which apply u... |
71,021,314 | In my Anylogic model I succesfully create plots of datasets that count the number of trucks arriving from terminals each hour in my simulation. Now, I want to add the actual/"observed" number of trucks arriving at a terminal, to compare my simulation to these numbers. I added these numbers in a database table (see pict... | 2022/02/07 | [
"https://Stackoverflow.com/questions/71021314",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17658498/"
] | Maybe simply delete the variable and fill the dataset at the start of the model by looping through the dbase table data. Use the dbase query wizard to create a for-loop. Something like this should work:
```
int numEntries = (int) selectFrom(observed_arrivals).count();
DataSet myDataSet = new DataSet(numEntries);
Lis... |
39,973 | I know the differences between a **rangefinder** and a **SLR/DSLR** but what is the real reason to put a mirror in front of a lens to reflect light into the viewfinder?
It raises lens prooduction price when you put extra distance between lens and sensor. So why do that? Does it improve image quality somehow? Isn't it... | 2013/06/09 | [
"https://photo.stackexchange.com/questions/39973",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/17818/"
] | Simple, it allows you to see exactly what the camera will "see" when you expose the shot.
Nir has given you a part of the argument as well which is accuracy.
In the "middle ground" of anything around mabye 20-100mm, building a rangefinder is not too difficult and Leica had adapters for longer and wider lenses if I am ... |
2,862,698 | I'm still learning undergraduate probability. I was asked this probability puzzle in a recent quantitative developer interview. I solved the first part of the question, using brute-force. I think, brute-force very quickly becomes unwieldy for the sequence ending $THH$ - not sure if my answer is correct.
>
> A coin i... | 2018/07/25 | [
"https://math.stackexchange.com/questions/2862698",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/247892/"
] | Note: the only way you can possibly get $HHT$ before $THH$ is if the first two tosses are $HH$.
Pf: Suppose you get $HHT$ first. Then look at the first occurrence of $HHT$. Go back through the sequence. If you ever encounter a $T$, you must have $THH$ starting with the first $T$ you find. Thus, you can never find a $... |
36,123,740 | Tensorflow tends to preallocate the entire available memory on it's GPUs. For debugging, is there a way of telling how much of that memory is actually in use? | 2016/03/21 | [
"https://Stackoverflow.com/questions/36123740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/349760/"
] | (1) There is some limited support with [Timeline](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/client/timeline.py) for logging memory allocations. Here is an example for its usage:
```
run_options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE)
run_metadata = tf.RunMetadata()
... |
36,501,768 | At our .NET front-end we are using ticks to handle time localization and at the database we are storing all values in UTC. Today we came across an odd rounding error when storing records to the database, we are using the following formula to convert Ticks to a datetime.
```
CAST((@ticks - 599266080000000000) / 1000000... | 2016/04/08 | [
"https://Stackoverflow.com/questions/36501768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3048845/"
] | If you capture your calculation in a sql\_variant you can determine what type it is. In your case the calculation uses a numeric type which is not an exact datatype and this is where the rounding is occurring:
```
DECLARE @myVar sql_variant = (@Ticks - 599266080000000000) / 10000000 / 24 / 60 / 60
SELECT SQL_VARIANT... |
66,389 | Let $G$ be an ample $\mathbb{Q}$-divisor on a smooth variety $X$. Let $D$ be a $\mathbb{Q}$-divisor linearly equivalent to $G$. Let $f: Y\to X$ be a common log resolution of $G$ and $D$. We define the multiplier ideal of a divisor $G$ as $I(G)=f\_\*O\_Y(K\_{Y/X}-[f^\*G])$. Are the multiplier ideals $I(G)$ and $I((1-t)G... | 2011/05/29 | [
"https://mathoverflow.net/questions/66389",
"https://mathoverflow.net",
"https://mathoverflow.net/users/2348/"
] | I don't think so. Take for example $X=\mathbb{P}^2$, and $G$ and $D$ to be distinct lines.
then $I(G)=\mathcal{O}\_X(-G)$ while $I((1-t)g+tD)=\mathcal{O}\_X$ for every small $t>0$.
Maybe you might want to look at the multiplier ideal associated to the linear series $|G|$. |
44,200,737 | I need to remove all occurring patterns except 1, but I haven't been able to get this working in a Bash script.
I tried
```
sed -e 's/ /\\ /g' -e 's/\\ / /1'
```
and
```
sed ':a;s/\([^ ]* .*[^\\]\) \(.*\)/\1\\ \2/;ta'
```
but neither do have the desired effect unfortunately.
Is someone able to help me out?
T... | 2017/05/26 | [
"https://Stackoverflow.com/questions/44200737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7487227/"
] | **Plain Mockito library**
```
import org.mockito.Mock;
...
@Mock
MyService myservice;
```
and
```
import org.mockito.Mockito;
...
MyService myservice = Mockito.mock(MyService.class);
```
come from the Mockito library and are functionally equivalent.
They allow to mock a class or an interface and to record a... |
28,022,091 | I never wrote any complex regular expression before, and what I need seems to be (at least) a bit complicated.
I need a Regex to find matches for the following:
```
"On Fri, Jan 16, 2015 at 4:39 PM"
```
Where `On` will always be there;
then 3 characters for week day;
`,` is always there;
space is always there;
... | 2015/01/19 | [
"https://Stackoverflow.com/questions/28022091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1772830/"
] | Try this:
```
On\s+(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (?:Jan|Feb|Mar|Apr|May|June|July|Aug|Sept|Oct|Nov|Dec) \d{1,2}, \d{4} at \d{1,2}:\d{2} (?:AM|PM)
```
 |
24,283 | Reading Matthew 12:26
If Satan drives out Satan, he is divided against himself. How then can his kingdom stand?
I cant seem to pin point where is his kingdom? Evil men dont seem to be united? | 2013/12/31 | [
"https://christianity.stackexchange.com/questions/24283",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/6506/"
] | Let's take a long look at the Scriptures around your referenced Scripture:
Matthew 12:25 through 28 KJV
>
> 25 And Jesus knew their thoughts, and said unto them, Every kingdom divided against itself is brought to desolation; and every city or house divided against itself shall not stand:
>
>
> 26 And if Satan cast... |
23,032,889 | i need help, i am trying to replicate this kind of progress indicator, but i can't figure it out.
What i want:
[](https://i.stack.imgur.com/d0Ypc.png)
What i have: <http://jsfiddle.net/AQWdM/>
```css
body {
font-family: 'Segoe UI';
font-size:... | 2014/04/12 | [
"https://Stackoverflow.com/questions/23032889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3527152/"
] | You should use one pseudo rotated element and draw it on the far left side. *the first will be out of sight, so no need to worry about last `li`, set `overflow` on `ul` to hide `overflow`ing parts :).*
**[DEMO](http://codepen.io/gc-nomade/pen/FnKim/)** and CSS
```css
body {
font-family: 'Segoe UI';
font-size: 1... |
16,214,205 | Lets say, I have Product and Score tables.
```
Product
-------
id
name
Score
-----
id
ProductId
ScoreValue
```
I want to get the top 10 Products with the highest AVERAGE scores, how do I get the average and select the top 10 products in one select statement?
here is mine which selects unexpected rows
```
SELECT ... | 2013/04/25 | [
"https://Stackoverflow.com/questions/16214205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2091346/"
] | Give this a try,
```
WITH records
AS
(
SELECT a.ID, a.Name, AVG(b.ScoreValue) avg_score,
DENSE_RANK() OVER (ORDER BY AVG(b.ScoreValue) DESC) rn
FROM Product a
INNER JOIN Score b
ON a.ID = b.ProductID
GROUP BY a.ID, a.Name
)
SELECT ID, Name, Avg_Score
FROM r... |
27,470,505 | I'm using webapi2 and Castle Windsor. I'm trying to intercept calls to the ApiController to make some logging, but I can't find in the parameter the method called, url, parameters, etc. The method name returned is ExecuteAsync.
This is my interceptor call (which is hit)
```
public class LoggingInterceptor : IInte... | 2014/12/14 | [
"https://Stackoverflow.com/questions/27470505",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/723059/"
] | ```
if (invocation.Method.Name == "ExecuteAsync")
{
var ctx = (HttpControllerContext) invocation.Arguments[0];
Console.WriteLine("Controller name: {0}", ctx.ControllerDescriptor.ControllerName);
Console.WriteLine("Request Uri: {0}", ctx.Request.RequestUri);
}
invocation.Proceed();
```
Intercepting the Exe... |
207,341 | Assume this city is relatively large by late medieval standards, around 200,000 people. The city is mainly a site for trade due to its geographically central position and being on a river. Also, because it is geographically central, it also means the city is important for the government to project power.
**What might ... | 2021/07/17 | [
"https://worldbuilding.stackexchange.com/questions/207341",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/43517/"
] | I wonder if you have a too modern view of the state -- by the people, for the people. Over much of history it was by *some* people, for *some* people.
* **Illicit substances**
Very much in the eye of the beholder. In much of the West, alcohol is legal (and taxed) and cannabis is not. Say you have strong merchant gu... |
28,731 | Sometimes, package updates from MELPA can break some part of emacs and when that happens I'd like to be able to revert back to using an older version of the package.
Right now, I can do it in two ways:
* I've set emacs to delete files by moving to trash and when I update a package, the older version is trashed. I can... | 2016/11/18 | [
"https://emacs.stackexchange.com/questions/28731",
"https://emacs.stackexchange.com",
"https://emacs.stackexchange.com/users/12247/"
] | When you update your packages through the `M-x list-packages` interface, after the successful installation of the package, you'll get asked if you want to remove the old package. Don't delete them so they stay in place and you could then later remove the newer package through this interface.
My current package list sh... |
7,338,824 | I have a log line that I am pulling from bash like:
```
There are 5 apples and 7 oranges
```
And I want to get the 5 and 7 into bash variables and am having problems doing so.
awk '{ print $3, $6 }' won't work due to the fact that their position might change, if there are bananas. Bonus points if the digits can be ... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7338824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/884881/"
] | and to get the fruits:
```
echo 'There are 5 apples and 7 oranges' | grep -o -E '[[:digit:]]+ [[:alpha:]]+'
``` |
65,263,049 | I am using this logic in my button i.e if login the buynow class is working else login modal is open.
& code here.
```
<button class="ps-btn ps-btn--sm @if(session()->has('name')){{'buy_now'}}"@else {{data-toggle="modal" data-target="#loginModal"}}@endif>Buy Now<i class="ps-icon-next"></i></button>
``` | 2020/12/12 | [
"https://Stackoverflow.com/questions/65263049",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14724522/"
] | You can use below code
```
<button class="ps-btn ps-btn--sm
@if(session()->has('name')) buy_now"
@else " data-toggle='modal' data-target='#loginModal'
@endif>Buy Now<i class="ps-icon-next"></i>
</button>
```
**Notice:** We use `{{ $variable }}` for echoing a php variable. It is equivalent to `<?php echo... |
40,193,491 | I am working on a project, where I have a domain `xyz.com`, I have been requested that a subdomain example `abc.xyz.com` should point to website which has ipaddress
example `http://199.152.57.120/client/` and when a visitor browse `abc.xyz.com` it should open the website hosted on `http://199.152.57.120/client/` but by... | 2016/10/22 | [
"https://Stackoverflow.com/questions/40193491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7057429/"
] | Here's the solution for [image2](http://genxcoders.in/demo/TDirectory/2.png)
`echo '<select>';`
`structureTree(0,0);`
`echo '</select>';`
`function structureTree($deptParentId, $level){`
```
$result = getDataFromDb($deptParentId); // change this into SQL
foreach($result as $result){
echo '<option value="'.$dep... |
2,318 | We would like to get rid of the Tridion Broker as part of a project and publish content directly to a repository as part of a Storage Extension.
My question is, is there any deep dependency that Tridion has on the Broker that might mean things work in a sub-optimal way, or gotchas that I should be aware of?
Update -... | 2013/07/25 | [
"https://tridion.stackexchange.com/questions/2318",
"https://tridion.stackexchange.com",
"https://tridion.stackexchange.com/users/315/"
] | I will assume that what you mean with the Broker is the Tridion Broker database.
It is possible to publish everything to the file system, it includes, content, linking info, metadata and references, however this functionality is deprecated and will be removed in future releases, having said that, in future releases, l... |
32,869,080 | I've a class A like that:
```
public class A
{
private String id; // Generated on server
private DateTime timestamp;
private int trash;
private Humanity.FeedTypeEnum feedType
private List<Property> properties;
// ...
```
where `Property` is:
```
public class Property
{
private H... | 2015/09/30 | [
"https://Stackoverflow.com/questions/32869080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3227319/"
] | You can do what you want extending `DynamicObject` class:
```
class A : System.Dynamic.DynamicObject
{
// Other members
public List<Property> properties;
private readonly Dictionary<string, object> _membersDict = new Dictionary<string, object>();
public override bool TryGetMember(System.Dynamic.GetMe... |
64,018,695 | My program always outpout test which should not happen. Its like the program is skipping the case to go to default right away. I don't understand why it does that. I've spent 30 mins to find a solution but I can't understand why it does that.
Thanks for helping me !
```
var ani;
let ans;
let prix;
var total;
var arm1... | 2020/09/22 | [
"https://Stackoverflow.com/questions/64018695",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14323955/"
] | You are doing `ani.toLowerCase`. It should be `ani.toLowerCase()`. Also remove the return 1. |
59,973 | I want to register a sidebar but I am a little confused about the uses of the `id` argument in [`register_sidebar`](http://codex.wordpress.org/Function_Reference/register_sidebar) function.
>
> Codex says: id - Sidebar id - Must be all in lowercase, with no spaces
> (default is a numeric auto-incremented ID).
>
>
... | 2012/07/28 | [
"https://wordpress.stackexchange.com/questions/59973",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/11125/"
] | John Landells’ answer is good and correct.
I want to add a **List of forbidden or reserved IDs** – these IDs may appear on the widget config page `/wp-admin/widgets.php`. If you use one of these … strange things will happen due to duplicated IDs. Drag and drop will probably not work anymore. See [Ticket #14466](http:... |
17,435,950 | I am trying to improve the performance of a hammered wordpress DB by adding indexes to queries that appear in the slow query log.
In MS SQL you can use query hints to force a query to use an index but it is usually quite easy to get a query to use an index if you cover the columns correctly etc.
I have this query tha... | 2013/07/02 | [
"https://Stackoverflow.com/questions/17435950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1037545/"
] | >
> Does MySQL have query hints to force an index to be used for speed/performance tests or is there something else I need to do to see why this index is being ignored.
>
>
>
[The documentation](http://dev.mysql.com/doc/refman/5.0/en/index-hints.html) answers this question in some detail:
>
> By specifying `USE ... |
51,384,796 | I have a table that have logins in one column and phone numbers in another. I need to copy all phone numbers of each login and paste them to another sheet. But i need only unique phone numbers as one login may contain many records with the same phone number. What i have tried and what failed
```
For Each rCell In Shee... | 2018/07/17 | [
"https://Stackoverflow.com/questions/51384796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5874458/"
] | you can add this
```
onFocus={useTheOnFocus ? onFocusHandler : undefined}
```
or set a handler
```
onFocus={onFocusHandler}
```
and check a condition in a handler
```
onFocusHandler = (ev) => {
if(!condition) {
return null;
}
// your code
}
``` |
24,440,216 | I have line like this
and I am searching for how the input works when the code is executed
```
scanf("%d, %f",&withdrawal ,&balance );
```
I use Cygwin to compile the code and afterwards I am asked for inputs.
Does it mean that I have to write two numbers separated by space
```
60 120
```
or there is some tr... | 2014/06/26 | [
"https://Stackoverflow.com/questions/24440216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3460161/"
] | scanf(), or scan formatted, expects input in the format you specified. scanf("%d, %f") simply means you expect input in this exact format, for example: 62, 2.15 . |
42,461,533 | i'm developing a java program that shows area and perimeter of two rectangle with fixed width&length, current date and reads input from user to solve a linear equation. I was able to ask a user if they want to re-run the program or not. the problem is that if they input y or Y, the program runs, but if the user enters ... | 2017/02/25 | [
"https://Stackoverflow.com/questions/42461533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2066392/"
] | You can add a `do while` when you asks the user whether if he wants to repeat the program.
Besides, instead of specifying both uppercase and lowercase in statement : `while(ch == 'y' || ch == 'Y');` you can use `Character.toLowerCase()` method to reduce the number of tests to perform.
```
do {
System.ou... |
34,778,041 | I want to know what `[=]` does? Here's a short example
```
template <typename T>
std::function<T (T)> makeConverter(T factor, T offset) {
return [=] (T input) -> T { return (offset + input) * factor; };
}
auto milesToKm = makeConverter(1.60936, 0.0);
```
How would the code work with `[]` instead of `[=]`?
I as... | 2016/01/13 | [
"https://Stackoverflow.com/questions/34778041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4503737/"
] | The `[=]` you're referring to is part of the *capture list* for the lambda expression. This tells C++ that the code inside the lambda expression is initialized so that the lambda gets a copy of all the local variables it uses when it's created. This is necessary for the lambda expression to be able to refer to `factor`... |
51,206,456 | I have restructured my project folders. I see that i lost commit history before restructuring of files in my remote repository.
I have the history before restructuring locally.
Right now everyone who clone the repository doesn't have the commit history before restructuring.
Is there anyway i can rebuild the commit h... | 2018/07/06 | [
"https://Stackoverflow.com/questions/51206456",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1057347/"
] | The only way to lose history in Git is to remove commits. This is because the commits *are* the history. There is no file history; there are only commits.
When you use `git log --follow pom.xml`, you are telling Git to *synthesize* a file history, by wandering through the commit history and noting when a file named `p... |
7,515,167 | What I want is when checkbox1 is selected both checkbox labelled 1 will get selected and background will be removed
[here is the fiddle](http://jsfiddle.net/rigids/D2vCf/)
for eg if i select checkbox1 it should select both checkbox labelled checkbox1 | 2011/09/22 | [
"https://Stackoverflow.com/questions/7515167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/791441/"
] | The problem is that searching for ID $("#somethin") is not possible to select more than one element. IF you search for class, then your example works.. well, with [some minor changes](http://jsfiddle.net/D2vCf/11/) :)
```
$(document).ready(function() {
$('input[type=checkbox]').change(function(){
var pos;
... |
4,195,726 | I want to create a custom TableViewCell on which I want to have UITextField with editing possibility.
So I created new class with xib. Add TableViewCell element. Drag on it UITextField. Added outlets in my class and connect them all together. In my TableView method cellForRowAtIndexPath I create my custom cells, BUT t... | 2010/11/16 | [
"https://Stackoverflow.com/questions/4195726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/449007/"
] | Do not use UITableViewCell's initializer, but make the cell load from your nib:
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"EditCell";
EditCell *cell = (EditCell*) [tableView dequeueReusableCellWithIdentifier... |
19,796,235 | I'm new to Android programming and working with Retrofit. I've done a bunch of research on this topic, but haven't been able to find a solution specific to my needs. I'm working with our API and trying to make a POST request. I successfully achieved this with the following non-Retrofit code:
```
private class Proc... | 2013/11/05 | [
"https://Stackoverflow.com/questions/19796235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2957545/"
] | One of the benefits of Retrofit is not having to parse the JSON yourself. You should have something like:
```
service.login(email, password, new Callback<User>() {
@Override
public void failure(final RetrofitError error) {
android.util.Log.i("example", "Error, body: " + error.getBody().toS... |
93,391 | I am designing a campaign and I have a couple of evil power blocs vying for control. I would really like to have one of them directly interacting with the party and I think I really want it to be a devil because I love the idea of the lawful evil tricking them while still being true to its word.
So my question would i... | 2017/01/18 | [
"https://rpg.stackexchange.com/questions/93391",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/29455/"
] | Hide in plain sight. There are two good options for this:
**Erinyes** Based on the picture on MM 73, these creatures are mostly humanoid, but have wings. The horns on the helmet may or may not cover any natural horns; it's unclear. Either way, you could throw on a cloak to hide your wings, then claim to be a Tiefling.... |
61,330,119 | Have some arduino code for temp loggers that is VERY NEARLY working....!
I've built an OTA routine so I can update them remotely, however the delay() loop I had to ensure it only logged temperatures every 15 mins is now causing problems as it effectively freezes the arduino by design for 15mins, meaning OTA wouldn't w... | 2020/04/20 | [
"https://Stackoverflow.com/questions/61330119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528013/"
] | Set a `TimerObject`. [this](https://playground.arduino.cc/Code/ArduinoTimerObject/) seems to be what you want.
1. Download the [Arduino TimerObject code](https://github.com/aron-bordin/ArduinoTimerObject) from github and follow the installation instructions
2. `#include "TimerObject.h"`
3. Create the callback function... |
16,849,302 | I want to start my `MainActivity` with a new `Intent` in my other `Activity`. The two Activities are in the same app, and the second Activity is actually started from the MainActivity. So the scenario is like this:
1. MainActivity is created with an Intent
2. MainActivity starts SecondActivity (but MainActivity is not... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16849302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/869330/"
] | Create a table with single autoincrement column.
When you need another unique id - just insert `null` into that column and retrieve last insert id.
For oracle - create a sequence and use `SELECT sequence_name.nextval` FROM DUAL`
For sql server - create a sequence and fetch it with `NEXT VALUE FOR` |
107,980 | I took a bunch of screenshots and I want to make them pages in a single PDF. Selecting all four in Preview and exporting to PDF only exports two (?), separately. The "Export to PDF" File menu function adds a strange white border around the screenshots (and orients the page as portrait). So I converted each to PDFs indi... | 2013/11/01 | [
"https://apple.stackexchange.com/questions/107980",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/21351/"
] | You can use the `convert` command if you install **ImageMagick**. ImageMagick isn't always a simple install, but if you install Xcode and [Homebrew](http://brew.sh) it should be fairly painless.
`convert *.png foobar.pdf`
<http://www.imagemagick.org/script/convert.php> |
54,439,830 | How will i set selected value=Booking.
```js
$('#status').val("Booking");
```
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select name="status" class="form-control">
<option value="" id="status">New</option>
<option value="">Follow</option>
<option ... | 2019/01/30 | [
"https://Stackoverflow.com/questions/54439830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10954362/"
] | try to follow the below example. there is no booking option in your select add it like below code
```
$('#mySelect')
.append($("<option></option>")
.attr("value",key)
.text("Booking"));
``` |
13,177,124 | In a Hashmap the hash code of the key provided is used to place the value in the hashtable. In a Hashset the obects hashcode is used to place the value in the underlying hashtable. i.e the advantage of the hashmap is that you have the flexibility of deciding what you want as the key so you can do nice things like this.... | 2012/11/01 | [
"https://Stackoverflow.com/questions/13177124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1701264/"
] | In your example, a String is immutable so its hashcode cannot change. But hypothetically, if the hashcode of an object did change while was a key in a hash table, then it would *probably disappear* as far as hashtable lookups were concerned. I went into more detail in this Answer to a related question: <https://stackov... |
1,780,461 | I have a shared library(.so) that I preload before executing an application and I have a few global data structures in the shared library that the application uses. The application can create other processes say using fork() and these processes can update the global data structures in the shared library. I would like t... | 2009/11/22 | [
"https://Stackoverflow.com/questions/1780461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/216682/"
] | To phrase this most clearly: you cannot do exactly what you asked. Linux does not support sharing of global variables that are laid out by the linker. That memory will be in unsharable mapped-to-swap space.
A general recipe I can offer is this:
1. define a struct that lays out your data. No Pointers! Just offsets.
2.... |
35,573 | I'm looking for all possible sources of clinically tested human SNPs. There is a handful of databases that store SNPs (like dbSNP), but I only need those that have validated presence/absence of phenotypic effects with some additional metadata. Thank you in advance. | 2015/06/27 | [
"https://biology.stackexchange.com/questions/35573",
"https://biology.stackexchange.com",
"https://biology.stackexchange.com/users/13338/"
] | You can search by traits (mostly diseases) for genome wide association, in these databases:
* [Gwasdb2](http://jjwanglab.org/gwasdb)
* [Human genome variation Database](https://gwas.biosciencedbc.jp/): it also links to a Copy number Variation (CNV) database. |
73,368,824 | `$ echo file.txt`
```
NAME="Ubuntu" <--- some of this
VERSION="20.04.4 LTS (Focal Fossa)" <--- and some of this
ID=ubuntu
ID_LIKE=debian
VERSION_ID="20.04"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-polic... | 2022/08/16 | [
"https://Stackoverflow.com/questions/73368824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9971404/"
] | With your shown samples try following `awk` code.
```bash
awk -F'"' '/^NAME="/{name=$2;next} /^VERSION="/{print name,$2}' Input_file
```
***Explanation:***
* Setting field separator as `"` for all the lines here.
* Checking condition if line starts with `Name=` then create variable name which has 2nd field. `next` ... |
44,419,907 | I am trying to integrate a version/source control system with my unity project. [This answer](http://answers.unity3d.com/answers/1251608/view.html) directed me towards using source/version control. (I dont know the difference.)
The answer links to a tutorial which explains creating the repository and pushing it to a ... | 2017/06/07 | [
"https://Stackoverflow.com/questions/44419907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5640537/"
] | This is simple math, the php code does exactly what it looks like it does. Am I missing something?
loop 1:
```
$i = 1
$s = 0 + (2*1 + 5) = 7
```
loop 2:
```
$i = 2
$s = 7 + (2*2 + 5) = 7 + 4 + 5 = 16
```
loop 3:
```
$i = 3
$s = 16 + (2*3 + 5) = 16 + 6 + 5 = 27
```
loop 4:
```
... |
4,668,309 | I'm currently implementing a rather large interface and some of its methods are not applicable to the implementation.
Should I do something akin to:
```
/**
* @throws UnsupportedOperationException always. This method is not applicable.
*/
public void fooMethod() {
throw new UnsupportedOperationException("This met... | 2011/01/12 | [
"https://Stackoverflow.com/questions/4668309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73070/"
] | I think that simply depends on the contract defined by the method.
If for example "remove" is not supported by your "List" implementation, you should throw an exception to indicate that this behavior is missing because the client relies on an expected result.
If the feature is optional in the sense that the **contra... |
1,745,183 | >
> I want to show that the ideals $(x,y)$ and $(2,x,y)$ of $\mathbb{Z}[x,y]$ are prime ideals.
>
>
>
---
Could you give some hints how we could do that?
Do we have to show that $\mathbb{Z}[x,y]/(x,y)$ and $\mathbb{Z}[x,y]/(2,x,y)$ are integral domains?
How could we do that? Could you give me a hint?
$$$$ ... | 2016/04/16 | [
"https://math.stackexchange.com/questions/1745183",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/80708/"
] | Show that $\mathbb{Z}[x,y]/(x,y)$ is isomorphic to $\mathbb{Z}$ using the evaluation map at $0$ and $\mathbb{Z}[x,y]/(2,x,y)$ is isomorphic $\mathbb{Z}/2\mathbb{Z}$ by reducing the coefficents of the polynomial modulo $2$. In both cases consider the kernel of the map and use the first isomorphism theorem. |
160,890 | I have the following MWE
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos \s... | 2014/02/17 | [
"https://tex.stackexchange.com/questions/160890",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/19396/"
] | Or use `\hphantom{{}={}}`:
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos ... |
30,341,842 | In this program I try to get data from SQL into a list of strings and show them in a `messageBox`. The program should start searching when I type one character in `textBox` and use this in the query as below:
```
string sql = " SELECT * FROM general WHERE element='" + textBox1.Text + "' OR element='" + textBox2.Text... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30341842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4909030/"
] | What are you doing wrong? a bunch of things:
In your question you write you gen an error but don't tell us what it is.
Exceptions has messages for a reason: so that you will be able to know what went wrong.
As to your code:
* You are concatenating values into your select statement instead of using [parameterized ... |
23,408,853 | My program is running fine when i run it on VS with my own 'main()' function but i have to submit this where main is hidden from me I only know that it will pass arguements to my functions and check their return result. But it is giving segmentation fault error when I try to use arguement passed to my function.
Here is... | 2014/05/01 | [
"https://Stackoverflow.com/questions/23408853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3592832/"
] | Shouldn't it be?
```
var d = value.FirstOrDefault(x => String.Equals(x.Culture, Thread.CurrentThread.CurrentCulture.Name, StringComparison.InvariantCultureIgnoreCase));
``` |
4,029 | I plan to ask about how to restore some defunct human genes. The GULO pseudo gene is the first one I am going to ask about. Should the question maybe be split into several question? The intended question is as follows.
A lot of base pairs in the defunct GULO pseudo gene in humans are missing to make a functional enzym... | 2020/01/10 | [
"https://biology.meta.stackexchange.com/questions/4029",
"https://biology.meta.stackexchange.com",
"https://biology.meta.stackexchange.com/users/11654/"
] | **NO: we should stick to the current threshold of 5.**
I have noticed wayy too many circumstances in which a question was being voted to be closed by 2-3 users *inappropriately* (i.e., the close votes were unfounded/not supported or the wrong close reason was chosen). Reasons for these inappropriate VTCs range from no... |
18,771,268 | I'm having trouble with 1 line of code I've run it over and over again but I don't know what I'm doing wrong, I'm thinking it's the `if` statement but I'm not sure. The line I'm having trouble with is in the comment. I don't know how to write it so it works properly.
```
import random
print"Hello hero, you are surrou... | 2013/09/12 | [
"https://Stackoverflow.com/questions/18771268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2423223/"
] | I think you want to test if you have any potions before you award the benefits of using one. Like this:
```
elif a=="potion":
if p==0: #supposed to be if potion = 0 print (you dont have any left)
print"you dont have any left"
else:
print "you have used a potion"
h+=20
p=p-1
... |
3,146,767 | I know that if we have $3$ points $a$, $b$,and $c$ in $\mathbb R^3$, the area of the triangle is given by: $\frac{1}{2}\|\vec{ab}\times \vec{ac}\|$.
This means that the area of the triangle equals half the length of the normal of the plane on which the triangle lays.
I don't quite understand how this can be. What o... | 2019/03/13 | [
"https://math.stackexchange.com/questions/3146767",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/649007/"
] | The [geometric interpretation](https://en.wikipedia.org/wiki/Cross_product#Geometric_meaning) of the magnitude of the cross product $\left\|\vec v \times \vec w\right\|$ is the area of the **parallellogram** spanned by the vectors $\vec v$ and $\vec w$ and the triangle with vertices $\vec o$, $\vec v$ and $\vec w$ is e... |
4,295,758 | I have set my compression like this for my **NSMutableUrlRequest** on my iphone app (I use Monotouch, but it's a 1:1 API match):
```
var req = new NSMutableUrlRequest (new NSUrl (str), NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 20)
req["Accept-Encoding"] = "compress, gzip";
```
When I download ... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4295758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172861/"
] | ```
if (contents[0] == '\n')
memmove(contents, contents+1, strlen(contents));
```
Or, if the pointer can be modified:
```
if (contents[0] == '\n') contents++;
``` |
49,290,374 | I have a table who have creation date like:
```
SELECT [CreationDate] FROM Store.Order
```
So each register have one datetime like:
```
2018-03-14 00:00:00.000
2017-04-14 00:00:00.000
2017-06-14 00:00:00.000
```
I want to know how to `COUNT` only register of Date equals to current month and year, for example i... | 2018/03/15 | [
"https://Stackoverflow.com/questions/49290374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9452841/"
] | Here is one option:
```
SELECT COUNT(*)
FROM Store.Order
WHERE
CONVERT(varchar(7), [CreationDate], 126) = CONVERT(varchar(7), GETDATE(), 126);
```
[Demo
----](http://rextester.com/NLHQPE86189)
We can convert both the creation date in your table and the current date into `yyyy-mm` strings, and then check if they... |
45,735,671 | I am using [GlideJS](http://glide.jedrzejchalubek.com/) to display a carousal. The height of each item in this carousal is different and I have therefore set the property:
```
autoheight: true
```
The problem is when I try to display the carousal in a collapsed div with the autoheight property set to 'true' the caro... | 2017/08/17 | [
"https://Stackoverflow.com/questions/45735671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3398797/"
] | What you need to do is codesplitting.
Without code splitting
+ are loaded at the first start
```
import Login from './Login'
import Home from './Home'
const App = ({ user }) => (
<Body>
{user.loggedIn ? <Route path="/" component={Home} /> : <Redirect to="/login" />}
<Route path="/login" component={Login... |
58,255,047 | How do I display the information data using the ID in the url
example is www.thatsite.com/?id=1092
and it will display the data of the 1092 ID
```
<?php
$connect = mysqli_connect("localhost", "xxxxxxx", "xxxx","xxxx");
$query = "SELECT `name`, `age`, `xxxxx` , `xxxxx`, `image` FROM `profiles` WHERE `id` ... | 2019/10/06 | [
"https://Stackoverflow.com/questions/58255047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your code is full of security holes. It is prone to sql injection, xss attack, csrf, html injection.
I have re-written it to circumvent all the issues.
**1.) Sql Injection** is now mitigated using prepare queries
**2.) Html injection** is mitigated using **intval** for integer variables and **strip\_tags** for strin... |
71,729,307 | I'm a beginner in Python and flask. I am going through the Flask tutorial up to [Define and Access the Database](https://flask.palletsprojects.com/en/2.1.x/tutorial/database/) section.
wrote up all the codes, saved, and execute the command below to initalise the DB.
`flask init-db`
However, I get the error on the ter... | 2022/04/03 | [
"https://Stackoverflow.com/questions/71729307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18600140/"
] | Your code has `open_instance_resource`, which is looking for `instance/schema.sql` - but your `schema.sql` is not there. The original code has `open_resource`, which looks relative to `root_path`. |
30,975,060 | i'm new to android developing and started to develop an booking app. There is a calendar view and i want to disable booked dates in that calendar. I found out that disabling feature is not there in android default calendar. so could you please help me to find a good custom calendar view that can disable specific dates.... | 2015/06/22 | [
"https://Stackoverflow.com/questions/30975060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2214782/"
] | Include CalendarPickerView in your layout XML.
```
<com.squareup.timessquare.CalendarPickerView
android:id="@+id/calendar_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
```
In the onCreate of your activity/dialog or the onCreateView of your fragment, initialize the view with a range... |
12,106,280 | In my code, I want to remove the img tag which doesn't have src value.
I am using **HTMLAgilitypack's HtmlDocument** object.
I am finding the img which doesn't have src value and trying to remove it.. but it gives me error Collection was modified; enumeration operation may not execute.
Can anyone help me for this?
... | 2012/08/24 | [
"https://Stackoverflow.com/questions/12106280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1567913/"
] | It seems you're modifying the collection during the enumeration by using `HtmlNode.RemoveChild` method.
To fix this you need is to copy your nodes to a separate list/array by calling e.g. [`Enumerable.ToList<T>()`](http://msdn.microsoft.com/en-us/library/bb342261.aspx) or [`Enumerable.ToArray<T>()`](http://msdn.micro... |
13,615,562 | Hi I really have googled this a lot without any joy. Would be happy to get a reference to a website if it exists. I'm struggling to understand the [Hadley documentation on polar coordinates](http://docs.ggplot2.org/current/coord_polar.html) and I know that pie/donut charts are considered inherently evil.
That said, w... | 2012/11/28 | [
"https://Stackoverflow.com/questions/13615562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1675004/"
] | I don't have a full answer to your question, but I can offer some code that may help get you started making ring plots using `ggplot2`.
```
library(ggplot2)
# Create test data.
dat = data.frame(count=c(10, 60, 30), category=c("A", "B", "C"))
# Add addition columns, needed for drawing with geom_rect.
dat$fraction = d... |
50,462,402 | I starting getting this error on my Angular app:
>
> The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3
> was found instead
>
>
>
and when I try to downgrade typescript to the right version doing:
`npm install -g typescript@2.7.2` it says updated 1 package.
when I verify typescript version u... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50462402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931511/"
] | You should do `npm install typescript@'>=2.7.2 <2.8.0'`. This will install the correct typescript your project needs. Make sure you run this inside your Angular project.
On Windows, you should use double quotes instead of single quotes, like so:
```
npm install typescript@">=2.7.2 <2.8.0"
```
Otherwise, you'll get... |
21,871 | (I am learning Buddhism/dharma in Chinese.)
为什么合掌鞠躬叫"问讯"?
或是说:
为什么现在的"问讯"不是用讲的?
"问"和"讯"都是动词吗?还是动词+名词? | 2016/11/17 | [
"https://chinese.stackexchange.com/questions/21871",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/15752/"
] | 依[香光莊嚴](http://www.gaya.org.tw/magazine/v1/2005/59/art1.htm)解釋:
在漢語的構詞上,問訊是由「問」與「訊」二個同義詞所組成的詞彙。
「問」是動詞,意思是「恤問」。
「訊」是動詞,意思是「詢問」。
如果「訊」作名詞,在非佛教場合也還是可以用的。如:打聽消息。
現在的"問訊"也還是有用講的,但通常只在人少的時候。當很多人同時向佛或法師表達恭敬時,沒辦法大家都講,所以就只有身體的動作。
問訊 is composed of two synonyms, 問 and 訊.
Both are verbs, meaning "comfort and ask".... |
27,411,468 | I'm trying to get my code to go through and pop-out after some math has been done. The file being summed is just lists of numbers on separate lines. Could you give me some pointers to make this work because I am stumped.
**EDIT:**
I'm trying to get the transition from the main function to Checker function working corr... | 2014/12/10 | [
"https://Stackoverflow.com/questions/27411468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4347640/"
] | `lambda args: expr` is not a special magic feature, it's just nice shorthand for
```
def someFunc(args):
return expr
```
which is mainly useful when you need a small function with a simple expression for its body and you don't care about the name. If we used familiar syntax, the `closest()` method would be:
```... |
218,488 | My house's 240v circuit for the cooktop is a /2 cable. (black, white and bare copper). The new whirlpool cooktop has a 3 wire connection (black,red and bare copper). Whirlpool's instructions do not cover this wiring example. Their 3 wire to 3 wire example assumes you have a red wire from the house. Is there an easy pat... | 2021/03/10 | [
"https://diy.stackexchange.com/questions/218488",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/131410/"
] | If that is indeed a 240V circuit, the white wire *kinda shoulda* been re-marked with tape to indicate that it is a hot wire. Prior to about 20 years ago, they were allowed to skip the marking "if the usage was obvious". The reason for the change is that their "obvious" is not your "obvious".
If you are confident that ... |
3,588 | I am getting a 404 error when trying to go to my admin page was working fine earlier today. Haven't changed anything since I last logged in and the only thing I was doing was assigning products to categories.
<http://mytempsite.net/gotie/admin>
**WHAT IVE TRIED SO FAR**
Delete the following file:-
app/etc/use\_cac... | 2013/05/09 | [
"https://magento.stackexchange.com/questions/3588",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/1847/"
] | First, are you the only admin user?
Second, In your app/etc/local.xml, look for:
```
<admin>
<routers>
<adminhtml>
<args>
<frontName><![CDATA[admin]]></frontName>
</args>
</adminhtml>
</routers>
</admin>
```
Does it say admin or something else?
Third... |
42,570,539 | When I run `docker-compose up -d`, docker always creates container name and network name prepended with the folder name that contains `docker-compose.yml`file.
I can specify the container name as follows:
```
nginx:
container_name: nginx
build:
context: .
dockerfile: .docker/docker-nginx.docke... | 2017/03/03 | [
"https://Stackoverflow.com/questions/42570539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1072698/"
] | Docker Prepends the current folder name with all the components name created using docker compose file.
Eg : If the current folder name containing the docker-compose.yml file is test, all the volumes,network and container names will get test appended to it. In order to solve the problem people earlier proposed the ide... |
61,852 | *How do you even read these runes?*
[](https://i.stack.imgur.com/7yv5Q.png)
*Note: Click image for full size* | 2018/03/13 | [
"https://puzzling.stackexchange.com/questions/61852",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/46455/"
] | As described in [Gareth's answer](https://puzzling.stackexchange.com/a/61853/20521) (go upvote that if you haven't already), the first step is to notice that:
>
> the white background isn't all quite white, and a bit of colour remapping produces [this image](https://i.stack.imgur.com/IoRmt.png).
>
>
>
From there... |
3,070,274 | I'm looking for a way to do something like this:
```
// style.css
@def borderSize '2px';
.style {
width: borderSize + 2;
height: borderSize + 2;
}
```
where the width and height attributes would end up having values of 4px. | 2010/06/18 | [
"https://Stackoverflow.com/questions/3070274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/317404/"
] | Sometimes I use the following:
```
@eval BORDER_SIZE_PLUS_2 2+2+"px"; /* GWT evaluates this at compile time! */
```
Oddly, this only works, if you don't put any spaces between the `+` operator and the operands. Also, in @eval you can't use constants that were previously defined by @def. You can however use constants... |
49,470,764 | Suppose you have 14 bits. How do you determine how many integers can be represented in binary from those 14 bits?
Is it simply just 2^n? So 2^14 = 16384?
Please note this part of the question: "how many INTEGERS can be represented in BINARY...". That's where my confusion lies in what otherwise seems like a fairly str... | 2018/03/24 | [
"https://Stackoverflow.com/questions/49470764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8716929/"
] | The answer depends on whether you need signed or unsigned integers.
If you need unsigned integers then using `2^n` you can represent integers from 0 to 2^n exclusive. e.g. n=2; 2^2=4 you can represent the integers from 0 to 4 exclusive (0 to 3 inclusive). Therefore with n bits, you can represent a maximum unsigned int... |
186,718 | The Bearer: Background
----------------------
---
On Alternate Earth, studies and cases have shown that a *small percentage of the population (10%) is responsible for 90% of the bad luck*.
**These people are targeted by bad luck**, almost by cosmic forces: they are struck by lightning out of a sunny day, hit by cars... | 2020/10/03 | [
"https://worldbuilding.stackexchange.com/questions/186718",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/68848/"
] | ***Two Roads:***
There are two directions your society can take with regards to bearers, and it somewhat depends on how the actual "ability" functions. The tetroid wave situation is complex, and I think only you fully understand it. Both of these solutions can be applied, or can be exclusive. It's up to you.
1. **Exi... |
128,386 | I have these scripts I made that work absolutely perfectly as I need them to. Is there any improvements that can be done to these scripts and make them more efficient for Mobile Platforms? Or even just combine them into one script?
These 4 scripts are just about identical except that each one controls a different obst... | 2016/05/14 | [
"https://codereview.stackexchange.com/questions/128386",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/103199/"
] | 1. **Bracket alignment**. For some reason, all obstacle classes and `while`-loops are written with vertically aligned bracket, while the `MonoBehaviour`s are egyptians.
>
> [Coding style] create a consistent look to the code, so that readers can focus on content, not layout. - [C# Coding Convention](https://msdn.micr... |
40,802 | I need to compute the Drazin inverse $A^D$ of a singular M-matrix $A$, i.e., a matrix in the form $A=\lambda I -P$, where $P$ has nonnegative entries and $\lambda$ is the spectral radius (Perron value) of $P$. I already know the right and left eigenvectors $v$ and $u^T$ of $P$ with eigenvalue $\lambda$ (that is, the ve... | 2010/10/02 | [
"https://mathoverflow.net/questions/40802",
"https://mathoverflow.net",
"https://mathoverflow.net/users/1898/"
] | If you have access to Matlab, and the matrix is not gigantic
you can use the following to calculate the Drazin inverse:
1. Determine the index of $A$, i.e, does $\mathrm{rank}(A^k) = \mathrm{rank}(A^{k+1})$
2. Solve the linear system $A^{k+1} X = A^k$
3. Use the fact that $A^D$, the Drazin inverse, is given by
$$A^D... |
4,315 | Fred has a puzzle. The instruction sheet, which is separate from the equation,simply says: "Make this equation true. You may ONLY draw ONE, PERFECTLY straight line". The equation is all alone on a blank piece of paper and reads:
```
5+5+5=550
```
There are 4 acceptable answers. You must get all 4 for a correct answ... | 2014/11/12 | [
"https://puzzling.stackexchange.com/questions/4315",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/5180/"
] | 1. >
> Cross out the equals sign
>
>
>
2. >
> Turn the first $+$ into a 4 giving $545+5=550$
>
>
>
3. >
> Turn the second $+$ into a 4 giving $5+545=550$
>
>
>
4. >
> Turn the equals sign into less than or equal to
>
>
> |
345,024 | I found a theme I really like:
<https://de.wordpress.org/themes/online-consulting/>
Unfortunately, the "Read more" button is in a position I don't really like:
[](https://i.stack.imgur.com/DHg0E.png)
I would vastly prefer if the button was below th... | 2019/08/13 | [
"https://wordpress.stackexchange.com/questions/345024",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/173432/"
] | If you go into your Admin section, under Appearance > Edit CSS, you will be able to override the CSS of the theme. In order to find out what the class is, you might want to Inspect the control with Google Chrome's Developer Tools. |
65,483,417 | I get error: "UnhandledPromiseRejectionWarning: Error [ERR\_HTTP\_HEADERS\_SENT]: Cannot set headers after they are sent to the client",
guessing that the problem is with promises, but I don't understand how to fix it.
How do I fix my code to avoid this error, but keep the logic and work with the database?
```
router... | 2020/12/28 | [
"https://Stackoverflow.com/questions/65483417",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14866914/"
] | You can declare listOfFileSignatures globally, but the signatures are computed asynchronously, so the list will be empty directly after the for loop. FileReader is always asynchronous, so you can't avoid that. One possibility to handle this is to check if the list is full inside onloadend (`listOfFileSignatures.length ... |
73,603,252 | I have the following data:
```
structure(list(cells = c("Adipocytes", "B-cells", "Basophils",
"CD4+ memory T-cells", "CD4+ naive T-cells", "CD4+ T-cells",
"CD4+ Tcm", "CD4+ Tem", "CD8+ naive T-cells", "CD8+ T-cells",
"CD8+ Tcm", "Class-switched memory B-cells", "DC", "Endothelial cells",
"Eosinophils", "Epithelial... | 2022/09/04 | [
"https://Stackoverflow.com/questions/73603252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17945841/"
] | `string` isn't a byte buffer, it has very hard rules for encoding. I can easily see how the normal encoding rules will lengthen or shorten the resulting bytes that you're then using to convert to an integer. In fact, even if everything works perfectly, your string has twice as many bytes as the resulting integer. Have ... |
68,548,658 | i am working on an online shopping application using retrofit, coroutine, livedata, mvvm,...
i want to show progress bar before fetching data from server for afew seconds
if i have one api request i can show that but in this app i have multiple request
what should i do in this situation how i should show progr... | 2021/07/27 | [
"https://Stackoverflow.com/questions/68548658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16530334/"
] | I couldn't help but notice that your repository contains lots of repetitive code. first point to learn here is that all that logic in `Repository`, it usually goes in the `ViewModel`. second thing is that you are using `applicationScope` to launch your `coroutines`, which usually is done using `viewModelScope`(takes ca... |
64,206 | As the title suggests, a friend and I are writing a manga-plot
and there is this character that is having the speech disorder - he stutters.
---
Writing the question directly to avoid confusion.
Afterwards providing some attempts to clarify both what the question is about & details.
Finally I will add *Background*,... | 2023/01/15 | [
"https://writers.stackexchange.com/questions/64206",
"https://writers.stackexchange.com",
"https://writers.stackexchange.com/users/47418/"
] | So if I'm interpreting this correctly, you want to write a character who stutters based off yourself, but want to know how to avoid them coming off as cliché or offending other people who stutter/stutterers due to being nonrepresentative, right? And have attempted to search for resources only to find a sum total of not... |
2,897,262 | Example Question :
$3m + 4n = 70$, $m,n$ are natural numbers. How many values can $m$ have?
I learned a method to solve this kind of problem, but I've never thought about that before.
for
n=1 => m=22
n=4 => m=18
.
.
n=16 => m=2
So n increase 3 by 3 and m decrease 4 by 4
How do we proof this w... | 2018/08/28 | [
"https://math.stackexchange.com/questions/2897262",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/587885/"
] | Once you have an initial solution, say $(m\_0, n\_0)$ such that
$3m\_0 + 4n\_0 = 70$
then you can add (or subtract) any multiple of $3$ to $n\_0$ as long as you subtract (or add) the same multiple of $4$ from $m\_0$. This is because
$3(m\_0-4k) + 4(n\_0+3k) = 3m\_0-12k + 4n\_0+12k = 3m\_0 + 4n\_0=70$ |
13,110,276 | I'm working on a regular expression where I need to verify a input text that contains 4 distinct words separated by a comma.
>
> input text words: - one, two, three, four. Each of these words should not be repeated more than once.
> so, it can be: two, three, four, one or three, four, two, one and not one, one, on... | 2012/10/28 | [
"https://Stackoverflow.com/questions/13110276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1781007/"
] | It would be far easier to NOT do this particular problem with a single regular expression.
First off, `\b` is zero-width. So you do not need to follow it using a `?`, your intention is probably `\s?`.
Next, regex is pretty much stateless, in the general case, which means that you'd need to construct your regex as fol... |
37,208,644 | I want to add new row to gridcontrol at every button click. I tried many ways but no success. I am sending my code.
```
private void B_Click(object sender, EventArgs e)
{
Button bt = (Button)sender;
int productId = (int)bt.Tag;
AddProductDataContext db = new AddProductDataContext();
d... | 2016/05/13 | [
"https://Stackoverflow.com/questions/37208644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6325555/"
] | For god sake, protect your query against SQL injection :
```
$sql = "DELETE from utilisateur where pseudo = '".mysqli_real_escape_string($con, $pseudo)."'";
``` |
49,240,739 | I wanted to export data from *netezza database* to *CSV* file.
The format for the data will be:
```
col1,col2,col3
```
OR:
```
"col1","col2","col3"
```
I am using the query:
```
CREATE EXTERNAL TABLE 'H:\\test.csv' USING ( DELIMITER ',' REMOTESOURCE 'ODBC' ) AS
SELECT * FROM TEST_TABLE
```
Above query is not... | 2018/03/12 | [
"https://Stackoverflow.com/questions/49240739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3863192/"
] | Desired output can be achieved by using nzsql command line statement.The only limitation of this approach is max file will limit to **2 GB** .Here is the link from IBM KB [Sending query results to an output file](http://www-01.ibm.com/support/docview.wss?crawler=1&uid=swg21567479)
```
[nz@netezza ~]$ nzsql -d test -A ... |
70,444,674 | Hey all so I'll keep it short. I know there've been some questions asked similar to this but none of them are able to answer what I'm trying to achieve. This is what I want the code to do:
* Show a div when forward slash "/" is typed in textarea
* Not show a div when forward slash is not typed
* hide the pop up when t... | 2021/12/22 | [
"https://Stackoverflow.com/questions/70444674",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16663406/"
] | I think the problem is a combination of Stencil's tree-shakable API and a problem with its build-time analysis of dynamic imports.
Stencil tries to ship as little "Stencil" code as possible, so it will analyze your project to find out which features you're actually using and only include those in the final bundle. If ... |
19,767,553 | I am using a `UIAlertView` to prompt users for a password. If the password is correct, I'd like the alert view to go away normally; if the password is incorrect, I'd like the alert view to remain (with the text changed to something like "Please try again."). How do I alter the default behaviour so that the view doesn't... | 2013/11/04 | [
"https://Stackoverflow.com/questions/19767553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1781058/"
] | You could design a **UIView** similar to the alertview and can cal the functions inside this. Removing a UIView is controlled by you. |
4,229,732 | initially, my textarea has a value of Enter Comment... set via `<textarea>Enter Comment...</textarea>`
I have a .focus like:
`$("textarea.commentTextArea").live('focus', function() {
if($(this).val() == "Enter Comment...") {
$(this).val('');
}
});`
and a .blur() like:
`$("textarea.commentTextArea").live('blur', ... | 2010/11/19 | [
"https://Stackoverflow.com/questions/4229732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/409993/"
] | You don't have quotes around the word 'textarea' in the second statement. Also, your focus event will delete anything the user entered if they return to the textarea to edit again.
do this to solve the second problem (same trick you used on the blur event):
```
$("textarea").focus(function() { if ($(this).val() == 'E... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.