qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
844,384
I'm new to administering Windows Servers and have just been attempting to migrate AD, DHCP, DNS, roles from an old server to a new Windows Server 2016 box, and then retire the old server. All seems to have gone ok in the end, although I may have made some mistakes along the way including not transferring the FSMO role...
2017/04/13
[ "https://serverfault.com/questions/844384", "https://serverfault.com", "https://serverfault.com/users/327102/" ]
After some good help from the other replies and some more googling, I solved the problem by editing the registry... Edit this key to point to the correct DC Server (as per [this](https://social.msdn.microsoft.com/Forums/vstudio/en-US/e6e579f2-3392-4173-905e-0affd07494ac/integrate-ms-o365-with-essentials-2012-r2-failur...
In your situation you can treat your old server as a primary DC that has failed. Luckily this wasn't your only DC as you had the new server as a backup DC! (Please keep it that way!) It is possible to transfer or seize FSMO roles to another domain controller with `ntdsutil.exe`. As you should be really careful when d...
844,384
I'm new to administering Windows Servers and have just been attempting to migrate AD, DHCP, DNS, roles from an old server to a new Windows Server 2016 box, and then retire the old server. All seems to have gone ok in the end, although I may have made some mistakes along the way including not transferring the FSMO role...
2017/04/13
[ "https://serverfault.com/questions/844384", "https://serverfault.com", "https://serverfault.com/users/327102/" ]
After some good help from the other replies and some more googling, I solved the problem by editing the registry... Edit this key to point to the correct DC Server (as per [this](https://social.msdn.microsoft.com/Forums/vstudio/en-US/e6e579f2-3392-4173-905e-0affd07494ac/integrate-ms-o365-with-essentials-2012-r2-failur...
What did you do to "retire" the old server? Since you said you seized the roles, I'm assuming you didn't properly replicate then move the roles over and then eventually DCPROMO the old DC to remove it as a DC. In that situation, AD still thinks the old DC is "around". The good thing is that as of Windows Server 2008 ...
35,010
I remember reading that Catholic missionaries in old [Oregon Country](https://en.wikipedia.org/wiki/Oregon_Country) made more converts per capita than Protestant missionaries, besides being in general better-received by the Native Americans. What advantages did the Catholic missionaries in the Northwest have over Pro...
2017/01/18
[ "https://history.stackexchange.com/questions/35010", "https://history.stackexchange.com", "https://history.stackexchange.com/users/21981/" ]
Catholic missionaries possessed a number of distinct advantages over the Protestants. First, they were well-trained, ordained priests, not merely well-meaning laymen, as many Protestants were. Unlike family men, they were free to travel about, to live among Indians, then among white settlers, then to move on again. The...
There is a fairly long account of Catholic and Protestant missionary activity to the Indians of Maine in Lord, R. H., Sexton, J. E., & Harrington, E. T. (1944). History of the Archdiocese of Boston In the Various Stages of Its Development 1604 to 1943, New York: Sheed & Ward. This history is in three volumes; as I reca...
35,010
I remember reading that Catholic missionaries in old [Oregon Country](https://en.wikipedia.org/wiki/Oregon_Country) made more converts per capita than Protestant missionaries, besides being in general better-received by the Native Americans. What advantages did the Catholic missionaries in the Northwest have over Pro...
2017/01/18
[ "https://history.stackexchange.com/questions/35010", "https://history.stackexchange.com", "https://history.stackexchange.com/users/21981/" ]
[George A. Strieby](https://history.stackexchange.com/questions/35010/what-advantages-did-catholic-missionaries-to-the-indians-have-over-protestant-mi) gives an excellent answer of which I would like to expand on it a little. Most Jesuits missionaries shared in the daily life of the Indians, travelling with them as th...
There is a fairly long account of Catholic and Protestant missionary activity to the Indians of Maine in Lord, R. H., Sexton, J. E., & Harrington, E. T. (1944). History of the Archdiocese of Boston In the Various Stages of Its Development 1604 to 1943, New York: Sheed & Ward. This history is in three volumes; as I reca...
114,423
I would like to find all directional derivatives of the function $$f(x,y) = (3x^4 + y^4)^{1/4} , $$ (where $ (x,y) \in \mathbb{R}^2 $), in the point $(0,0)$. I tried to do this by calculating $$\nabla f(x,y) = f\_1 (x,y) e\_1 + f\_2 (x,y) e\_2 $$, where $e\_n$ is the $n$'th unit vector and $f\_n$ is the partial derivat...
2012/02/28
[ "https://math.stackexchange.com/questions/114423", "https://math.stackexchange.com", "https://math.stackexchange.com/users/53283/" ]
The intersection of the graph of $f$ with the plane $y=mx$ is the graph of the equation $y=(3+m^4)^{1/4}|x|$ (sketched in the plane $y=mx$). The directional derivative of $f$ at $(0,0)$ in the "direction of the plane" is the derivative of $y=(3+m^4)^{1/4}|x|$ evaluated at $0$ (or it's negative). But this derivative doe...
When you look at $(x^4)^{1/4}$, you see that this is not differentiable at $x=0$. So I don't think that you can get a directional derivative at $(0,0)$ in your case.
114,423
I would like to find all directional derivatives of the function $$f(x,y) = (3x^4 + y^4)^{1/4} , $$ (where $ (x,y) \in \mathbb{R}^2 $), in the point $(0,0)$. I tried to do this by calculating $$\nabla f(x,y) = f\_1 (x,y) e\_1 + f\_2 (x,y) e\_2 $$, where $e\_n$ is the $n$'th unit vector and $f\_n$ is the partial derivat...
2012/02/28
[ "https://math.stackexchange.com/questions/114423", "https://math.stackexchange.com", "https://math.stackexchange.com/users/53283/" ]
The origin is a very special point for this function. In particular, the partial derivatives there are of no help. Therefore we should go at these directional derivatives in the intuitive geometric sense; i.e. we should look at $${f(r\cos\phi, r\sin\phi)-f(0,0)\over r}=\root 4 \of {3 \cos^4\phi+\sin^4\phi}\ =: g(\phi)$...
When you look at $(x^4)^{1/4}$, you see that this is not differentiable at $x=0$. So I don't think that you can get a directional derivative at $(0,0)$ in your case.
114,423
I would like to find all directional derivatives of the function $$f(x,y) = (3x^4 + y^4)^{1/4} , $$ (where $ (x,y) \in \mathbb{R}^2 $), in the point $(0,0)$. I tried to do this by calculating $$\nabla f(x,y) = f\_1 (x,y) e\_1 + f\_2 (x,y) e\_2 $$, where $e\_n$ is the $n$'th unit vector and $f\_n$ is the partial derivat...
2012/02/28
[ "https://math.stackexchange.com/questions/114423", "https://math.stackexchange.com", "https://math.stackexchange.com/users/53283/" ]
The intersection of the graph of $f$ with the plane $y=mx$ is the graph of the equation $y=(3+m^4)^{1/4}|x|$ (sketched in the plane $y=mx$). The directional derivative of $f$ at $(0,0)$ in the "direction of the plane" is the derivative of $y=(3+m^4)^{1/4}|x|$ evaluated at $0$ (or it's negative). But this derivative doe...
The origin is a very special point for this function. In particular, the partial derivatives there are of no help. Therefore we should go at these directional derivatives in the intuitive geometric sense; i.e. we should look at $${f(r\cos\phi, r\sin\phi)-f(0,0)\over r}=\root 4 \of {3 \cos^4\phi+\sin^4\phi}\ =: g(\phi)$...
12,753,768
If I have a string, for example, "ASDFBOB DESUDESUBOBADSF", how can I remove all mentions of "bob" turning the line into "ASDF DESUDESUADSF"? It would be a great help, thanks!
2012/10/05
[ "https://Stackoverflow.com/questions/12753768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1239203/" ]
> > What is the syntax for the order-by expression in the second format? > > > It doesn't exist. From the [orderby clause documentation](http://msdn.microsoft.com/en-us/library/bb383982.aspx): > > You can also specify a custom comparer. However, it is only available by using method-based syntax. > > > --- ...
> > How to use a custom comparer as shown in the first format. > > > You can't use a custom comparer in that format. > > Are there actual, formal names for the two Linq formats listed above? > > > Format 1 is Method syntax, Format 2 is "query syntax",
12,753,768
If I have a string, for example, "ASDFBOB DESUDESUBOBADSF", how can I remove all mentions of "bob" turning the line into "ASDF DESUDESUADSF"? It would be a great help, thanks!
2012/10/05
[ "https://Stackoverflow.com/questions/12753768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1239203/" ]
> > How to use a custom comparer as shown in the first format. > > > You can't use a custom comparer in that format. > > Are there actual, formal names for the two Linq formats listed above? > > > Format 1 is Method syntax, Format 2 is "query syntax",
**Question:** Thats not possible in the query syntax, because there are no overloads. **Not the question:** You can use a comparer with anonymous types only if you use reflection to compare the objects, it's better to use a typed implementation for comparing. If you don't want to create a typed implementation you c...
12,753,768
If I have a string, for example, "ASDFBOB DESUDESUBOBADSF", how can I remove all mentions of "bob" turning the line into "ASDF DESUDESUADSF"? It would be a great help, thanks!
2012/10/05
[ "https://Stackoverflow.com/questions/12753768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1239203/" ]
> > What is the syntax for the order-by expression in the second format? > > > It doesn't exist. From the [orderby clause documentation](http://msdn.microsoft.com/en-us/library/bb383982.aspx): > > You can also specify a custom comparer. However, it is only available by using method-based syntax. > > > --- ...
**Question:** Thats not possible in the query syntax, because there are no overloads. **Not the question:** You can use a comparer with anonymous types only if you use reflection to compare the objects, it's better to use a typed implementation for comparing. If you don't want to create a typed implementation you c...
12,753,768
If I have a string, for example, "ASDFBOB DESUDESUBOBADSF", how can I remove all mentions of "bob" turning the line into "ASDF DESUDESUADSF"? It would be a great help, thanks!
2012/10/05
[ "https://Stackoverflow.com/questions/12753768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1239203/" ]
> > What is the syntax for the order-by expression in the second format? > > > It doesn't exist. From the [orderby clause documentation](http://msdn.microsoft.com/en-us/library/bb383982.aspx): > > You can also specify a custom comparer. However, it is only available by using method-based syntax. > > > --- ...
This isn't necessarily answering the original question, but it somewhat extends some of the possibilities outlined. I am posting this in case others come across the similar problem. The solution posted here outlines a generic order by option that may be useful in other cases. In this example, I wanted to sort a file li...
12,753,768
If I have a string, for example, "ASDFBOB DESUDESUBOBADSF", how can I remove all mentions of "bob" turning the line into "ASDF DESUDESUADSF"? It would be a great help, thanks!
2012/10/05
[ "https://Stackoverflow.com/questions/12753768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1239203/" ]
This isn't necessarily answering the original question, but it somewhat extends some of the possibilities outlined. I am posting this in case others come across the similar problem. The solution posted here outlines a generic order by option that may be useful in other cases. In this example, I wanted to sort a file li...
**Question:** Thats not possible in the query syntax, because there are no overloads. **Not the question:** You can use a comparer with anonymous types only if you use reflection to compare the objects, it's better to use a typed implementation for comparing. If you don't want to create a typed implementation you c...
51,579,267
I am at the very beginning of learning C. I am trying to write a function to open a file, read a `BUFFER_SIZE`, store the content in an array, then track the character `'\n'` (because I want to get each line of the input). when I set the `BUFFER_SIZE` very large, I can get the first line. when I set the `BUFFER_SIZE`...
2018/07/29
[ "https://Stackoverflow.com/questions/51579267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5672673/" ]
> > what is fsanitizer=address flag? > > > Usually C compiler doesn't add boundaries check for memory access. Sometimes due to code error, there is read or write from outside the buffer, such an error is usually hard to detect. Using this flag the compiler add some boundaries check, to ensure you won't use a buffe...
In simple words it is segmentation fault with the variable created using new keyword as all that goes into heap area of memory. **Explanation** - you are trying to access such an address for which you haven't declared your variable, to find all such errors revisit all your conditions and check if you are accessing som...
51,579,267
I am at the very beginning of learning C. I am trying to write a function to open a file, read a `BUFFER_SIZE`, store the content in an array, then track the character `'\n'` (because I want to get each line of the input). when I set the `BUFFER_SIZE` very large, I can get the first line. when I set the `BUFFER_SIZE`...
2018/07/29
[ "https://Stackoverflow.com/questions/51579267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5672673/" ]
> > what is fsanitizer=address flag? > > > Usually C compiler doesn't add boundaries check for memory access. Sometimes due to code error, there is read or write from outside the buffer, such an error is usually hard to detect. Using this flag the compiler add some boundaries check, to ensure you won't use a buffe...
This can also be rectified by making fast input output by:- //For FAST I/O ``` **ios_base::sync_with_stdio(false); cin.tie(NULL);** ```
51,579,267
I am at the very beginning of learning C. I am trying to write a function to open a file, read a `BUFFER_SIZE`, store the content in an array, then track the character `'\n'` (because I want to get each line of the input). when I set the `BUFFER_SIZE` very large, I can get the first line. when I set the `BUFFER_SIZE`...
2018/07/29
[ "https://Stackoverflow.com/questions/51579267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5672673/" ]
In simple words it is segmentation fault with the variable created using new keyword as all that goes into heap area of memory. **Explanation** - you are trying to access such an address for which you haven't declared your variable, to find all such errors revisit all your conditions and check if you are accessing som...
This can also be rectified by making fast input output by:- //For FAST I/O ``` **ios_base::sync_with_stdio(false); cin.tie(NULL);** ```
49,771,188
So I have done some digging around and cannot seem to find an answer to my question. Basically, I want to be able to extract which months Fall within a given Quarter. the Given quarter is automatically provided by using the > > "=ROUNDUP(MONTH(date)/3,0)" > > > formula. Now what i want is in 3 other cells the ...
2018/04/11
[ "https://Stackoverflow.com/questions/49771188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5525436/" ]
You just need to add this tag at the button of your body your `<body>`. ``` <script src="https://use.fontawesome.com/releases/v5.0.10/js/all.js</script> ``` > > FontAwesome is a Javascript file, not a CSS. It needs to be loaded > after the DOM. > > > ```css .icon-color { color: #3b5998; } ``` ```html <he...
You need to include: `<script defer src="https://use.fontawesome.com/releases/v5.0.10/js/all.js" integrity="sha384-slN8GvtUJGnv6ca26v8EzVaR9DC58QEwsIk9q1QXdCU8Yu8ck/tL/5szYlBbqmS+" crossorigin="anonymous"></script>` in your `<head>`
49,771,188
So I have done some digging around and cannot seem to find an answer to my question. Basically, I want to be able to extract which months Fall within a given Quarter. the Given quarter is automatically provided by using the > > "=ROUNDUP(MONTH(date)/3,0)" > > > formula. Now what i want is in 3 other cells the ...
2018/04/11
[ "https://Stackoverflow.com/questions/49771188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5525436/" ]
You just need to add this tag at the button of your body your `<body>`. ``` <script src="https://use.fontawesome.com/releases/v5.0.10/js/all.js</script> ``` > > FontAwesome is a Javascript file, not a CSS. It needs to be loaded > after the DOM. > > > ```css .icon-color { color: #3b5998; } ``` ```html <he...
You need to write `<i class="fa fa-facebook-f" style="color:white"></i>` **fa** is written as **fab** Thank you.
49,771,188
So I have done some digging around and cannot seem to find an answer to my question. Basically, I want to be able to extract which months Fall within a given Quarter. the Given quarter is automatically provided by using the > > "=ROUNDUP(MONTH(date)/3,0)" > > > formula. Now what i want is in 3 other cells the ...
2018/04/11
[ "https://Stackoverflow.com/questions/49771188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5525436/" ]
You just need to add this tag at the button of your body your `<body>`. ``` <script src="https://use.fontawesome.com/releases/v5.0.10/js/all.js</script> ``` > > FontAwesome is a Javascript file, not a CSS. It needs to be loaded > after the DOM. > > > ```css .icon-color { color: #3b5998; } ``` ```html <he...
move the fontawesome-all.js into your project directory, to avoid path errors. and add this into your code to load the js files. ``` <head> <!--load everything--> <script defer src="/static/fontawesome/fontawesome-all.js"></script> </head> ``` then you can start placing icons in your HTML's `<body>`
28,250,857
I want to start with a DetailViewController, not a Table View. ![enter image description here](https://i.stack.imgur.com/oPS9W.png) 1. So, first I create a Master-Detail Application. ![enter image description here](https://i.stack.imgur.com/IPa3W.png) 2. Then, I remove the Segue ![enter image description here](htt...
2015/01/31
[ "https://Stackoverflow.com/questions/28250857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/898307/" ]
Here is my code snippet for drawing debugNode for physics space. However it is written in js for Cocos2d-x-js, I hope it will help. ``` function initDebugMode(controller) { var phDebugNode = cc.PhysicsDebugNode.create(space); controller.addChild(phDebugNode, 10); } ```
create your scene using below code ``` auto scene = Scene::createWithPhysics(); ``` then go ahead and add features to your scene scene->getPhysicsWorld()->setDebugDrawMask(PhysicsWorld::DEBUGDRAW\_ALL); Hope this helps
41,916,857
When I try to list my gpg keys I'm getting an error: ``` gpg --list-keys gpg: NOTE: trustdb not writable gpg: checking the trustdb gpg: trustdb rec 56: write failed (n=-1): Bad file descriptor gpg: trustdb: sync failed: Bad file descriptor ``` I tried doing a recursive chown on my user directory. But that didn't see...
2017/01/29
[ "https://Stackoverflow.com/questions/41916857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1017466/" ]
That seems to have been reported in [bug 771976](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771976) > > I found this when running the command `apt-key list` on a machine where > the root filesystem is normally mounted read-only. > > This results in running `gpg` with "`--trustdb-name`", "`/etc/apt//trustd...
I granted the permissions on the trustdb.gpg file present in the installation directory in C Drive, to the user I had logged on with. It worked thereafter.
151,308
I've got a drupal structure that I'm trying to set up for hospitality venues so it has information like opening hours, and what is going on at those times. E.g. At Joe's Burgers between 9-5 Monday-Thursday it is a restaurant, but from 9-5 Friday-Saturday it's a nightclub. I've got fields of venue name, opening hours, ...
2015/03/11
[ "https://drupal.stackexchange.com/questions/151308", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/44916/" ]
You could use [Field Collection](https://www.drupal.org/project/field_collection) to set up a field that contains both a category and a date as one unit. Then all you would need to do is set the field collection to allow multiple values. ![enter image description here](https://i.stack.imgur.com/uwJCu.png)
Do you need to replicate an existing time collection, or do you just need to add more? If you just need more, [Field Collection](https://www.drupal.org/project/field_collection) will let you add multiple collections of fields. Each collection can have the fields you need: name, hours, category, etc
14,367,346
> > **Possible Duplicate:** > > [Why do I get different results when I dereference a pointer after freeing it?](https://stackoverflow.com/questions/1078677/why-do-i-get-different-results-when-i-dereference-a-pointer-after-freeing-it) > > > Tried it in case of characters as well, what it did that after 8 values...
2013/01/16
[ "https://Stackoverflow.com/questions/14367346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1985038/" ]
Here is one way of doing it, using the `row_number` function, one join, and on aggregation: ``` select c.*, min(o.purchase_date) as FirstPurchaseDate, min(case when seqnum = 1 then o.id_order end) as Last_IdOrder, min(case when seqnum = 1 then o.purchase_date end) as Last_PurchaseDate, min...
I'm confused by your field names, but I'm going to assume that ORDER.id is the id in the CUSTOMER table. The earliest order date is easy. ``` select CUSTOMER.*, min(ORDER.purchase_date) from CUSTOMER inner join ORDER on CUSTOMER.id = ORDER.id group by CUSTOMER.* ``` To get the last order data, join this to the OR...
14,367,346
> > **Possible Duplicate:** > > [Why do I get different results when I dereference a pointer after freeing it?](https://stackoverflow.com/questions/1078677/why-do-i-get-different-results-when-i-dereference-a-pointer-after-freeing-it) > > > Tried it in case of characters as well, what it did that after 8 values...
2013/01/16
[ "https://Stackoverflow.com/questions/14367346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1985038/" ]
It's not obvious how to join the `customer` table to the `orders` table (`order` is a reserved word in Oracle so your table can't be named `order`). If we assume that the `id_order` in `orders` joins to the `id` in `customer` ``` SELECT c.id customer_id, c.name name, c.subscribe_date, o.first_purc...
I'm confused by your field names, but I'm going to assume that ORDER.id is the id in the CUSTOMER table. The earliest order date is easy. ``` select CUSTOMER.*, min(ORDER.purchase_date) from CUSTOMER inner join ORDER on CUSTOMER.id = ORDER.id group by CUSTOMER.* ``` To get the last order data, join this to the OR...
14,367,346
> > **Possible Duplicate:** > > [Why do I get different results when I dereference a pointer after freeing it?](https://stackoverflow.com/questions/1078677/why-do-i-get-different-results-when-i-dereference-a-pointer-after-freeing-it) > > > Tried it in case of characters as well, what it did that after 8 values...
2013/01/16
[ "https://Stackoverflow.com/questions/14367346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1985038/" ]
Here is one way of doing it, using the `row_number` function, one join, and on aggregation: ``` select c.*, min(o.purchase_date) as FirstPurchaseDate, min(case when seqnum = 1 then o.id_order end) as Last_IdOrder, min(case when seqnum = 1 then o.purchase_date end) as Last_PurchaseDate, min...
Maybe something like this assuming the `ID` field in the `Order` table is actually the `Customer ID`: ``` SELECT C.*, O1.*, O2.purchase_Date as FirstPurchaseDate FROM Customer C LEFT JOIN ( SELECT Max(purchase_date) as pdate, id FROM Orders GROUP BY id ) MaxPurchaseOrder ON C.Id = MaxPurchaseOrder.Id LEFT JO...
14,367,346
> > **Possible Duplicate:** > > [Why do I get different results when I dereference a pointer after freeing it?](https://stackoverflow.com/questions/1078677/why-do-i-get-different-results-when-i-dereference-a-pointer-after-freeing-it) > > > Tried it in case of characters as well, what it did that after 8 values...
2013/01/16
[ "https://Stackoverflow.com/questions/14367346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1985038/" ]
It's not obvious how to join the `customer` table to the `orders` table (`order` is a reserved word in Oracle so your table can't be named `order`). If we assume that the `id_order` in `orders` joins to the `id` in `customer` ``` SELECT c.id customer_id, c.name name, c.subscribe_date, o.first_purc...
Maybe something like this assuming the `ID` field in the `Order` table is actually the `Customer ID`: ``` SELECT C.*, O1.*, O2.purchase_Date as FirstPurchaseDate FROM Customer C LEFT JOIN ( SELECT Max(purchase_date) as pdate, id FROM Orders GROUP BY id ) MaxPurchaseOrder ON C.Id = MaxPurchaseOrder.Id LEFT JO...
68,085
> > **Possible Duplicate:** > > [How display LaTeX code in LaTeX document?](https://tex.stackexchange.com/questions/4095/how-display-latex-code-in-latex-document) > > [How do I fit java style source code in one frame in beamer?](https://tex.stackexchange.com/questions/58092/how-do-i-fit-java-style-source-code-in...
2012/08/21
[ "https://tex.stackexchange.com/questions/68085", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/17858/" ]
Use the package [listings](http://www.ctan.org/pkg/listings) or [minted](http://www.ctan.org/pkg/minted). Listings is easier to install, as minted needs python, it uses `pygments`, but often produces nicer results. Also you need to use the `fragile` option on your `frame`, so the content of the frame gets writen to an ...
You can define the verbatim part before the `frame` environment then you do not need the `fragile` option. ``` \documentclass{beamer} \usepackage{listings} \begin{document} \defverbatim[colored]\lstI{ \begin{lstlisting}[language=C++,basicstyle=\ttfamily,keywordstyle=\color{red}] int main() { // Define variables at...
68,085
> > **Possible Duplicate:** > > [How display LaTeX code in LaTeX document?](https://tex.stackexchange.com/questions/4095/how-display-latex-code-in-latex-document) > > [How do I fit java style source code in one frame in beamer?](https://tex.stackexchange.com/questions/58092/how-do-i-fit-java-style-source-code-in...
2012/08/21
[ "https://tex.stackexchange.com/questions/68085", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/17858/" ]
Use the package [listings](http://www.ctan.org/pkg/listings) or [minted](http://www.ctan.org/pkg/minted). Listings is easier to install, as minted needs python, it uses `pygments`, but often produces nicer results. Also you need to use the `fragile` option on your `frame`, so the content of the frame gets writen to an ...
Another option is [PythonTeX](https://github.com/gpoore/pythontex), specifically the `\pygment` command and the `pygments` environment. Like minted, PythonTeX requires Python and Pygments. The highlighted results are saved, so you only need to run Python when you have modified the code that needs highlighting. Unicode ...
68,085
> > **Possible Duplicate:** > > [How display LaTeX code in LaTeX document?](https://tex.stackexchange.com/questions/4095/how-display-latex-code-in-latex-document) > > [How do I fit java style source code in one frame in beamer?](https://tex.stackexchange.com/questions/58092/how-do-i-fit-java-style-source-code-in...
2012/08/21
[ "https://tex.stackexchange.com/questions/68085", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/17858/" ]
You can define the verbatim part before the `frame` environment then you do not need the `fragile` option. ``` \documentclass{beamer} \usepackage{listings} \begin{document} \defverbatim[colored]\lstI{ \begin{lstlisting}[language=C++,basicstyle=\ttfamily,keywordstyle=\color{red}] int main() { // Define variables at...
Another option is [PythonTeX](https://github.com/gpoore/pythontex), specifically the `\pygment` command and the `pygments` environment. Like minted, PythonTeX requires Python and Pygments. The highlighted results are saved, so you only need to run Python when you have modified the code that needs highlighting. Unicode ...
35,140,498
I am reading a line from a file and I do not know the length it is going to be. I know there are ways to do this with pointers but I am specifically asking for just a plan char string. For Example if I initialize the string like this: ``` char string[300]; //(or bigger) ``` Will having large string values like this...
2016/02/01
[ "https://Stackoverflow.com/questions/35140498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5565459/" ]
> > char string[300]; //(or bigger) > > > I am not sure which of the two issues you are concerned with, so I will try to address both below: * if the string in the file is larger than 300 bytes and you try to "stick" that string in that buffer, without accounting the max length of your array -you will get undefin...
Any hard coded number is potentially too small to read the contents of a file. It's best to compute the size at run time, allocate memory for the contents, and then read the contents. See [Read file contents with unknown size](https://stackoverflow.com/questions/5925545/read-file-contents-with-unknown-size).
35,140,498
I am reading a line from a file and I do not know the length it is going to be. I know there are ways to do this with pointers but I am specifically asking for just a plan char string. For Example if I initialize the string like this: ``` char string[300]; //(or bigger) ``` Will having large string values like this...
2016/02/01
[ "https://Stackoverflow.com/questions/35140498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5565459/" ]
Any hard coded number is potentially too small to read the contents of a file. It's best to compute the size at run time, allocate memory for the contents, and then read the contents. See [Read file contents with unknown size](https://stackoverflow.com/questions/5925545/read-file-contents-with-unknown-size).
> > Will having large string values like this be a problem? > > > Absolutely. If your application must read the entire line from a file before processing it, then you have two options. 1) Allocate buffer large enough to hold the line of maximum allowed length. For example, the SMTP protocol does not allow lines ...
35,140,498
I am reading a line from a file and I do not know the length it is going to be. I know there are ways to do this with pointers but I am specifically asking for just a plan char string. For Example if I initialize the string like this: ``` char string[300]; //(or bigger) ``` Will having large string values like this...
2016/02/01
[ "https://Stackoverflow.com/questions/35140498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5565459/" ]
Any hard coded number is potentially too small to read the contents of a file. It's best to compute the size at run time, allocate memory for the contents, and then read the contents. See [Read file contents with unknown size](https://stackoverflow.com/questions/5925545/read-file-contents-with-unknown-size).
It all depends on how you read the line. For example: ``` char string[300]; FILE* fp = fopen(filename, "r"); //Error checking omitted fgets(string, 300, fp); ``` Taken from tutorialspoint.com > > The C library function char \*fgets(char \*str, int n, FILE \*stream) reads a line from the specified stream and stores...
35,140,498
I am reading a line from a file and I do not know the length it is going to be. I know there are ways to do this with pointers but I am specifically asking for just a plan char string. For Example if I initialize the string like this: ``` char string[300]; //(or bigger) ``` Will having large string values like this...
2016/02/01
[ "https://Stackoverflow.com/questions/35140498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5565459/" ]
> > char string[300]; //(or bigger) > > > I am not sure which of the two issues you are concerned with, so I will try to address both below: * if the string in the file is larger than 300 bytes and you try to "stick" that string in that buffer, without accounting the max length of your array -you will get undefin...
> > Will having large string values like this be a problem? > > > Absolutely. If your application must read the entire line from a file before processing it, then you have two options. 1) Allocate buffer large enough to hold the line of maximum allowed length. For example, the SMTP protocol does not allow lines ...
35,140,498
I am reading a line from a file and I do not know the length it is going to be. I know there are ways to do this with pointers but I am specifically asking for just a plan char string. For Example if I initialize the string like this: ``` char string[300]; //(or bigger) ``` Will having large string values like this...
2016/02/01
[ "https://Stackoverflow.com/questions/35140498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5565459/" ]
> > char string[300]; //(or bigger) > > > I am not sure which of the two issues you are concerned with, so I will try to address both below: * if the string in the file is larger than 300 bytes and you try to "stick" that string in that buffer, without accounting the max length of your array -you will get undefin...
It all depends on how you read the line. For example: ``` char string[300]; FILE* fp = fopen(filename, "r"); //Error checking omitted fgets(string, 300, fp); ``` Taken from tutorialspoint.com > > The C library function char \*fgets(char \*str, int n, FILE \*stream) reads a line from the specified stream and stores...
68,068,196
Given a large markdown file with a structure like: ``` # Main ## Sub main Z ### Title Z Content Z ### Title B Content B ## Sub main A ### Title A Content A ``` How would one sort its sections so that they are in alphabetical order by heading? ``` # Main ## Sub main A ### Title A Content A ## Sub main Z ### Titl...
2021/06/21
[ "https://Stackoverflow.com/questions/68068196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5894542/" ]
I don't think there is any solution that does not require you to write some code. But the programmatic solution is pretty easy if you can code: 1. Parse the Markdown into an AST (abstract syntax tree). 2. Manipulate the AST, reordering nodes as you want. 3. Write the modified AST back to Markdown. The trick is choos...
I tried to use `pandoc`, but in step from AST to markdown was lost many formatting like `new line` and etc. I found another way to do that. We need only `MS Word`. 1. Open markdown file thought `Word` 2. Create new macro with the next code. We find all headers (`#`) and apply style `Title 1`, `Title 2` and so on. Cha...
59,202,231
Currently I'm using inner joins to join a table against itself multiple times to transform a table from multiple rows per ID to one row per ID. I'm running into performance issues , as I'm joining a relatively large table against itself 6 times on a slow server. Here's a simplified example of the query I'm currently u...
2019/12/05
[ "https://Stackoverflow.com/questions/59202231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12487357/" ]
Try: ``` select 11037 id, 'area' as propname , 'ABC' as value into #tmp union select 11037 , 'reason' , 'short' union select 11037 , 'maincause' , 'electrical' union select 11037 , 'report' , 'yes' union select 7539 , 'area' , 'DEF' union ...
I would do something like this: ``` select t.id ,max(t.area) as area ,max(t.reason) as reason ,max(t.report) as report from ( select t.id ,case when t.propname = 'area' then t.value else null end as area ,case when t.propname = 'reason' then t.value else null end as reason ,case when t.propname = 'report' then t....
7,182,846
I'm trying very hard to attach a scrollTo inside an accordion, but it seems, if the the former works the latter stop working, vice versa. Here's what I want to achieve, <http://www.ge-energy.com/> and here's my code that I wrote for this <http://jsfiddle.net/ztFWv/51/> What should I do?
2011/08/24
[ "https://Stackoverflow.com/questions/7182846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/910744/" ]
I hope that this helps someone. It took me a while to figure it out for myself. The trick is to override toString in your enum. The code for your states enum would be: ``` public enum States{ AL("Alabama"), AK("Alaska"), AR("Arkansas"), AZ("Arizona"), CA("California"), CO("Colorado"), ... (etc.); ...
Add an enum constructor like so... then replace States.values() with States.fullName() ``` public enum States{ AL("Alabama"), AK("Alaska"), ... (etc.) private String fullName; States(String fullName) { this.fullName = fullName; } public String fullName() { return fullName; }...
7,182,846
I'm trying very hard to attach a scrollTo inside an accordion, but it seems, if the the former works the latter stop working, vice versa. Here's what I want to achieve, <http://www.ge-energy.com/> and here's my code that I wrote for this <http://jsfiddle.net/ztFWv/51/> What should I do?
2011/08/24
[ "https://Stackoverflow.com/questions/7182846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/910744/" ]
Let's try to provide the answer with the help of an example ``` public enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY } ``` Consider the above enum. Now you can add it to an adapter in the following ways: Method 1: ``` ArrayAdapter<Day> adapter = new ArrayAdapter<Day>(activity, android....
Add an enum constructor like so... then replace States.values() with States.fullName() ``` public enum States{ AL("Alabama"), AK("Alaska"), ... (etc.) private String fullName; States(String fullName) { this.fullName = fullName; } public String fullName() { return fullName; }...
7,182,846
I'm trying very hard to attach a scrollTo inside an accordion, but it seems, if the the former works the latter stop working, vice versa. Here's what I want to achieve, <http://www.ge-energy.com/> and here's my code that I wrote for this <http://jsfiddle.net/ztFWv/51/> What should I do?
2011/08/24
[ "https://Stackoverflow.com/questions/7182846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/910744/" ]
Here is how to do it using Kotlin and Material **TextInputLayout** which can be used as Spinner replacement, first implement it like described in this answer: <https://stackoverflow.com/a/57746352/2472350> first define the enum like this: ``` enum class States(val label: String) { AL("Alabama"), AK("Alaska")...
Add an enum constructor like so... then replace States.values() with States.fullName() ``` public enum States{ AL("Alabama"), AK("Alaska"), ... (etc.) private String fullName; States(String fullName) { this.fullName = fullName; } public String fullName() { return fullName; }...
7,182,846
I'm trying very hard to attach a scrollTo inside an accordion, but it seems, if the the former works the latter stop working, vice versa. Here's what I want to achieve, <http://www.ge-energy.com/> and here's my code that I wrote for this <http://jsfiddle.net/ztFWv/51/> What should I do?
2011/08/24
[ "https://Stackoverflow.com/questions/7182846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/910744/" ]
I hope that this helps someone. It took me a while to figure it out for myself. The trick is to override toString in your enum. The code for your states enum would be: ``` public enum States{ AL("Alabama"), AK("Alaska"), AR("Arkansas"), AZ("Arizona"), CA("California"), CO("Colorado"), ... (etc.); ...
maybe you could try overriding the toString() function as shown here [here](http://javahowto.blogspot.com/2006/10/custom-string-values-for-enum.html) . I haven't tried it yet but I was just about to.
7,182,846
I'm trying very hard to attach a scrollTo inside an accordion, but it seems, if the the former works the latter stop working, vice versa. Here's what I want to achieve, <http://www.ge-energy.com/> and here's my code that I wrote for this <http://jsfiddle.net/ztFWv/51/> What should I do?
2011/08/24
[ "https://Stackoverflow.com/questions/7182846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/910744/" ]
Let's try to provide the answer with the help of an example ``` public enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY } ``` Consider the above enum. Now you can add it to an adapter in the following ways: Method 1: ``` ArrayAdapter<Day> adapter = new ArrayAdapter<Day>(activity, android....
maybe you could try overriding the toString() function as shown here [here](http://javahowto.blogspot.com/2006/10/custom-string-values-for-enum.html) . I haven't tried it yet but I was just about to.
7,182,846
I'm trying very hard to attach a scrollTo inside an accordion, but it seems, if the the former works the latter stop working, vice versa. Here's what I want to achieve, <http://www.ge-energy.com/> and here's my code that I wrote for this <http://jsfiddle.net/ztFWv/51/> What should I do?
2011/08/24
[ "https://Stackoverflow.com/questions/7182846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/910744/" ]
Here is how to do it using Kotlin and Material **TextInputLayout** which can be used as Spinner replacement, first implement it like described in this answer: <https://stackoverflow.com/a/57746352/2472350> first define the enum like this: ``` enum class States(val label: String) { AL("Alabama"), AK("Alaska")...
maybe you could try overriding the toString() function as shown here [here](http://javahowto.blogspot.com/2006/10/custom-string-values-for-enum.html) . I haven't tried it yet but I was just about to.
7,182,846
I'm trying very hard to attach a scrollTo inside an accordion, but it seems, if the the former works the latter stop working, vice versa. Here's what I want to achieve, <http://www.ge-energy.com/> and here's my code that I wrote for this <http://jsfiddle.net/ztFWv/51/> What should I do?
2011/08/24
[ "https://Stackoverflow.com/questions/7182846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/910744/" ]
I hope that this helps someone. It took me a while to figure it out for myself. The trick is to override toString in your enum. The code for your states enum would be: ``` public enum States{ AL("Alabama"), AK("Alaska"), AR("Arkansas"), AZ("Arizona"), CA("California"), CO("Colorado"), ... (etc.); ...
Let's try to provide the answer with the help of an example ``` public enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY } ``` Consider the above enum. Now you can add it to an adapter in the following ways: Method 1: ``` ArrayAdapter<Day> adapter = new ArrayAdapter<Day>(activity, android....
7,182,846
I'm trying very hard to attach a scrollTo inside an accordion, but it seems, if the the former works the latter stop working, vice versa. Here's what I want to achieve, <http://www.ge-energy.com/> and here's my code that I wrote for this <http://jsfiddle.net/ztFWv/51/> What should I do?
2011/08/24
[ "https://Stackoverflow.com/questions/7182846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/910744/" ]
I hope that this helps someone. It took me a while to figure it out for myself. The trick is to override toString in your enum. The code for your states enum would be: ``` public enum States{ AL("Alabama"), AK("Alaska"), AR("Arkansas"), AZ("Arizona"), CA("California"), CO("Colorado"), ... (etc.); ...
Here is how to do it using Kotlin and Material **TextInputLayout** which can be used as Spinner replacement, first implement it like described in this answer: <https://stackoverflow.com/a/57746352/2472350> first define the enum like this: ``` enum class States(val label: String) { AL("Alabama"), AK("Alaska")...
69,828,532
I'm running a basic Spring App with Mockito 3.1.0 and and Junit 5.5.2. I have a Service call that includes two Spring Data JPA repositories. These are passed into the constructor for DI (along with two others that are immaterial – I'm including them in case they could also, potentially, cause errors.) I see no issues w...
2021/11/03
[ "https://Stackoverflow.com/questions/69828532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1925479/" ]
For anybody else who encounters this in the future, we were able to fix this problem by changing one of the imports from: ``` import org.junit.jupiter.api.Test; ``` to ``` import org.junit.Test; ``` Edit: * This had to do with differing versions of JUnit. There's a good long-form explanation as to why [here](htt...
Seems like your object `myService`, is not instantiated. I would suggest not use `@InjectMocks` and directly create your object as your repositories are already instantiated. `MyService myService = new MyService(..., ..., ...)`
69,828,532
I'm running a basic Spring App with Mockito 3.1.0 and and Junit 5.5.2. I have a Service call that includes two Spring Data JPA repositories. These are passed into the constructor for DI (along with two others that are immaterial – I'm including them in case they could also, potentially, cause errors.) I see no issues w...
2021/11/03
[ "https://Stackoverflow.com/questions/69828532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1925479/" ]
For anybody else who encounters this in the future, we were able to fix this problem by changing one of the imports from: ``` import org.junit.jupiter.api.Test; ``` to ``` import org.junit.Test; ``` Edit: * This had to do with differing versions of JUnit. There's a good long-form explanation as to why [here](htt...
I suppose you have to annotate your test class with `@ExtendWith(SpringExtension.class)` and not with `MockitoExtension.class` More info here [Junit 5 with Spring Boot: When to use @ExtendWith Spring or Mockito?](https://stackoverflow.com/questions/61433806/junit-5-with-spring-boot-when-to-use-extendwith-spring-or-moc...
61,882,197
I'm trying to make an app that will help me with my workouts and help me constantly lift more so that I can get stronger. I keep getting the error "Cannot set inner property of null" on the very bottom when I try to output the variables to the HTML. It's the code under the last section of comments that I am getting the...
2020/05/19
[ "https://Stackoverflow.com/questions/61882197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5800367/" ]
The error is in the last two lines of this function. A function can only return one value, it might be worth putting all the values in an array and then returning it. ``` //Make a function that runs all the functions with the user input function getNewWorkout() { futureSet = getNewSet(parseInt(userSet)); ...
This kind of error comes when you load the script before DOM is ready. You can try to load the script at the end of the HTML, usually in footer. This should fix your error. Also, please call the function 'getNewWorkout()' in your script to get expected output.
17,073,012
I have 2 editText's and I want to handle both inputs with onTextChanged, can I do this with an array if so how, I dont see how I can do it without using arrays. OK, this is the update on what I have. ``` public class AlphaActivity extends Activity { private static final String TO_BOX = "TO_BOX"; private static fi...
2013/06/12
[ "https://Stackoverflow.com/questions/17073012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2045396/" ]
To accomplish what I think you are asking you can do the following, ``` editText1.addTextChangedListener(fromBoxListener) editText2.addTextChangedListener(fromBoxListener) ``` Now, the code in ``` @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-gen...
Have you tried moving your code to the `afterTextChanged()` method of your `TextWatcher`? External listeners get updated before the internal `Editor` of an `EditText` during the `onTextChanged()` phase, so your readings for `firstText.getText()` and `secondText.getText()` may not return the results you expect because ...
13,707,634
I saw [this question](https://stackoverflow.com/questions/5771868/how-to-allocate-memory-space-without-using-malloc-or-new-operator), but it simply illustrates what I want to do rather than explaining how to do it. I have a `C` library that will be run on systems that support dynamic memory allocation as well as syste...
2012/12/04
[ "https://Stackoverflow.com/questions/13707634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/651789/" ]
About the simplest allocator it's possible to write: * init: `current_position = my_memory + sizeof(my_memory)`. Depending on alignment requirements of your implementation, you might have to make sure `current_position` is correctly aligned. * allocate: `return ((current_position - my_memory) <= size) ? 0 : (current_p...
You can hold the address (in your case the offset in the array) to the next free block at the beginning of each allocation, i.e. you use some of your array to be the list of free blocks. This takes account of how you allocate and find memory blocks, free is trickier in that as you give back the memory you need to do mo...
13,707,634
I saw [this question](https://stackoverflow.com/questions/5771868/how-to-allocate-memory-space-without-using-malloc-or-new-operator), but it simply illustrates what I want to do rather than explaining how to do it. I have a `C` library that will be run on systems that support dynamic memory allocation as well as syste...
2012/12/04
[ "https://Stackoverflow.com/questions/13707634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/651789/" ]
About the simplest allocator it's possible to write: * init: `current_position = my_memory + sizeof(my_memory)`. Depending on alignment requirements of your implementation, you might have to make sure `current_position` is correctly aligned. * allocate: `return ((current_position - my_memory) <= size) ? 0 : (current_p...
An oldie but a goodie (for a blog post describing the problem): <http://g.oswego.edu/dl/html/malloc.html> Or if you're looking for something packaged: <http://hempeldesigngroup.com/embedded/stories/memorymanager/>
18,788,646
When I try to open a solution I'm getting this message > > The C# project "X" is targeting ".NETFramework, Version=v4.03", which is not installed on this machine > > > I installed the upgrade from [here](http://www.microsoft.com/en-us/download/details.aspx?id=29053) but that didn't fix the problem. I restarted th...
2013/09/13
[ "https://Stackoverflow.com/questions/18788646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/245860/" ]
You need to install the .NET Framework 4.0 SDK, which can be found [here](http://www.microsoft.com/en-us/download/details.aspx?id=8279). What you installed is the .NET 4.0 runtime, required for running .NET 4.0 applications as a client.
Try confirming what versions you have installed on your machine, i.e. go to C:\Windows\Microsoft.NET\Framework or the following on a 64bit machine: C:\Windows\Microsoft.NET\Framework64 do the underlying folders here in include v4.0.30319 (or similar)? Now what does the VS project contain as its target framework: ...
18,788,646
When I try to open a solution I'm getting this message > > The C# project "X" is targeting ".NETFramework, Version=v4.03", which is not installed on this machine > > > I installed the upgrade from [here](http://www.microsoft.com/en-us/download/details.aspx?id=29053) but that didn't fix the problem. I restarted th...
2013/09/13
[ "https://Stackoverflow.com/questions/18788646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/245860/" ]
This is resolved, I needed to install [Multi-Targeting Pack for Microsoft .NET Framework 4.0.3 (KB2600213)](http://www.microsoft.com/en-us/download/confirmation.aspx?id=29052))
Try confirming what versions you have installed on your machine, i.e. go to C:\Windows\Microsoft.NET\Framework or the following on a 64bit machine: C:\Windows\Microsoft.NET\Framework64 do the underlying folders here in include v4.0.30319 (or similar)? Now what does the VS project contain as its target framework: ...
18,788,646
When I try to open a solution I'm getting this message > > The C# project "X" is targeting ".NETFramework, Version=v4.03", which is not installed on this machine > > > I installed the upgrade from [here](http://www.microsoft.com/en-us/download/details.aspx?id=29053) but that didn't fix the problem. I restarted th...
2013/09/13
[ "https://Stackoverflow.com/questions/18788646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/245860/" ]
This is resolved, I needed to install [Multi-Targeting Pack for Microsoft .NET Framework 4.0.3 (KB2600213)](http://www.microsoft.com/en-us/download/confirmation.aspx?id=29052))
You need to install the .NET Framework 4.0 SDK, which can be found [here](http://www.microsoft.com/en-us/download/details.aspx?id=8279). What you installed is the .NET 4.0 runtime, required for running .NET 4.0 applications as a client.
25,854,371
I'm receiving an error message when i try to execute this code in order to set variables: ``` DECLARE @timenow DATETIME = GETDATE() ,@WEEKDAY nvarchar(10) = DATENAME(DW,GETDATE()) IF DATENAME(DW,GETDATE()) = 'MONDAY' DECLARE @Fecha_222 DATETIME SET @Fecha_222 = @timenow-3 ELSE SET @Fecha_222 = @ti...
2014/09/15
[ "https://Stackoverflow.com/questions/25854371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4043623/" ]
You had three problems: 1) You had the declaration in one half of an if referenced in the other. 2) You had multiple lines of SQL after an IF without using a BEGIN and END 3) This is more cosmetic, but could lead to logic issues. You declare @timenow and set it to GETDATE(), but in the IF, you are not referenc...
Move the declaration outside of th eIF block: ``` DECLARE @timenow DATETIME = GETDATE() ,@WEEKDAY nvarchar(10) = DATENAME(DW,GETDATE()) DECLARE @Fecha_222 DATETIME IF DATENAME(DW,GETDATE()) = 'MONDAY' SET @Fecha_222 = @timenow-3 ELSE SET @Fecha_222 = @timenow-1 ```
25,854,371
I'm receiving an error message when i try to execute this code in order to set variables: ``` DECLARE @timenow DATETIME = GETDATE() ,@WEEKDAY nvarchar(10) = DATENAME(DW,GETDATE()) IF DATENAME(DW,GETDATE()) = 'MONDAY' DECLARE @Fecha_222 DATETIME SET @Fecha_222 = @timenow-3 ELSE SET @Fecha_222 = @ti...
2014/09/15
[ "https://Stackoverflow.com/questions/25854371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4043623/" ]
You had three problems: 1) You had the declaration in one half of an if referenced in the other. 2) You had multiple lines of SQL after an IF without using a BEGIN and END 3) This is more cosmetic, but could lead to logic issues. You declare @timenow and set it to GETDATE(), but in the IF, you are not referenc...
Its because when it comes in else condition it can't find @Fecha\_222 because you have declared it in if condition which is not executed. so you have to declare @Fecha\_222 outside if-else. ``` DECLARE @timenow DATETIME = GETDATE(), @WEEKDAY nvarchar(10) = DATENAME(DW,GETDATE(), @Fecha_222 DATETIM...
24,275,555
I have an html form in a view that has validation rules set in it's controller, the problem I'm having is that when someone sends data that isn't valid I want to maintain the data in those fields at the client side, if I reload the view, the fields are cleared, how can I maintain the fields in the data?
2014/06/18
[ "https://Stackoverflow.com/questions/24275555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2585484/" ]
Assuming you're coding your input fields the long way: ``` <input type="text" name="quantity" value="" /> ``` You can use the [Form Helper](http://ellislab.com/codeigniter/user-guide/helpers/form_helper.html)'s `set_value()` function to return values to the input. ``` <input type="text" name="quantity" value="<?php...
There are two way to avoid this. First,you can use ajax submit instead of get or post submit.If you ajax submit successfully,then you use javascript submit your form! Another way to avoid this store the submit data to session.If valid failed,reput the session stored data to your reloded view!
24,275,555
I have an html form in a view that has validation rules set in it's controller, the problem I'm having is that when someone sends data that isn't valid I want to maintain the data in those fields at the client side, if I reload the view, the fields are cleared, how can I maintain the fields in the data?
2014/06/18
[ "https://Stackoverflow.com/questions/24275555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2585484/" ]
Please read this **[CI Documentation](http://ellislab.com/codeigniter/user-guide/libraries/form_validation.html)**. Using `set_value()` you can prevent codeigniter clearing form input fields on unsuccessful validation. Like : ``` <h5>Username</h5> <input type="text" name="username" value="<?php echo set_value('user...
There are two way to avoid this. First,you can use ajax submit instead of get or post submit.If you ajax submit successfully,then you use javascript submit your form! Another way to avoid this store the submit data to session.If valid failed,reput the session stored data to your reloded view!
24,275,555
I have an html form in a view that has validation rules set in it's controller, the problem I'm having is that when someone sends data that isn't valid I want to maintain the data in those fields at the client side, if I reload the view, the fields are cleared, how can I maintain the fields in the data?
2014/06/18
[ "https://Stackoverflow.com/questions/24275555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2585484/" ]
Assuming you're coding your input fields the long way: ``` <input type="text" name="quantity" value="" /> ``` You can use the [Form Helper](http://ellislab.com/codeigniter/user-guide/helpers/form_helper.html)'s `set_value()` function to return values to the input. ``` <input type="text" name="quantity" value="<?php...
If you actually want to retain the values after you reload the view you'll need to use [session user\_data](http://ellislab.com/codeigniter/user-guide/libraries/sessions.html) or store the values somewhere in your db. I don't think that is what you mean, I think you are referring to the data that is showing after the s...
24,275,555
I have an html form in a view that has validation rules set in it's controller, the problem I'm having is that when someone sends data that isn't valid I want to maintain the data in those fields at the client side, if I reload the view, the fields are cleared, how can I maintain the fields in the data?
2014/06/18
[ "https://Stackoverflow.com/questions/24275555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2585484/" ]
Assuming you're coding your input fields the long way: ``` <input type="text" name="quantity" value="" /> ``` You can use the [Form Helper](http://ellislab.com/codeigniter/user-guide/helpers/form_helper.html)'s `set_value()` function to return values to the input. ``` <input type="text" name="quantity" value="<?php...
Please read this **[CI Documentation](http://ellislab.com/codeigniter/user-guide/libraries/form_validation.html)**. Using `set_value()` you can prevent codeigniter clearing form input fields on unsuccessful validation. Like : ``` <h5>Username</h5> <input type="text" name="username" value="<?php echo set_value('user...
24,275,555
I have an html form in a view that has validation rules set in it's controller, the problem I'm having is that when someone sends data that isn't valid I want to maintain the data in those fields at the client side, if I reload the view, the fields are cleared, how can I maintain the fields in the data?
2014/06/18
[ "https://Stackoverflow.com/questions/24275555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2585484/" ]
Please read this **[CI Documentation](http://ellislab.com/codeigniter/user-guide/libraries/form_validation.html)**. Using `set_value()` you can prevent codeigniter clearing form input fields on unsuccessful validation. Like : ``` <h5>Username</h5> <input type="text" name="username" value="<?php echo set_value('user...
If you actually want to retain the values after you reload the view you'll need to use [session user\_data](http://ellislab.com/codeigniter/user-guide/libraries/sessions.html) or store the values somewhere in your db. I don't think that is what you mean, I think you are referring to the data that is showing after the s...
7,758,895
I have a list of updates for my website which are displayed from mysql using a while loop something like. ``` while ($update = $q -> fetch(PDO::FETCH_ASSOC)) { echo '<div class="displayBox"><div> <span class="date">' . $update['dateTime'] . '</span>'; typeColor($update); ...
2011/10/13
[ "https://Stackoverflow.com/questions/7758895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/990459/" ]
Try using [jquery parents with selector](http://api.jquery.com/parents/) - Demo - <http://jsfiddle.net/BgnXL/2/> ``` $('.deleteUpdate').click(function() { // self for ajax handling var self = $(this); var id = self.attr('id'); self.parents('.displayBox').hide(); }); ```
Try: ``` $('#' + id).closest(".displayBox").hide(); ```
7,758,895
I have a list of updates for my website which are displayed from mysql using a while loop something like. ``` while ($update = $q -> fetch(PDO::FETCH_ASSOC)) { echo '<div class="displayBox"><div> <span class="date">' . $update['dateTime'] . '</span>'; typeColor($update); ...
2011/10/13
[ "https://Stackoverflow.com/questions/7758895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/990459/" ]
Try using [jquery parents with selector](http://api.jquery.com/parents/) - Demo - <http://jsfiddle.net/BgnXL/2/> ``` $('.deleteUpdate').click(function() { // self for ajax handling var self = $(this); var id = self.attr('id'); self.parents('.displayBox').hide(); }); ```
You can use the parent function. <http://api.jquery.com/parent/> I would put this in the callback for the click event. ``` var self = $(this); $.ajax({ success:function() { self.parent().hide(); } ```
30,437,567
I made a simple custom `JsonConvert` class. Right now I'm trying to convert the JSON data to a custom class like so: ``` public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { //JObject jo = JObject.Load(reader); MyItem instance = serializer.Deser...
2015/05/25
[ "https://Stackoverflow.com/questions/30437567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175327/" ]
This works: ``` >>> 'a b c'.split(None, 1) ['a', 'b c'] ``` The docstring: > > S.split(sep=None, maxsplit=-1) -> list of strings > > > Return a list of the words in S, using sep as the > delimiter string. If maxsplit is given, at most maxsplit > splits are done. If sep is not specified or is None, any > white...
If you specify `None` as a separator, you'll get the default behavior: ``` str.split(None, maxsplit) ``` > > S.split([sep [,maxsplit]]) -> list of strings > > > Return a list of the words in the string S, using sep as the > delimiter string. If maxsplit is given, at most maxsplit > splits are done. If sep is no...
30,437,567
I made a simple custom `JsonConvert` class. Right now I'm trying to convert the JSON data to a custom class like so: ``` public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { //JObject jo = JObject.Load(reader); MyItem instance = serializer.Deser...
2015/05/25
[ "https://Stackoverflow.com/questions/30437567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175327/" ]
This works: ``` >>> 'a b c'.split(None, 1) ['a', 'b c'] ``` The docstring: > > S.split(sep=None, maxsplit=-1) -> list of strings > > > Return a list of the words in S, using sep as the > delimiter string. If maxsplit is given, at most maxsplit > splits are done. If sep is not specified or is None, any > white...
Split string on consecutive whitespace† at most *maxsplit* times†† ================================================================== † Resulting list will contain *no* leading or trailing empty strings (`""`) if the string has leading or trailing whitespace †† Splits are made left to right. To split the other way (r...
45,499,934
According to my OCP study book the following does not throw an exception: ``` try(Connection conn = DriverManager.getConnection("jdbc:derby:zoo"); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(sql)){ rs.absolute(0); rs.next(); System.out.println(rs.getString(1)); } ``` As you can see c...
2017/08/04
[ "https://Stackoverflow.com/questions/45499934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6351733/" ]
Since you are saving multiple Contacts for any given User then you are using the wrong relation. You need to setup a One-Many relationship using `hasMany()`. ``` class users extends Model { protected $table = "users"; public function contacts() { return $this->hasMany('App\contacts','User_Id','User_I...
Try something like this ``` class users extends Model { protected $table = "users"; public function contacts() { return $this->hasMany('App\contacts','User_Id','User_Id'); } } ``` And on your controller, You can use it like this ``` $contacts= User::find(1)->contacts; // it will return an array ...
45,499,934
According to my OCP study book the following does not throw an exception: ``` try(Connection conn = DriverManager.getConnection("jdbc:derby:zoo"); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(sql)){ rs.absolute(0); rs.next(); System.out.println(rs.getString(1)); } ``` As you can see c...
2017/08/04
[ "https://Stackoverflow.com/questions/45499934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6351733/" ]
Since you are saving multiple Contacts for any given User then you are using the wrong relation. You need to setup a One-Many relationship using `hasMany()`. ``` class users extends Model { protected $table = "users"; public function contacts() { return $this->hasMany('App\contacts','User_Id','User_I...
You don't need to use ->first(); because you already used relation hasOne just use : $contacts = Users::find(1)->contacts; return response()->json($contacts,200);
15,880,926
Suppose I have these lists: ``` ids = [4, 3, 7, 8] objects = [ {"id": 7, "text": "are"}, {"id": 3, "text": "how"}, {"id": 8, "text": "you"}, {"id": 4, "text": "hello"} ] ``` How can I sort the `objects` so the order of their ids matches `ids`? I.e. to get...
2013/04/08
[ "https://Stackoverflow.com/questions/15880926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265521/" ]
``` object_map = {o['id']: o for o in objects} objects = [object_map[id] for id in ids] ```
``` In [25]: idmap = dict((id,pos) for pos,id in enumerate(ids)) In [26]: sorted(objects, key=lambda x:idmap[x['id']]) Out[26]: [{'id': 4, 'text': 'hello'}, {'id': 3, 'text': 'how'}, {'id': 7, 'text': 'are'}, {'id': 8, 'text': 'you'}] ```
15,880,926
Suppose I have these lists: ``` ids = [4, 3, 7, 8] objects = [ {"id": 7, "text": "are"}, {"id": 3, "text": "how"}, {"id": 8, "text": "you"}, {"id": 4, "text": "hello"} ] ``` How can I sort the `objects` so the order of their ids matches `ids`? I.e. to get...
2013/04/08
[ "https://Stackoverflow.com/questions/15880926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265521/" ]
``` object_map = {o['id']: o for o in objects} objects = [object_map[id] for id in ids] ```
``` >>> ids = [4,3,7,8] >>> id_orders = {} >>> for i,id in enumerate(ids): ... id_orders[id] = i ... >>> id_orders {8: 3, 3: 1, 4: 0, 7: 2} >>> >>> sorted(objs, key=lambda x: id_orders[x['id']]) ```
15,880,926
Suppose I have these lists: ``` ids = [4, 3, 7, 8] objects = [ {"id": 7, "text": "are"}, {"id": 3, "text": "how"}, {"id": 8, "text": "you"}, {"id": 4, "text": "hello"} ] ``` How can I sort the `objects` so the order of their ids matches `ids`? I.e. to get...
2013/04/08
[ "https://Stackoverflow.com/questions/15880926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265521/" ]
``` In [25]: idmap = dict((id,pos) for pos,id in enumerate(ids)) In [26]: sorted(objects, key=lambda x:idmap[x['id']]) Out[26]: [{'id': 4, 'text': 'hello'}, {'id': 3, 'text': 'how'}, {'id': 7, 'text': 'are'}, {'id': 8, 'text': 'you'}] ```
``` >>> ids = [4,3,7,8] >>> id_orders = {} >>> for i,id in enumerate(ids): ... id_orders[id] = i ... >>> id_orders {8: 3, 3: 1, 4: 0, 7: 2} >>> >>> sorted(objs, key=lambda x: id_orders[x['id']]) ```
5,535
![Starting position](https://i.stack.imgur.com/41nXK.jpg) After performing squats I often feel elbow soreness (or perhaps extreme fatigue). I'd like to see if anyone can offer form corrections that might help reduce the strain, or if my form looks OK, then perhaps some supplemental exercise recommendations to help str...
2012/02/21
[ "https://fitness.stackexchange.com/questions/5535", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/22/" ]
I echo Dave Liepmann's video recommendation. It's very informative. As far as what I can see here, we've got a couple things going on: * The upper back isn't as tight is it should be * The wrist (particularly the left one) looks as if the palm is supporting the weight Keep in mind that there are more than one school ...
I'm the opposite of an expert--I'm still wrestling with these selfsame issues, and recently switched to high-bar squats in order to avoid them--but you could be holding the bar too low, even for a Rippetoe-style low-bar back squat. The other primary causes of elbow pain, I'm told, are not holding the elbows high enough...
5,535
![Starting position](https://i.stack.imgur.com/41nXK.jpg) After performing squats I often feel elbow soreness (or perhaps extreme fatigue). I'd like to see if anyone can offer form corrections that might help reduce the strain, or if my form looks OK, then perhaps some supplemental exercise recommendations to help str...
2012/02/21
[ "https://fitness.stackexchange.com/questions/5535", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/22/" ]
I echo Dave Liepmann's video recommendation. It's very informative. As far as what I can see here, we've got a couple things going on: * The upper back isn't as tight is it should be * The wrist (particularly the left one) looks as if the palm is supporting the weight Keep in mind that there are more than one school ...
You may have some issues with upper back mobility and shoulder mobility. I have had some of the same issues and doing some light upper back/shoulder mobility work with bands or a broomstick has helped me a lot. Have you ever tried shoulder dislocations (or even [resistance band shoulder dislocations](http://www.weight...
142,692
Does anyone know how to disable the creation of birthday events in Outlook 2010? I have two computers and one mobile which all sync through a Google Mail account. After syncing the contacts, each Outlook instance creates a birthday event for that contact, so I end up with two birthday reminders. Is it possible to tel...
2010/05/18
[ "https://superuser.com/questions/142692", "https://superuser.com", "https://superuser.com/users/5854/" ]
Sounds like you have the same setup as me. I have an Android phone and I bought gsyncit licenses for my work and home PC's. I added the "Contacts' birthdays and events" calendar from Google and setup a gsyncit content filter to not sync events with "Birthday" in the name. Outlook still creates the Birthday events for e...
You can disable "My Calendars" in your mobile if you are using an Android-based phone. I normally have my Google calendar as base.
929,118
> > Can you find an example of non-isomorphic fields which embed inside each other? > > > Most probably we can't but I am looking for extraordinary answer...
2014/09/12
[ "https://math.stackexchange.com/questions/929118", "https://math.stackexchange.com", "https://math.stackexchange.com/users/175632/" ]
**A start:** Let the two fields be the complex numbers $\mathbb{C}$ and the field $\mathbb{C}(X)$ of rational functions with complex coefficients. These are non-isomorphic, since one is algebraically closed and the other isn't. Embedding in one direction is trivial. In the other direction, take a transcendence base f...
This is not something I understand well, but I believe you can construct examples as follows. Let $E$ be an elliptic curve, and let $E'$ be another elliptic curve that is isogenous to $E$, but not isomorphic to $E$. Then the isogeny should provide an embedding $k(E') \to k(E)$, and its dual should provide an embeddin...
42,670,385
I need to start updater application by passing URL of the patch file. Basic Process.Run works fine, however when I pass argument nothing happens. (This is Linux Mint and Mono) I have already checked SO, net, etc. and tried solutions such as setting UseShellExecute to false or using ProcessStartInfo. What am I doing ...
2017/03/08
[ "https://Stackoverflow.com/questions/42670385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4392341/" ]
Try to prefix "mono " since you want in fact to run mono with your .exe as an argument. Also I determine the application path in another way: `string sAppPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);` `Process.Start("mono " + sAppPath + @"/Updater.exe");`
Sorry, I did not test my code. Now I did a small project and tested it - just a form with a label and a button. Working fine. I'm getting the right path and the HelloWorld App gets started and processes the CmdLineArg. Here the core content comes: `private void DoIt() { string sAppPath = System.IO.Path.GetDirectoryNa...
28,061,727
I have a multi dimensional session array in PHP(`$_SESSION['playlist']['ID1']`,`$_SESSION['playlist']['ID2']` ETC) with IDs stored as values. In javascript these can be deleted with the press of a button which will relay the value to a function in PHP to tell it to remove that value from the session array by matching t...
2015/01/21
[ "https://Stackoverflow.com/questions/28061727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2203823/" ]
It doesn't work the way you suppose. Appending HTML with JQuery doesn't run your server-side PHP script. So it is just a string appended to the `wrapper` which has no sense from code execution's point of view. To make what you want to do, you need to use Ajax technology which consists in passing data to server without...
You are trying to append to HTML a PHP function, which shows that you havem't understood how the client-server model works. PHP is a server side script, while JS and HTML are client side: so what you have to do is to use AJAX to send a request to your server with the proper parameters. But first of all you have to unde...
8,301,976
I have a C++ app that will throw an exception when I try to single step from a breakpoint. For example: 1) Start app from VS2010 0 debugger is attached. 2) Set a breakpoint. It doesn't seem to matter where. 3) Do something in the app so that it hits the break point. \*\* VS2010 hits the break point 4) Single step ...
2011/11/28
[ "https://Stackoverflow.com/questions/8301976", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2100870/" ]
A work around for this problem is to disable RPC debugging. In the Visual Studio 2010, Visual Studio 2010 SP1 toolbar select below steps - Tools->Options->Debugging->Native and deselect "Enable RPC debugging"
There maybe exist a thread that somehow detects that the code is being debugged step by step and pagefaults in response to prevent you from debugging. Try to locate that thread by suspending threads one by one. Also, is address 0x087df66f always the same? If it is then you can set a breakpoint there and look around wh...
8,301,976
I have a C++ app that will throw an exception when I try to single step from a breakpoint. For example: 1) Start app from VS2010 0 debugger is attached. 2) Set a breakpoint. It doesn't seem to matter where. 3) Do something in the app so that it hits the break point. \*\* VS2010 hits the break point 4) Single step ...
2011/11/28
[ "https://Stackoverflow.com/questions/8301976", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2100870/" ]
I had this exact same issue. I was able to solve it by starting VS from the command line telling it to reset the UI to default `(/ResetSettings)` Details on the command line arguments are [here](http://msdn.microsoft.com/en-us/library/xee0c8y7.aspx) I did not need to reboot after resetting VS, but I did a full rebuild...
There maybe exist a thread that somehow detects that the code is being debugged step by step and pagefaults in response to prevent you from debugging. Try to locate that thread by suspending threads one by one. Also, is address 0x087df66f always the same? If it is then you can set a breakpoint there and look around wh...
20,770,173
I am working on a project that will use `INotifyPropertyChanged` to announce property changes to subscriber classes. ``` void item_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "Quantity") .... ``` It appears to me that when the subscribing class receives the notifica...
2013/12/25
[ "https://Stackoverflow.com/questions/20770173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2210021/" ]
Actual object is `sender` (at least, it should be): ``` void item_PropertyChanged(object sender, PropertyChangedEventArgs e) { var propertyValue = sender.GetType().GetProperty(e.PropertyName).GetValue(sender); } ``` If you care about performance, then cache `sender.GetType().GetProperty(e.PropertyName)` results.
Note: this interface is primarily a data-binding API, and data-binding is not limited to simple models like reflection. As such, I would suggest you use the TypeDescriptor API. This will allow you to correctly detect changes for both simple and complex models: ``` var prop = TypeDescriptor.GetProperties(sender)[e.Prop...
2,310,126
Could you please tell me if my answer correct? Here is the problem: ***How many ways can 10 candy bars and 8 lollipops be given to five nameless, faceless, pitifully anonymous and altogether indistinct children so that every child gets at least one of each, but no child gets more than two lollipops?*** Here is my an...
2017/06/05
[ "https://math.stackexchange.com/questions/2310126", "https://math.stackexchange.com", "https://math.stackexchange.com/users/195513/" ]
Unfortunately, we approach directly by brute force. I do not see a more convenient approach. We break first into cases by candybar distribution, and then break down further based on lolipop distribution. * $5+0+0+0+0$ Either the person with six candybars does or does not get two lollipops: 2 options * $4+1+0+0+0$ C...
It's easier to start with lollipops. *Step 1*: We give each child a lollipop (since each child must have at least one lollipop). Now there are 3 lollipops remaining, but no child can have 3, we must have: * exactly 3 children with exactly 2 lollipops, and * 2 children with exactly 1 lollipop. Since the children are ...
1,528,076
If they close the browser page out after a process has started via a button on the page, will the process keep running until completion or will it die? How will I allow it to die safely if so?
2009/10/06
[ "https://Stackoverflow.com/questions/1528076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18309/" ]
The page will keep processing. If you want to terminate the processing you can check the [HttpResponse.IsClientConnected](http://msdn.microsoft.com/en-us/library/system.web.httpresponse.isclientconnected.aspx) property and end processing if the client is no longer connected. The example from MSDN: ``` private void P...
I would say, off hand, that that depends entirely on the process and how you've coded your solution. In my experience, however, there's no direct connection between the browser and the server. It's simulated through the use of session state. So once that process starts, I'd say yes, it will keep going until it sends t...
154,835
I am self-employed in USA. I am available during the stock trading time. I am thinking of starting day trading after a few months of preparation. I may begin with scalping. I will keep my current working-from-home contract job for my regular income. I also have some long-term stock investments. Based on my situation, ...
2023/01/22
[ "https://money.stackexchange.com/questions/154835", "https://money.stackexchange.com", "https://money.stackexchange.com/users/105512/" ]
Mark-to-market (MTM) accounting is an option available to certain traders, including day traders, that allows them to report their trading gains and losses on their tax return as if they were business income, rather than capital gains and losses. This can be beneficial for taxpayers who expect to have significant tradi...
Even with capital accounting, losses can always be set against gains. So the IRS probably doesn't care if mark-to-market accounting is chosen. But if the loses were extremely more than the gains then that situation would be something to look at. If the Schedule C deductions were extremely large then that situation wou...
35,323,439
Have a text file, each line contains an IP address with useless info. Want to delete useless info around the IP. Each line looks like: ``` %BER-1-887373: Group <Connect> User <gacan> IP <72.34.184.200> No IPv6 address available ``` Need the IP Address only The < > surround the IP and need to delete those as well....
2016/02/10
[ "https://Stackoverflow.com/questions/35323439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5910029/" ]
Assuming you don't have any other groups of numbers separated by periods and enclosed in `<...>`, you can find: ``` .*<(\d{1,3}(?:\.\d{1,3}){3})>.* ``` and replace with ``` $1 ``` This doesn't validate the IP address; it just finds 4 groups of 1-3 numbers inside `<...>` and with periods between groups. Given you...
Do a find replace: * **Find what:** `.*?(\d{1,3}((.\d{1,3}){3})).*` * **Replace whith:** `\1` * select **Regular Expression** * Hit Replace all The pattern is not perfect as it does not limit the range of the valid numbers (e.g. 999.999.999.99 will be matched too).
35,323,439
Have a text file, each line contains an IP address with useless info. Want to delete useless info around the IP. Each line looks like: ``` %BER-1-887373: Group <Connect> User <gacan> IP <72.34.184.200> No IPv6 address available ``` Need the IP Address only The < > surround the IP and need to delete those as well....
2016/02/10
[ "https://Stackoverflow.com/questions/35323439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5910029/" ]
Assuming you don't have any other groups of numbers separated by periods and enclosed in `<...>`, you can find: ``` .*<(\d{1,3}(?:\.\d{1,3}){3})>.* ``` and replace with ``` $1 ``` This doesn't validate the IP address; it just finds 4 groups of 1-3 numbers inside `<...>` and with periods between groups. Given you...
Regex tend to be complicated at times and there is a good chance you get it wrong. If all the lines are supposed to be in the specified format i.e. three words before IP and two words following it, I would use Macros. Let's say the example is: ``` abc xyz xxxx <127.23.32.120> xxx xyz ``` 1. I would bring the cursor ...
35,323,439
Have a text file, each line contains an IP address with useless info. Want to delete useless info around the IP. Each line looks like: ``` %BER-1-887373: Group <Connect> User <gacan> IP <72.34.184.200> No IPv6 address available ``` Need the IP Address only The < > surround the IP and need to delete those as well....
2016/02/10
[ "https://Stackoverflow.com/questions/35323439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5910029/" ]
Do a find replace: * **Find what:** `.*?(\d{1,3}((.\d{1,3}){3})).*` * **Replace whith:** `\1` * select **Regular Expression** * Hit Replace all The pattern is not perfect as it does not limit the range of the valid numbers (e.g. 999.999.999.99 will be matched too).
Regex tend to be complicated at times and there is a good chance you get it wrong. If all the lines are supposed to be in the specified format i.e. three words before IP and two words following it, I would use Macros. Let's say the example is: ``` abc xyz xxxx <127.23.32.120> xxx xyz ``` 1. I would bring the cursor ...
8,819,894
I am currently re-writing an existing tool in PHP that another person started for optimizing images, for `gif` images,I will convert to `png` and then optimize the `png file`. For `animated gifs` I will run through the program called `Gifsicle` which can optimize animated `gif` images. In some of the existing codebase...
2012/01/11
[ "https://Stackoverflow.com/questions/8819894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1107059/" ]
This is not a standard extension and the code you show appears to care only about file extensions. Presumably the developer of the system you are using came up with the convention and it is unique to that system.
`gifgif` is not a valid extension - and by all means is not a valid way to check whether the file is an animated gif file. In order to check whether the file is an animated gif, you need to actually parse the content of the file and check for frame headers. This function will do it simply: ``` <?php function is_ani($f...
1,842,798
Is Python generally slower on Windows vs. a \*nix machine? Python seems to blaze on my Mac OS X machine whereas it *seems* to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may ...
2009/12/03
[ "https://Stackoverflow.com/questions/1842798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18196/" ]
I wanted to follow up on this and I found something that I believe is 'my answer'. It appears that Windows (vista, which is what I notice this on) is not as fast in handling files. This was mentioned by tony-p-lee. I found this comparisons of [Ubuntu vs Vista vs Win7](http://www.tuxradar.com/content/benchmarked-ubunt...
Interestingly I ran a direct comparison of a popular Python app on a Windows 10 x64 Machine (low powered admittedly) and a Ubuntu 14.04 VM running on the same machine. I have not tested load speeds etc, but am just looking at processor usage between the two. To make the test fair, both were fresh installs and I duplic...
1,842,798
Is Python generally slower on Windows vs. a \*nix machine? Python seems to blaze on my Mac OS X machine whereas it *seems* to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may ...
2009/12/03
[ "https://Stackoverflow.com/questions/1842798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18196/" ]
I wanted to follow up on this and I found something that I believe is 'my answer'. It appears that Windows (vista, which is what I notice this on) is not as fast in handling files. This was mentioned by tony-p-lee. I found this comparisons of [Ubuntu vs Vista vs Win7](http://www.tuxradar.com/content/benchmarked-ubunt...
Maybe the python has more depend on a lot of files open (import different modules). Windows doesn't handle file open as efficiently as Linux. Or maybe Linux probably have more utilities depend on python and python scripts/modules are more likely to be buffered in the system cache.
1,842,798
Is Python generally slower on Windows vs. a \*nix machine? Python seems to blaze on my Mac OS X machine whereas it *seems* to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may ...
2009/12/03
[ "https://Stackoverflow.com/questions/1842798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18196/" ]
Maybe the python has more depend on a lot of files open (import different modules). Windows doesn't handle file open as efficiently as Linux. Or maybe Linux probably have more utilities depend on python and python scripts/modules are more likely to be buffered in the system cache.
Interestingly I ran a direct comparison of a popular Python app on a Windows 10 x64 Machine (low powered admittedly) and a Ubuntu 14.04 VM running on the same machine. I have not tested load speeds etc, but am just looking at processor usage between the two. To make the test fair, both were fresh installs and I duplic...
1,842,798
Is Python generally slower on Windows vs. a \*nix machine? Python seems to blaze on my Mac OS X machine whereas it *seems* to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may ...
2009/12/03
[ "https://Stackoverflow.com/questions/1842798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18196/" ]
I run Python locally on Windows XP and 7 as well as OSX on my Macbook. I've seen no noticable performance differences in the command line interpreter, wx widget apps run the same, and Django apps also perform virtually identically. One thing I noticed at work was that the Kaspersky virus scanner tended to slow the pyt...
With the OS and network libraries, I can confirm slower performance on Windows, at least for versions =< 2.6. I wrote a CLI podcast-fetcher script which ran great on Ubuntu, but then wouldn't download anything faster than about 80 kB/s (where ~1.6 MB/s is my usual max) on either XP or 7. I could partially correct th...
1,842,798
Is Python generally slower on Windows vs. a \*nix machine? Python seems to blaze on my Mac OS X machine whereas it *seems* to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may ...
2009/12/03
[ "https://Stackoverflow.com/questions/1842798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18196/" ]
I run Python locally on Windows XP and 7 as well as OSX on my Macbook. I've seen no noticable performance differences in the command line interpreter, wx widget apps run the same, and Django apps also perform virtually identically. One thing I noticed at work was that the Kaspersky virus scanner tended to slow the pyt...
Interestingly I ran a direct comparison of a popular Python app on a Windows 10 x64 Machine (low powered admittedly) and a Ubuntu 14.04 VM running on the same machine. I have not tested load speeds etc, but am just looking at processor usage between the two. To make the test fair, both were fresh installs and I duplic...
1,842,798
Is Python generally slower on Windows vs. a \*nix machine? Python seems to blaze on my Mac OS X machine whereas it *seems* to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may ...
2009/12/03
[ "https://Stackoverflow.com/questions/1842798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18196/" ]
Maybe the python has more depend on a lot of files open (import different modules). Windows doesn't handle file open as efficiently as Linux. Or maybe Linux probably have more utilities depend on python and python scripts/modules are more likely to be buffered in the system cache.
With the OS and network libraries, I can confirm slower performance on Windows, at least for versions =< 2.6. I wrote a CLI podcast-fetcher script which ran great on Ubuntu, but then wouldn't download anything faster than about 80 kB/s (where ~1.6 MB/s is my usual max) on either XP or 7. I could partially correct th...
1,842,798
Is Python generally slower on Windows vs. a \*nix machine? Python seems to blaze on my Mac OS X machine whereas it *seems* to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may ...
2009/12/03
[ "https://Stackoverflow.com/questions/1842798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18196/" ]
No real numbers here but it certainly feels like the start up time is slower on Windows platforms. I regularly switch between Ubuntu at home and Windows 7 at work and it's an order of magnitude faster starting up on Ubuntu, despite my work machine being at least 4x the speed. As for runtime performance, it feels about...
With the OS and network libraries, I can confirm slower performance on Windows, at least for versions =< 2.6. I wrote a CLI podcast-fetcher script which ran great on Ubuntu, but then wouldn't download anything faster than about 80 kB/s (where ~1.6 MB/s is my usual max) on either XP or 7. I could partially correct th...
1,842,798
Is Python generally slower on Windows vs. a \*nix machine? Python seems to blaze on my Mac OS X machine whereas it *seems* to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may ...
2009/12/03
[ "https://Stackoverflow.com/questions/1842798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18196/" ]
I wanted to follow up on this and I found something that I believe is 'my answer'. It appears that Windows (vista, which is what I notice this on) is not as fast in handling files. This was mentioned by tony-p-lee. I found this comparisons of [Ubuntu vs Vista vs Win7](http://www.tuxradar.com/content/benchmarked-ubunt...
No real numbers here but it certainly feels like the start up time is slower on Windows platforms. I regularly switch between Ubuntu at home and Windows 7 at work and it's an order of magnitude faster starting up on Ubuntu, despite my work machine being at least 4x the speed. As for runtime performance, it feels about...
1,842,798
Is Python generally slower on Windows vs. a \*nix machine? Python seems to blaze on my Mac OS X machine whereas it *seems* to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may ...
2009/12/03
[ "https://Stackoverflow.com/questions/1842798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18196/" ]
I wanted to follow up on this and I found something that I believe is 'my answer'. It appears that Windows (vista, which is what I notice this on) is not as fast in handling files. This was mentioned by tony-p-lee. I found this comparisons of [Ubuntu vs Vista vs Win7](http://www.tuxradar.com/content/benchmarked-ubunt...
With the OS and network libraries, I can confirm slower performance on Windows, at least for versions =< 2.6. I wrote a CLI podcast-fetcher script which ran great on Ubuntu, but then wouldn't download anything faster than about 80 kB/s (where ~1.6 MB/s is my usual max) on either XP or 7. I could partially correct th...
1,842,798
Is Python generally slower on Windows vs. a \*nix machine? Python seems to blaze on my Mac OS X machine whereas it *seems* to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may ...
2009/12/03
[ "https://Stackoverflow.com/questions/1842798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18196/" ]
I wanted to follow up on this and I found something that I believe is 'my answer'. It appears that Windows (vista, which is what I notice this on) is not as fast in handling files. This was mentioned by tony-p-lee. I found this comparisons of [Ubuntu vs Vista vs Win7](http://www.tuxradar.com/content/benchmarked-ubunt...
I run Python locally on Windows XP and 7 as well as OSX on my Macbook. I've seen no noticable performance differences in the command line interpreter, wx widget apps run the same, and Django apps also perform virtually identically. One thing I noticed at work was that the Kaspersky virus scanner tended to slow the pyt...
31,333,089
How to delete a record from database through AJAX using php and also when link is clicked it returns to same page and new list is updated when a link is clicked and id passes through this link ? I am new to AJAX and php
2015/07/10
[ "https://Stackoverflow.com/questions/31333089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5087892/" ]
``` <a class="delete_data" id="<?php echo $row['id']; ?>">Delete</a> ajax $(document).ready(function(){ $(".delete_data").click(function(){ var del_id = $(this).attr('id'); $.ajax({ type:'POST', url:'delete.php', data:'delete_id='+del_id, success:function(data) { if(data) { // Suc...
@TOORPIZZZ You can add this to remove the row from the display without refreshing ``` $(document).ready(function(){ $(".delete_data").click(function(){ var del_id = $(this).attr('id'); var parent = $(this).parent(); $.ajax({ type:'POST', url:'delete.php', data:'delete_id='+del_id, suc...
31,333,089
How to delete a record from database through AJAX using php and also when link is clicked it returns to same page and new list is updated when a link is clicked and id passes through this link ? I am new to AJAX and php
2015/07/10
[ "https://Stackoverflow.com/questions/31333089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5087892/" ]
``` <a class="delete_data" id="<?php echo $row['id']; ?>">Delete</a> ajax $(document).ready(function(){ $(".delete_data").click(function(){ var del_id = $(this).attr('id'); $.ajax({ type:'POST', url:'delete.php', data:'delete_id='+del_id, success:function(data) { if(data) { // Suc...
Make sure you don't have } in a comment by //Error. It took a while until I discovered this. ```js $(document).ready(function(){ $(".delete_data").click(function(){ var del_id = $(this).attr('id'); var parent = $(this).parent(); $.ajax({ type:'POST', url:'delete.php', data:'delete_id...
31,333,089
How to delete a record from database through AJAX using php and also when link is clicked it returns to same page and new list is updated when a link is clicked and id passes through this link ? I am new to AJAX and php
2015/07/10
[ "https://Stackoverflow.com/questions/31333089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5087892/" ]
@TOORPIZZZ You can add this to remove the row from the display without refreshing ``` $(document).ready(function(){ $(".delete_data").click(function(){ var del_id = $(this).attr('id'); var parent = $(this).parent(); $.ajax({ type:'POST', url:'delete.php', data:'delete_id='+del_id, suc...
Make sure you don't have } in a comment by //Error. It took a while until I discovered this. ```js $(document).ready(function(){ $(".delete_data").click(function(){ var del_id = $(this).attr('id'); var parent = $(this).parent(); $.ajax({ type:'POST', url:'delete.php', data:'delete_id...
33,316,676
Can't find something like "tagbar window" in visual studio or his alternatives. Tagbar - clickable short summary of the active source file. List of methods, fields, enumeration etc... Screenshot for explanation (in Vim). Tagbar is at right side. [![enter image description here](https://i.stack.imgur.com/gu6bP.png)](h...
2015/10/24
[ "https://Stackoverflow.com/questions/33316676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1864033/" ]
For the status bar icons' to have a dark tint instead of the default white, add the following tag in your `styles.xml` (or more precisely in `values-v23/styles.xml`) file: ``` <item name="android:windowLightStatusBar" tools:targetApi="23">true</item> ``` You can also change the flag at runtime by setting it to any `...
Below is sample code, change status bar color when switch between portrait&landscapse. portrait mode : light bar, dark icon; landscape mode : dark bar, light icon; Theme: "Theme.AppCompat.Light" ``` @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(ne...
226,608
I recently purchased an old Mac Pro, from eBay to use it as an advanced CPU performance computer as opposed to my 2012 MacBook Air that can't endure much. So far it is working, I have gotten a wireless dongle to connect, and I thought all was good until I went to my App Store to upgrade to El Capitan. When I click "Get...
2016/02/07
[ "https://apple.stackexchange.com/questions/226608", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/169347/" ]
Firstly: putting your serial number up for all to see may not be the best idea. Your Mac Pro is an original Mac Pro. This means that it is not compatible with El Cap by default (I'll explain more later.) So yes, there's an error on your part. Your MacBook Air is also (sadly) likely about as powerful as that Mac Pro. ...
I had the same issue with my Mac Pro G5 - I have four hard drives in this machine with files dating back almost ten years. The way I have solved the problem is to use "target mode." I use my MacBook Pro with El Capitan as the boot drive and use the MAC Pro G5 as a storage device - the Mac Pro still boots to Lion but ...
11,156,471
I need some help about creating more HoverCards with [this plugin](http://designwithpc.com/Plugins/Hovercard) ([download](http://dl.dropbox.com/u/40036711/jquery.hovercard.min.js)). I just created a code demo on [JSFiddle](http://jsfiddle.net/love4all1080/rLwkJ/). Do you have any recommendations about this? JavaScript...
2012/06/22
[ "https://Stackoverflow.com/questions/11156471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1415361/" ]
Now it working with some help from [the author](http://designwithpc.com/) ``` $('.babe-hover').each(function(){ var $this = $(this), myControlId = $this.attr('data-control'), htmlForHovercard = $('#'+ myControlId).html(); $this.hovercard({ detailsHTML: htmlForHovercard, width:278 }); }); ``` ...
I suppose you're asking: why doesn't this work? You're trying to call the `.html()` method on what `$(this).attr('data-control')` returns. `$(this).attr('data-control')`, however, only returns a string, and you need to obtain the corresponding element in order to use `.html()`. The following code works for me: ``` $(...