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
9,972,860
I have a program which reads Inbox messages from email accounts, as the title says i would like to run the program after every 1.5hrs. Is there any OS(Windows and Linux) level or JVM level solution which would help in performing the task. Thanks.
2012/04/02
[ "https://Stackoverflow.com/questions/9972860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1186817/" ]
Taken from [javadoc](http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ScheduledExecutorService.html) of `ScheduledExecutorService`: ``` import static java.util.concurrent.TimeUnit.*; class BeeperControl { private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); ...
Create a [cron job](http://en.wikipedia.org/wiki/Cron). Type `crontab -e` and add an entry for your command.
40,350,137
So what is the proper/correct way to horizontally center the flex `<div>`? ```css #container { width: 100%; min-height: 100%; } ``` ```html <div id="container"> <div className="horizontal-centered">Center this</div> </div> ```
2016/10/31
[ "https://Stackoverflow.com/questions/40350137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Try this ```css #container { width: 100%; min-height: 100%; padding: 0; margin: 0; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; align-items: center; justify-content: center; } ``` ```html <div id="container"> ...
To horizontally center the outermost block, such as a div or article, use the following CSS either in a class or style attribute, either on the body or on a surrounding div: display: flex; justify-content: center; So simple.
40,350,137
So what is the proper/correct way to horizontally center the flex `<div>`? ```css #container { width: 100%; min-height: 100%; } ``` ```html <div id="container"> <div className="horizontal-centered">Center this</div> </div> ```
2016/10/31
[ "https://Stackoverflow.com/questions/40350137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Center align the text in your container: ``` #container { width: 100%; min-height: 100%; text-align: center; } ``` Then ensure your horizontal margins are set to auto, and the container text is realigned properly. ``` #container .horizontal-centered { flex-wrap: wrap; display: flex; flex-direction: row;...
To horizontally center the outermost block, such as a div or article, use the following CSS either in a class or style attribute, either on the body or on a surrounding div: display: flex; justify-content: center; So simple.
40,350,137
So what is the proper/correct way to horizontally center the flex `<div>`? ```css #container { width: 100%; min-height: 100%; } ``` ```html <div id="container"> <div className="horizontal-centered">Center this</div> </div> ```
2016/10/31
[ "https://Stackoverflow.com/questions/40350137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
First change the className to class. Apply `justify-content: center;` to `.horizontal-centered` ``` <div id="container"> <div class="horizontal-centered">...</div> </div> #container .horizontal-centered { flex-wrap: wrap; display: flex; flex-direction: row; margin: 0; justify-content: center; } ```
To horizontally center the outermost block, such as a div or article, use the following CSS either in a class or style attribute, either on the body or on a surrounding div: display: flex; justify-content: center; So simple.
40,350,137
So what is the proper/correct way to horizontally center the flex `<div>`? ```css #container { width: 100%; min-height: 100%; } ``` ```html <div id="container"> <div className="horizontal-centered">Center this</div> </div> ```
2016/10/31
[ "https://Stackoverflow.com/questions/40350137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Assuming a few things : 1) "className" is a typo and should be class? 2) The '.horizontal-centered' is the item needed to be centered, and isn't the flexbox itself. The flexbox changes needed here are entirely in the container. It assumes the immediate child to be the flex items. Changes shown below. ```css #cont...
To horizontally center the outermost block, such as a div or article, use the following CSS either in a class or style attribute, either on the body or on a surrounding div: display: flex; justify-content: center; So simple.
817,472
I have a following oracle stored procedure ``` CREATE OR REPLACE PROCEDURE getRejectedReasons ( p_cursor IN OUT SYS_REFCURSOR) AS BEGIN OPEN p_cursor FOR SELECT * FROM reasons_for_rejection; END; ``` However, when I run this stored procedure in sql-developer then I dont see anything. I just see something...
2009/05/03
[ "https://Stackoverflow.com/questions/817472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You opened the cursor. You didn't select anything from it, update it, or advance it. All open does, effectively, to select the matching rows into temporary memory, so you can advance the cursor row by row. Which you didn't do.
One of the differences between Oracle and SQL Server is that the latter returns result sets naturally. I'd use a function, by the way. In Oracle, functions typically return a single element. Cursors came later. There's some documentation online that will help you understand the use of refcursor bind variables. Here's...
817,472
I have a following oracle stored procedure ``` CREATE OR REPLACE PROCEDURE getRejectedReasons ( p_cursor IN OUT SYS_REFCURSOR) AS BEGIN OPEN p_cursor FOR SELECT * FROM reasons_for_rejection; END; ``` However, when I run this stored procedure in sql-developer then I dont see anything. I just see something...
2009/05/03
[ "https://Stackoverflow.com/questions/817472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You opened the cursor. You didn't select anything from it, update it, or advance it. All open does, effectively, to select the matching rows into temporary memory, so you can advance the cursor row by row. Which you didn't do.
ETA: Ok. Ignore what I wrote. Listen to someone else. Apparently it's wrong, as I got down voted. What tpdi said is correct. You have to do something with the cursor after you declare it. Here's an example using two cursors in nested loops ``` PROCEDURE update_insert_tree (exid_in IN NUMBER, outvar_out OUT VARCH...
817,472
I have a following oracle stored procedure ``` CREATE OR REPLACE PROCEDURE getRejectedReasons ( p_cursor IN OUT SYS_REFCURSOR) AS BEGIN OPEN p_cursor FOR SELECT * FROM reasons_for_rejection; END; ``` However, when I run this stored procedure in sql-developer then I dont see anything. I just see something...
2009/05/03
[ "https://Stackoverflow.com/questions/817472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The stored procedure is returning something it's just you aren't doing anything with the results. You can do this simply by running the following script in SQLDeveloper: ``` VARIABLE csr REFCURSOR; EXEC getRejectedReasons(:csr); -- the colon identifies the parameter as a variable PRINT csr; ``` Another method is t...
You opened the cursor. You didn't select anything from it, update it, or advance it. All open does, effectively, to select the matching rows into temporary memory, so you can advance the cursor row by row. Which you didn't do.
817,472
I have a following oracle stored procedure ``` CREATE OR REPLACE PROCEDURE getRejectedReasons ( p_cursor IN OUT SYS_REFCURSOR) AS BEGIN OPEN p_cursor FOR SELECT * FROM reasons_for_rejection; END; ``` However, when I run this stored procedure in sql-developer then I dont see anything. I just see something...
2009/05/03
[ "https://Stackoverflow.com/questions/817472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
One of the differences between Oracle and SQL Server is that the latter returns result sets naturally. I'd use a function, by the way. In Oracle, functions typically return a single element. Cursors came later. There's some documentation online that will help you understand the use of refcursor bind variables. Here's...
ETA: Ok. Ignore what I wrote. Listen to someone else. Apparently it's wrong, as I got down voted. What tpdi said is correct. You have to do something with the cursor after you declare it. Here's an example using two cursors in nested loops ``` PROCEDURE update_insert_tree (exid_in IN NUMBER, outvar_out OUT VARCH...
817,472
I have a following oracle stored procedure ``` CREATE OR REPLACE PROCEDURE getRejectedReasons ( p_cursor IN OUT SYS_REFCURSOR) AS BEGIN OPEN p_cursor FOR SELECT * FROM reasons_for_rejection; END; ``` However, when I run this stored procedure in sql-developer then I dont see anything. I just see something...
2009/05/03
[ "https://Stackoverflow.com/questions/817472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The stored procedure is returning something it's just you aren't doing anything with the results. You can do this simply by running the following script in SQLDeveloper: ``` VARIABLE csr REFCURSOR; EXEC getRejectedReasons(:csr); -- the colon identifies the parameter as a variable PRINT csr; ``` Another method is t...
One of the differences between Oracle and SQL Server is that the latter returns result sets naturally. I'd use a function, by the way. In Oracle, functions typically return a single element. Cursors came later. There's some documentation online that will help you understand the use of refcursor bind variables. Here's...
817,472
I have a following oracle stored procedure ``` CREATE OR REPLACE PROCEDURE getRejectedReasons ( p_cursor IN OUT SYS_REFCURSOR) AS BEGIN OPEN p_cursor FOR SELECT * FROM reasons_for_rejection; END; ``` However, when I run this stored procedure in sql-developer then I dont see anything. I just see something...
2009/05/03
[ "https://Stackoverflow.com/questions/817472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The stored procedure is returning something it's just you aren't doing anything with the results. You can do this simply by running the following script in SQLDeveloper: ``` VARIABLE csr REFCURSOR; EXEC getRejectedReasons(:csr); -- the colon identifies the parameter as a variable PRINT csr; ``` Another method is t...
ETA: Ok. Ignore what I wrote. Listen to someone else. Apparently it's wrong, as I got down voted. What tpdi said is correct. You have to do something with the cursor after you declare it. Here's an example using two cursors in nested loops ``` PROCEDURE update_insert_tree (exid_in IN NUMBER, outvar_out OUT VARCH...
44,392
I'm trying to implement a binary tree in solidity. ``` struct BTree{ uint x; BTree lesser; BTree greater; bool nil; } ``` Just realized that this is not possible as **struct** definition can't be recursive. Is there any work around possible to achieve my goal?
2018/03/31
[ "https://ethereum.stackexchange.com/questions/44392", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/1312/" ]
I just wrote a blog post about doubly linked lists that should help: <https://programtheblockchain.com/posts/2018/03/30/storage-patterns-doubly-linked-list/>. You can't have recursive structs, and there are no pointers, so you sort of have to make your own. Add each node to an array and use the index in the array as a...
Recursion is possible indirectly: ``` struct BTree { uint x; BTree[] children; bool nil; } ``` You can also use a `mapping` instead of the array.
32,942,926
I am using codeigniter and here I am fetching record in my tooltip. But problem is that, if I want multiple name in my tooltip, it doesn't go to new line as I have tried so many times like, `&#013;`, `<br>`, or something like javascript. But nothing is working. I want suggestion for that. Here is my code: ``` <td><a...
2015/10/05
[ "https://Stackoverflow.com/questions/32942926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5213729/" ]
What happens to you is probably an *access violation*. The variable you're trying to access is undefined because you have already freed the object the variable is pointing to. In the code above, the `ItemData` object is always freed after it's added to the list. You have to write some code to free the object when th...
You are calling `ItemData.Free` after `AddObject()`. This is wrong, since the object will not be valid anymore. This will cause the error when later accessing the object in the `CheckListBox`.
3,730,630
How can I in c# send Message box to remote computer? I have credentials of remote PC and know PC name. Can use for this purpose WMI?
2010/09/16
[ "https://Stackoverflow.com/questions/3730630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251569/" ]
You can do it with **[MvcCodeRouting](http://mvccoderouting.codeplex.com/)**, a seprate open-source CodePlex project. > > MvcCodeRouting automatically creates the best possible routes for your ASP.NET MVC application. > > > 1. Organize your controllers using namespaces (no more areas) **that can go as deep as you w...
I believe that creating something like this with the Controllers won't be a problem, because they're found using namespace. The problem is with the views. By default the MVC routing (through the ViewEngine) only uses the Area, Controller and View values in the RouteData collection. This is implemented in the Virtual...
13,393
What do bombs crafted by Pathfinder's Alchemists actually look like? I was trying to figure this out for a magic item I wanted to create, something that'd be involved in the bombs' creation - e.g. a mixing bowl for bombs, or a beaker to contain them - but I couldn't figure out what they're actually made of, so I didn't...
2012/04/06
[ "https://rpg.stackexchange.com/questions/13393", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/2174/" ]
My alchemist has a bit more of what I thought was a "traditional" feel and so throws little glass balls with a cork and a fuse coming out of it. The dangerous chemicals are inside and ignite when the glass breaks on impact. The other way I thought they'd work is with a vial with two chambers or one vial inside another ...
Dynamite. My alchemist takes his standard action drawing, lighting and throwing sticks of Dynamite. Later on at higher levels I'll modify my bombs to look more like Thermal Detonators as I gain more discoveries.
13,393
What do bombs crafted by Pathfinder's Alchemists actually look like? I was trying to figure this out for a magic item I wanted to create, something that'd be involved in the bombs' creation - e.g. a mixing bowl for bombs, or a beaker to contain them - but I couldn't figure out what they're actually made of, so I didn't...
2012/04/06
[ "https://rpg.stackexchange.com/questions/13393", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/2174/" ]
**Whatever you want!** One of the ways to get the most out of your game is by "skinning." Classes, class features, etc. can and should be changed in visual effect to create an interesting character. I remember listening to the Gamers' Guide to Pathfinder podcast where they discussed the alchemist and fun skinning vari...
My alchemist has a bit more of what I thought was a "traditional" feel and so throws little glass balls with a cork and a fuse coming out of it. The dangerous chemicals are inside and ignite when the glass breaks on impact. The other way I thought they'd work is with a vial with two chambers or one vial inside another ...
13,393
What do bombs crafted by Pathfinder's Alchemists actually look like? I was trying to figure this out for a magic item I wanted to create, something that'd be involved in the bombs' creation - e.g. a mixing bowl for bombs, or a beaker to contain them - but I couldn't figure out what they're actually made of, so I didn't...
2012/04/06
[ "https://rpg.stackexchange.com/questions/13393", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/2174/" ]
**Whatever you want!** One of the ways to get the most out of your game is by "skinning." Classes, class features, etc. can and should be changed in visual effect to create an interesting character. I remember listening to the Gamers' Guide to Pathfinder podcast where they discussed the alchemist and fun skinning vari...
I am pretty sure there is no canonical answer. In the Potions and Poisons player's companion, there is a page which shows what the component satchels, packs, what have you, of Alchemists from different regions might look like, but does not say they *must* look like this. For this reason, it seems to me that it can look...
13,393
What do bombs crafted by Pathfinder's Alchemists actually look like? I was trying to figure this out for a magic item I wanted to create, something that'd be involved in the bombs' creation - e.g. a mixing bowl for bombs, or a beaker to contain them - but I couldn't figure out what they're actually made of, so I didn't...
2012/04/06
[ "https://rpg.stackexchange.com/questions/13393", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/2174/" ]
Explicitly Undefined ==================== The game does not tell you this, because it is left up to the character in question. It’s totally up to you, within the realm of reason – where “the realm of reason” is defined solely by your group. It would be pretty terrible if Paizo took it upon itself to dictate this sort...
> > In order to create a bomb, the alchemist must use a small vial > **containing** an ounce of liquid catalyst > > > Emphasis mine. To me, this means that the vials are prepared with the catalyst at the beginning of the day (or month or year, it says they don't degrade until the bomb is mixed). So he has a bunch...
13,393
What do bombs crafted by Pathfinder's Alchemists actually look like? I was trying to figure this out for a magic item I wanted to create, something that'd be involved in the bombs' creation - e.g. a mixing bowl for bombs, or a beaker to contain them - but I couldn't figure out what they're actually made of, so I didn't...
2012/04/06
[ "https://rpg.stackexchange.com/questions/13393", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/2174/" ]
The alchemist in the campaign I'm playing in now has decided to avoid glassware as much as possible, for obvious reasons. He goes around with a lot of little cloth bags of dusts and powder which he mixes, breathes into to activate, then tosses. There's no reason for you not to decide on the format that's most convenie...
They can be anything you want but here are some examples -------------------------------------------------------- Since Alchemists need to mix the catalyst and the bomb for it to become active and throw it in the same round I like to imagine them as small vials, clay balls or another easily shatterable containers with...
13,393
What do bombs crafted by Pathfinder's Alchemists actually look like? I was trying to figure this out for a magic item I wanted to create, something that'd be involved in the bombs' creation - e.g. a mixing bowl for bombs, or a beaker to contain them - but I couldn't figure out what they're actually made of, so I didn't...
2012/04/06
[ "https://rpg.stackexchange.com/questions/13393", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/2174/" ]
**Whatever you want!** One of the ways to get the most out of your game is by "skinning." Classes, class features, etc. can and should be changed in visual effect to create an interesting character. I remember listening to the Gamers' Guide to Pathfinder podcast where they discussed the alchemist and fun skinning vari...
They can be anything you want but here are some examples -------------------------------------------------------- Since Alchemists need to mix the catalyst and the bomb for it to become active and throw it in the same round I like to imagine them as small vials, clay balls or another easily shatterable containers with...
13,393
What do bombs crafted by Pathfinder's Alchemists actually look like? I was trying to figure this out for a magic item I wanted to create, something that'd be involved in the bombs' creation - e.g. a mixing bowl for bombs, or a beaker to contain them - but I couldn't figure out what they're actually made of, so I didn't...
2012/04/06
[ "https://rpg.stackexchange.com/questions/13393", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/2174/" ]
> > In order to create a bomb, the alchemist must use a small vial > **containing** an ounce of liquid catalyst > > > Emphasis mine. To me, this means that the vials are prepared with the catalyst at the beginning of the day (or month or year, it says they don't degrade until the bomb is mixed). So he has a bunch...
I am pretty sure there is no canonical answer. In the Potions and Poisons player's companion, there is a page which shows what the component satchels, packs, what have you, of Alchemists from different regions might look like, but does not say they *must* look like this. For this reason, it seems to me that it can look...
13,393
What do bombs crafted by Pathfinder's Alchemists actually look like? I was trying to figure this out for a magic item I wanted to create, something that'd be involved in the bombs' creation - e.g. a mixing bowl for bombs, or a beaker to contain them - but I couldn't figure out what they're actually made of, so I didn't...
2012/04/06
[ "https://rpg.stackexchange.com/questions/13393", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/2174/" ]
Based on the description of the power, the bomb is — like the extract and the mutagen – a mixture of chemical agents bound magically together. Since there's no mention of a shell or any other container, it appears to be a handful of powdered reagents that, when the catalyst hits it, firms up into a small ball suitable ...
My alchemist has a bit more of what I thought was a "traditional" feel and so throws little glass balls with a cork and a fuse coming out of it. The dangerous chemicals are inside and ignite when the glass breaks on impact. The other way I thought they'd work is with a vial with two chambers or one vial inside another ...
13,393
What do bombs crafted by Pathfinder's Alchemists actually look like? I was trying to figure this out for a magic item I wanted to create, something that'd be involved in the bombs' creation - e.g. a mixing bowl for bombs, or a beaker to contain them - but I couldn't figure out what they're actually made of, so I didn't...
2012/04/06
[ "https://rpg.stackexchange.com/questions/13393", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/2174/" ]
**Whatever you want!** One of the ways to get the most out of your game is by "skinning." Classes, class features, etc. can and should be changed in visual effect to create an interesting character. I remember listening to the Gamers' Guide to Pathfinder podcast where they discussed the alchemist and fun skinning vari...
> > In order to create a bomb, the alchemist must use a small vial > **containing** an ounce of liquid catalyst > > > Emphasis mine. To me, this means that the vials are prepared with the catalyst at the beginning of the day (or month or year, it says they don't degrade until the bomb is mixed). So he has a bunch...
13,393
What do bombs crafted by Pathfinder's Alchemists actually look like? I was trying to figure this out for a magic item I wanted to create, something that'd be involved in the bombs' creation - e.g. a mixing bowl for bombs, or a beaker to contain them - but I couldn't figure out what they're actually made of, so I didn't...
2012/04/06
[ "https://rpg.stackexchange.com/questions/13393", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/2174/" ]
Based on the description of the power, the bomb is — like the extract and the mutagen – a mixture of chemical agents bound magically together. Since there's no mention of a shell or any other container, it appears to be a handful of powdered reagents that, when the catalyst hits it, firms up into a small ball suitable ...
The alchemist in the campaign I'm playing in now has decided to avoid glassware as much as possible, for obvious reasons. He goes around with a lot of little cloth bags of dusts and powder which he mixes, breathes into to activate, then tosses. There's no reason for you not to decide on the format that's most convenie...
72,410,590
I have a bunch of large CSVs and they all contain the exact same columns and I need to combine them all into a single CSV, so basically appending all the data from each data frame underneath the next. Like this Table 1 | Prop\_ID | State | Pasture | Soy | Corn | | --- | --- | --- | --- | --- | | 1 | WI | 20 | 45 | 75...
2022/05/27
[ "https://Stackoverflow.com/questions/72410590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2284060/" ]
You get a CUDA OOM error, it is not related to the file itself being large, but **single example being large**. JSON file loads correctly to RAM, but `8` examples cannot fit on your GPU (which is often the case for images/videos, especially with high resolution). Solutions --------- 1. Use a larger GPU (e.g. cloud p...
The primary approach I used, using Dataset(Dataset) class. For large dataset pytorch provides an iterable, IterableDataset. Us the following, class CustomIterableDataset(IterableDataset): ``` def __init__(self, filename): #Store the filename in object's memory self.filename = filename self.dataset_size ...
8,000,280
I would like to write a hook for Mercurial to do the following, an am struggling to get going.: * Run on central repo, and execute when changeset(s) are pushed (I *think* I should use the "input" or "changegroup" hook) * Search each commit message for a string with the format "issue:[0-9]\*" * IF string found, call a ...
2011/11/03
[ "https://Stackoverflow.com/questions/8000280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82696/" ]
Use `labelField.getPreferredHeight()` and `manager.getPreferredHeight()` not `labelField.getHeight()` This should work for you
If you can leave the decision about the size of the LabelField until after it has been laid out, then you will get it accurately from getHeight(). This means you can actually get the correct result, including factoring in any margin or padding for the LabelField, that I think ```java int maxWidth = getManager().getPre...
8,000,280
I would like to write a hook for Mercurial to do the following, an am struggling to get going.: * Run on central repo, and execute when changeset(s) are pushed (I *think* I should use the "input" or "changegroup" hook) * Search each commit message for a string with the format "issue:[0-9]\*" * IF string found, call a ...
2011/11/03
[ "https://Stackoverflow.com/questions/8000280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82696/" ]
The method Farid suggests it's a bit difficult to use, because you will need labelWidth. For multiline label this labelWidth may not be the same as parent managers available width, or some exact width you had set, because each line can have different width depending on if words did fit maxWidth or didn't. NOTE: as Nat...
If you can leave the decision about the size of the LabelField until after it has been laid out, then you will get it accurately from getHeight(). This means you can actually get the correct result, including factoring in any margin or padding for the LabelField, that I think ```java int maxWidth = getManager().getPre...
872,414
I´m pretty new to programming in C++ and I´m using pthreads. I´m cross compiling my code for OpenWRT but for some reason I get segmentation fault when I run the program on my board but it runs fine on my PC. I suspect that the error occurs in the linking stage of the compilation because I tried a small C program and th...
2009/05/16
[ "https://Stackoverflow.com/questions/872414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30983/" ]
This could easily be due to a low memory condition. You should try to enable some form of page file and free up any other memory. Also, why -static? if your using a dynamic `-lpthread`, wouldn't linking the shared library be preferable? Also, it could be due to your C++ lib being mis-matched, make sure your `uclibc++...
A correct declaration of `main()` is ``` int main(int argc, char **argv) ``` **Edited to correct this answer:** This is because your compile -c line for your .c include -lpthread: linker input file unused I found this answer about compiling c++ programs on openwrt: <http://manoftoday.wordpress.com/2007/10/11/wri...
872,414
I´m pretty new to programming in C++ and I´m using pthreads. I´m cross compiling my code for OpenWRT but for some reason I get segmentation fault when I run the program on my board but it runs fine on my PC. I suspect that the error occurs in the linking stage of the compilation because I tried a small C program and th...
2009/05/16
[ "https://Stackoverflow.com/questions/872414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30983/" ]
This could easily be due to a low memory condition. You should try to enable some form of page file and free up any other memory. Also, why -static? if your using a dynamic `-lpthread`, wouldn't linking the shared library be preferable? Also, it could be due to your C++ lib being mis-matched, make sure your `uclibc++...
It's not sufficient to simple link against pthread with -lpthread. You need gcc -pthread (as an option its own right) or gcc -D\_REENTRANT -lpthread (define a symbol named \_REENTRANT). I don't know if this necessary affects anything.
872,414
I´m pretty new to programming in C++ and I´m using pthreads. I´m cross compiling my code for OpenWRT but for some reason I get segmentation fault when I run the program on my board but it runs fine on my PC. I suspect that the error occurs in the linking stage of the compilation because I tried a small C program and th...
2009/05/16
[ "https://Stackoverflow.com/questions/872414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30983/" ]
This could easily be due to a low memory condition. You should try to enable some form of page file and free up any other memory. Also, why -static? if your using a dynamic `-lpthread`, wouldn't linking the shared library be preferable? Also, it could be due to your C++ lib being mis-matched, make sure your `uclibc++...
I don't know if you found an answer yet or if this was the problem, but there is a race condition in the code you showed. It is possible that main will return and your program will try to exit before your "run" thread has finished running. You can never assume that it will run in any particular order or with any partic...
872,414
I´m pretty new to programming in C++ and I´m using pthreads. I´m cross compiling my code for OpenWRT but for some reason I get segmentation fault when I run the program on my board but it runs fine on my PC. I suspect that the error occurs in the linking stage of the compilation because I tried a small C program and th...
2009/05/16
[ "https://Stackoverflow.com/questions/872414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30983/" ]
This could easily be due to a low memory condition. You should try to enable some form of page file and free up any other memory. Also, why -static? if your using a dynamic `-lpthread`, wouldn't linking the shared library be preferable? Also, it could be due to your C++ lib being mis-matched, make sure your `uclibc++...
Before returning from the main and thus exiting the program, you should be doing a ``` pthread_join(connector, NULL); ``` which avoids exiting your application before the thread has terminated.
215,139
I am trying to prevent the guest user from accessing software-center (I know it can't install anything, but I don't even want it to browse) The file is owned by root and in group root. I run: `sudo chmod o= /usr/bin/software-center` Afterwards I run `ls -l` and get the following output: `lrwxrwxrwx 1 root root 40 S...
2012/11/09
[ "https://askubuntu.com/questions/215139", "https://askubuntu.com", "https://askubuntu.com/users/69820/" ]
I had a similar problem with an HP laptop. I turned out the the graphic driver was unstable, therefore my graphical card became very hot with result that the fan was blowing very hard. Install `lm-sensors` and check the temperature of your system with `sensors`. When youre CPU's arent very hot (below 80 degrees) you m...
Looking at <http://www8.hp.com/uk/en/support-drivers.html> to try to find your model to see if there are any linux drivers for power management, I could not find your model. I think this is a power management issue you need the proper drivers, either for the graphical card or other, unless there is no physical obstru...
444,062
I would like to know, if it exists, a closed form for: $$\int\_0^{+\infty}\,\frac{k}{ak^4+bk^2+c}\,\,\exp(-wk^2)\,\,dk$$ with $a,b,c,w>0$. Thanks!
2013/07/15
[ "https://math.stackexchange.com/questions/444062", "https://math.stackexchange.com", "https://math.stackexchange.com/users/67295/" ]
As an alternate approach, you may simply express in terms of a Laplace transform; to pick up where @Harry Peter left off: $$I(w)=\int\_0^{\infty} dk \, k \frac{e^{-w k^2}}{a k^4+b k^2+c} = \frac12 \int\_0^{\infty} dx \frac{e^{-w x}}{a x^2+b x+c}$$ Let the roots of the denominator of the integrand be $x\_+$ and $x\_-$...
You can evaluate the integral by using partial fraction and the following identity > > $$\int\_{0}^{\infty}\frac{e^{-wx^2}}{\alpha x+\beta}dx= \frac{1}{2\pi \beta \sqrt{w} }\, > G^{3, 2}\_{2, 3}\left({\frac {{\beta}^{2}w}{{\alpha}^{2}}}\, \Big\vert\,^{\frac{1}{2}, 1}\_{1, \frac{1}{2}, \frac{1}{2}}\right),$$ > > > ...
444,062
I would like to know, if it exists, a closed form for: $$\int\_0^{+\infty}\,\frac{k}{ak^4+bk^2+c}\,\,\exp(-wk^2)\,\,dk$$ with $a,b,c,w>0$. Thanks!
2013/07/15
[ "https://math.stackexchange.com/questions/444062", "https://math.stackexchange.com", "https://math.stackexchange.com/users/67295/" ]
As an alternate approach, you may simply express in terms of a Laplace transform; to pick up where @Harry Peter left off: $$I(w)=\int\_0^{\infty} dk \, k \frac{e^{-w k^2}}{a k^4+b k^2+c} = \frac12 \int\_0^{\infty} dx \frac{e^{-w x}}{a x^2+b x+c}$$ Let the roots of the denominator of the integrand be $x\_+$ and $x\_-$...
$\int\_0^\infty\dfrac{ke^{-wk^2}}{ak^4+bk^2+c}dk$ $=\dfrac{1}{2}\int\_0^\infty\dfrac{e^{-wk^2}}{ak^4+bk^2+c}d(k^2)$ $=\dfrac{1}{2}\int\_0^\infty\dfrac{e^{-wk}}{ak^2+bk+c}dk$ Case $1$: $b^2-4ac\neq0$ Then $\dfrac{1}{2}\int\_0^\infty\dfrac{e^{-wk}}{ak^2+bk+c}dk$ $=\dfrac{1}{2a}\int\_0^\infty\dfrac{e^{-wk}}{\left(k+\...
388,115
How does one interpret the information printed out by the following command in Linux `cat /proc/cpuinfo` On my laptop, I get the following output: ``` [gaurish108:~]$ cat /proc/cpuinfo (02-09 15:34) processor : 0 ...
2012/02/09
[ "https://superuser.com/questions/388115", "https://superuser.com", "https://superuser.com/users/102371/" ]
The entries are *logical* processors; objects used by the kernel internally, not necessarily tied to physical devices. (Note that they all have the same `physical id`.) In other words, they represent the four *cores* of a single Intel i3 CPU. Also, as noted on [this post](https://superuser.com/questions/168809/differ...
It simply means : 1. You **actually** have one quad-core i3 CPU on your system. 2. This "one quad-core i3 CPU" has four logical cores in it.
388,115
How does one interpret the information printed out by the following command in Linux `cat /proc/cpuinfo` On my laptop, I get the following output: ``` [gaurish108:~]$ cat /proc/cpuinfo (02-09 15:34) processor : 0 ...
2012/02/09
[ "https://superuser.com/questions/388115", "https://superuser.com", "https://superuser.com/users/102371/" ]
The entries are *logical* processors; objects used by the kernel internally, not necessarily tied to physical devices. (Note that they all have the same `physical id`.) In other words, they represent the four *cores* of a single Intel i3 CPU. Also, as noted on [this post](https://superuser.com/questions/168809/differ...
Here is an inline awk script to pretty-print and extract relevant data from `/proc/cpuinfo` : ``` cat /proc/cpuinfo | \ awk -v FS=':' ' \ /^physical id/ { if(nb_cpu<$2) { nb_cpu=$2 } } \ /^cpu cores/ { if(nb_cores<$2){ nb_cores=$2 } } \ /^processor/ { if(nb_units<...
388,115
How does one interpret the information printed out by the following command in Linux `cat /proc/cpuinfo` On my laptop, I get the following output: ``` [gaurish108:~]$ cat /proc/cpuinfo (02-09 15:34) processor : 0 ...
2012/02/09
[ "https://superuser.com/questions/388115", "https://superuser.com", "https://superuser.com/users/102371/" ]
Here is an inline awk script to pretty-print and extract relevant data from `/proc/cpuinfo` : ``` cat /proc/cpuinfo | \ awk -v FS=':' ' \ /^physical id/ { if(nb_cpu<$2) { nb_cpu=$2 } } \ /^cpu cores/ { if(nb_cores<$2){ nb_cores=$2 } } \ /^processor/ { if(nb_units<...
It simply means : 1. You **actually** have one quad-core i3 CPU on your system. 2. This "one quad-core i3 CPU" has four logical cores in it.
17,717,276
I'm making a mobile application with phonegap and jquery mobile. Everytime I select one of the menu elements I call to a WS that gives me an answer that I show in the screen. It works perfectly up to there. As I want to have a better view so I use the code trigger ('create'). (<http://jquerymobile.com/demos/1.0a4.1/do...
2013/07/18
[ "https://Stackoverflow.com/questions/17717276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1167562/" ]
For checkbox and radio, use `change` event not `click`. And keep in mind that attaching events to dynamic elements is different, I have updated my answer accordingly. > > **[Demo](http://jsfiddle.net/Palestinian/R7cAu/)** > > > ```js $(document).on('change', '[type=checkbox]', function () { // code here }); ``...
If the event click fires every time as expected then try to set the check box checked/unchecked classes using addClass and removeClass in your code pragmatically rather than relying on the JQM.
18,678,931
I was trying to parse the header from an SQLite database file, using this (fragment of the actual) code: ``` struct Header_info { char *filename; char *sql_string; uint16_t page_size; }; int read_header(FILE *db, struct Header_info *header) { assert(db); uint8_t sql_buf[100] = {0}; /* load th...
2013/09/07
[ "https://Stackoverflow.com/questions/18678931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2671596/" ]
I was able to resolve this error by completely uninstalling / reinstalling `meteor` and `meteorite` through the following steps. ``` sudo rm /usr/local/bin/meteor rm -rf ~/.meteor sudo mrt uninstall sudo mrt uninstall --system sudo chown -R `whoami` ~/.npm curl https://install.meteor.com | /bin/sh sudo -H npm install ...
First off, your meteorite is out of date. To update meteorite run (sudo if applicable): ``` npm update -g meteorite ``` If you ran the 'mrt' or 'meteor' command as sudo in the past, [it will cause issues](https://github.com/oortcloud/meteorite#permission-woes). Clear meteorite by running: ``` sudo mrt uninstall sud...
34,934,562
I have a dataframe with 9 columns, including a column for elapsed time (Days): ``` Probes <- data.frame(Days=seq(0.01, 4.91, 0.01), DJ1=-45:445, SJ2=-50:440, SJ3=10:500, SJ4=-200:290, DJ2=-150:340, DJ9=100:590, SJ21=-300:190, SJ32=-100:390) ``` I would like to create a line graph with multiple series on one plot. I...
2016/01/21
[ "https://Stackoverflow.com/questions/34934562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5120492/" ]
Following @MikeWise's suggestion, here's how you can make this much easier with `ggplot2`: ``` library(ggplot2) library(reshape2) library(dplyr) Probes <- data.frame(Days=seq(0.01, 4.91, 0.01), DJ1=-45:445, SJ2=-50:440, SJ3=10:500, SJ4=-200:290, DJ2=-150:340, DJ9=100:590, SJ21=-300:190, SJ32=-100:390) # Convert dat...
Building on answer from @eipi10, to cope with overlapping text you could make use of a new package `ggrepel` which provides a new 'geom' for `ggplot`. [I started answering this earlier using `tidyr` instead of `reshape2` and don't have reputation to comment yet so posting this as new answer] ``` library(ggplot2) libra...
29,562,221
since gulp-browserify module is blacklisted I`ve tried to rewrite my old code in gulpfile.js without gulp-browserify. I have this worked task with gulp-browserify ``` var gulp = require('gulp'), browserify = require('gulp-browserify'); gulp.task('browserify', function() { return gulp.src('./lib/tssoft.common...
2015/04/10
[ "https://Stackoverflow.com/questions/29562221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3060695/" ]
Stumpled upon this just a couple days ago, here you go: ``` var gulp = require('gulp'), browserify = require('browserify'), source = require('vinyl-source-stream'); gulp.task('browserify', function() { var b = browserify(); b.ignore('jsdom'); var path = './lib/tssoft.commons.js'; b.add(path); ...
The gulp-browerify ignore need a absolute path。 So you just : ``` var gulp = require('gulp'), browserify = require('gulp-browserify'); gulp.task('browserify', function() { return gulp.src('./lib/tssoft.commons.js') .pipe(browserify({ ignore: [require.resolve('jsdom')] })) .pipe(...
6,829,097
I am trying to open a URL, which points to a PDF, using window.open(url). In IE, the popup window flashes and nothing happens afterwords. When I access the same url directly using IE, PDF opens up perfectly. In the HTML below, when I click on Link, I get the PDF but window.open fails. Moreover, if I provide a direct li...
2011/07/26
[ "https://Stackoverflow.com/questions/6829097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/554316/" ]
Most browsers block `window.open` when is called without user interaction in order to avoid popup advertisements. Why are doing this anyway? Instead you should link directly to the PDF in the original document, where you can use `target="_blank"` if it must be in a new window. (Keep in mind, that there are users that...
This may just be my convention, but I always use `window.open()` like this: ``` var win = window.open(url); ```
20,921,698
**Normally, a Gabor filter, as its name suggests, is used to filter an image and extract everything that it is oriented in the same direction of the filtering.** In this question, you can see more efficient code than written in this [Link](https://stackoverflow.com/questions/20147891/create-a-gabor-filter-by-applying-...
2014/01/04
[ "https://Stackoverflow.com/questions/20921698", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2976116/" ]
**In the spatial domain:** ``` function [fSiz,filters,c1OL,numSimpleFilters] = init_gabor(rot, RF_siz) image=imread('xxx.jpg'); image_gray=rgb2gray(image); image_gray=imresize(image_gray, [100 100]); image_double=double(image_gray); rot = [0 45 90 135]; % we have four orientations ...
``` phi = ij*pi/4; % ij = 0, 1, 2, 3 theta = 3; sigma = 0.65*theta; filterSize = 7; % 7:2:37 G = zeros(filterSize); for i=(0:filterSize-1)/filterSize for j=(0:filterSize-1)/filterSize xprime= j*cos(phi); yprime= i*sin(phi); K = exp(2*pi*theta*sqrt(-1)*(xprime+ yprime)); G(round((...
20,921,698
**Normally, a Gabor filter, as its name suggests, is used to filter an image and extract everything that it is oriented in the same direction of the filtering.** In this question, you can see more efficient code than written in this [Link](https://stackoverflow.com/questions/20147891/create-a-gabor-filter-by-applying-...
2014/01/04
[ "https://Stackoverflow.com/questions/20921698", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2976116/" ]
**In the spatial domain:** ``` function [fSiz,filters,c1OL,numSimpleFilters] = init_gabor(rot, RF_siz) image=imread('xxx.jpg'); image_gray=rgb2gray(image); image_gray=imresize(image_gray, [100 100]); image_double=double(image_gray); rot = [0 45 90 135]; % we have four orientations ...
**In the frequency domain:** ``` sigma_u=1/2*pi*sigmaq; sigma_v=1/2*pi*sigmaq; u0=2*pi*cos(theta)*lambda(k); v0=2*pi*sin(theta)*lambda(k); for u = -filtSizeL:filtSizeR for v = -filtSizeL:filtSizeR if ( sqrt(u^2+v^2)>filtSize/2 ) E = 0; else ...
20,921,698
**Normally, a Gabor filter, as its name suggests, is used to filter an image and extract everything that it is oriented in the same direction of the filtering.** In this question, you can see more efficient code than written in this [Link](https://stackoverflow.com/questions/20147891/create-a-gabor-filter-by-applying-...
2014/01/04
[ "https://Stackoverflow.com/questions/20921698", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2976116/" ]
**In the spatial domain:** ``` function [fSiz,filters,c1OL,numSimpleFilters] = init_gabor(rot, RF_siz) image=imread('xxx.jpg'); image_gray=rgb2gray(image); image_gray=imresize(image_gray, [100 100]); image_double=double(image_gray); rot = [0 45 90 135]; % we have four orientations ...
As of R2015b release of the Image Processing Toolbox, you can create a Gabor filter bank using the [gabor](http://www.mathworks.com/help/images/ref/gabor.html) function in the image processing toolbox, and you can apply it to an image using [imgaborfilt](http://www.mathworks.com/help/images/ref/imgaborfilt.html).
20,921,698
**Normally, a Gabor filter, as its name suggests, is used to filter an image and extract everything that it is oriented in the same direction of the filtering.** In this question, you can see more efficient code than written in this [Link](https://stackoverflow.com/questions/20147891/create-a-gabor-filter-by-applying-...
2014/01/04
[ "https://Stackoverflow.com/questions/20921698", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2976116/" ]
``` phi = ij*pi/4; % ij = 0, 1, 2, 3 theta = 3; sigma = 0.65*theta; filterSize = 7; % 7:2:37 G = zeros(filterSize); for i=(0:filterSize-1)/filterSize for j=(0:filterSize-1)/filterSize xprime= j*cos(phi); yprime= i*sin(phi); K = exp(2*pi*theta*sqrt(-1)*(xprime+ yprime)); G(round((...
**In the frequency domain:** ``` sigma_u=1/2*pi*sigmaq; sigma_v=1/2*pi*sigmaq; u0=2*pi*cos(theta)*lambda(k); v0=2*pi*sin(theta)*lambda(k); for u = -filtSizeL:filtSizeR for v = -filtSizeL:filtSizeR if ( sqrt(u^2+v^2)>filtSize/2 ) E = 0; else ...
20,921,698
**Normally, a Gabor filter, as its name suggests, is used to filter an image and extract everything that it is oriented in the same direction of the filtering.** In this question, you can see more efficient code than written in this [Link](https://stackoverflow.com/questions/20147891/create-a-gabor-filter-by-applying-...
2014/01/04
[ "https://Stackoverflow.com/questions/20921698", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2976116/" ]
As of R2015b release of the Image Processing Toolbox, you can create a Gabor filter bank using the [gabor](http://www.mathworks.com/help/images/ref/gabor.html) function in the image processing toolbox, and you can apply it to an image using [imgaborfilt](http://www.mathworks.com/help/images/ref/imgaborfilt.html).
**In the frequency domain:** ``` sigma_u=1/2*pi*sigmaq; sigma_v=1/2*pi*sigmaq; u0=2*pi*cos(theta)*lambda(k); v0=2*pi*sin(theta)*lambda(k); for u = -filtSizeL:filtSizeR for v = -filtSizeL:filtSizeR if ( sqrt(u^2+v^2)>filtSize/2 ) E = 0; else ...
15,765,227
I have a string like this: ``` string text = "ext_bus 0 0/0/3/0.0 side CLAIMED INTERFACE IDE Primary Channel\r\ntarget 0 0/0/3/0.0.0 tgt CLAIMED DEVICE \r\ndisk 0 0/0/3/0.0.0.0 sdisk"; ``` When I do a regex multiline search to get the text in ext\_bus ...
2013/04/02
[ "https://Stackoverflow.com/questions/15765227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/690023/" ]
Due to [hoisting](http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html), this is what gets executed: ``` x = 1; alert(x); var y = function() { var x; // <-- this gets hoisted up from where it was. alert(x); x = 2; alert(x); } y(); ``` At the start of function `y()`, the local va...
The variable declaration in the function is hoisted to the top. So it technically looks like this: ``` var y = function() { var x; alert(x); x = 2; }; ``` The local variable overshadows the global one. That is why the alert returns `undefined`.
15,765,227
I have a string like this: ``` string text = "ext_bus 0 0/0/3/0.0 side CLAIMED INTERFACE IDE Primary Channel\r\ntarget 0 0/0/3/0.0.0 tgt CLAIMED DEVICE \r\ndisk 0 0/0/3/0.0.0.0 sdisk"; ``` When I do a regex multiline search to get the text in ext\_bus ...
2013/04/02
[ "https://Stackoverflow.com/questions/15765227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/690023/" ]
Due to [hoisting](http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html), this is what gets executed: ``` x = 1; alert(x); var y = function() { var x; // <-- this gets hoisted up from where it was. alert(x); x = 2; alert(x); } y(); ``` At the start of function `y()`, the local va...
Since scope in JavaScript is a function object. When you execute some code in a function(your code sample), "alert(x)" will find if there's any definition of "x" in the function. So, there's a "var x = 2" in this function. But the JavaScript runtime will explain your code like this: ``` x = 1; alert(x); var y = func...
15,765,227
I have a string like this: ``` string text = "ext_bus 0 0/0/3/0.0 side CLAIMED INTERFACE IDE Primary Channel\r\ntarget 0 0/0/3/0.0.0 tgt CLAIMED DEVICE \r\ndisk 0 0/0/3/0.0.0.0 sdisk"; ``` When I do a regex multiline search to get the text in ext\_bus ...
2013/04/02
[ "https://Stackoverflow.com/questions/15765227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/690023/" ]
The variable declaration in the function is hoisted to the top. So it technically looks like this: ``` var y = function() { var x; alert(x); x = 2; }; ``` The local variable overshadows the global one. That is why the alert returns `undefined`.
Since scope in JavaScript is a function object. When you execute some code in a function(your code sample), "alert(x)" will find if there's any definition of "x" in the function. So, there's a "var x = 2" in this function. But the JavaScript runtime will explain your code like this: ``` x = 1; alert(x); var y = func...
12,828,271
I am inserting several million rows using the following simple `insert` clause: ``` insert into DEST_TABLE select * from SRC_TABLE ``` However, there may be duplicates while inserting, which will throw an error and the entire operation will end. Is there a way to perform the insertion operation from start to finish...
2012/10/10
[ "https://Stackoverflow.com/questions/12828271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/759959/" ]
Best to avoid the issue all together and filter them out beforehand: ``` insert into DEST_TABLE select * from SRC_TABLE EXCEPT select * from DEST_TABLE ```
Well, the duplicates insertion error can only come from constraints in your `DEST_TABLE`. So remove the constraints in DEST\_TABLE, Insert, clean datas, and put constraints back. Which might be problematic in some cases, if you already have datas in your `DEST_TABLE`. The other (better) solution would be to take dat...
12,828,271
I am inserting several million rows using the following simple `insert` clause: ``` insert into DEST_TABLE select * from SRC_TABLE ``` However, there may be duplicates while inserting, which will throw an error and the entire operation will end. Is there a way to perform the insertion operation from start to finish...
2012/10/10
[ "https://Stackoverflow.com/questions/12828271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/759959/" ]
These are the way to handle duplicate rows. 1. remove the constraint and insert rows. then to remove duplicates create clustered index on table with option ignore\_dup\_row 2. remove all constraints create clusetered index on table with option ignore\_dup\_row. it wouldn't insert if row is duplicated.
Well, the duplicates insertion error can only come from constraints in your `DEST_TABLE`. So remove the constraints in DEST\_TABLE, Insert, clean datas, and put constraints back. Which might be problematic in some cases, if you already have datas in your `DEST_TABLE`. The other (better) solution would be to take dat...
12,828,271
I am inserting several million rows using the following simple `insert` clause: ``` insert into DEST_TABLE select * from SRC_TABLE ``` However, there may be duplicates while inserting, which will throw an error and the entire operation will end. Is there a way to perform the insertion operation from start to finish...
2012/10/10
[ "https://Stackoverflow.com/questions/12828271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/759959/" ]
Best to avoid the issue all together and filter them out beforehand: ``` insert into DEST_TABLE select * from SRC_TABLE EXCEPT select * from DEST_TABLE ```
Maybe where clause will be good? ``` insert into DEST_TABLE select * from SRC_TABLE S where not exists ( select 1 from DEST_TABLE D where D.id=S.id ) ```
12,828,271
I am inserting several million rows using the following simple `insert` clause: ``` insert into DEST_TABLE select * from SRC_TABLE ``` However, there may be duplicates while inserting, which will throw an error and the entire operation will end. Is there a way to perform the insertion operation from start to finish...
2012/10/10
[ "https://Stackoverflow.com/questions/12828271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/759959/" ]
These are the way to handle duplicate rows. 1. remove the constraint and insert rows. then to remove duplicates create clustered index on table with option ignore\_dup\_row 2. remove all constraints create clusetered index on table with option ignore\_dup\_row. it wouldn't insert if row is duplicated.
Maybe where clause will be good? ``` insert into DEST_TABLE select * from SRC_TABLE S where not exists ( select 1 from DEST_TABLE D where D.id=S.id ) ```
12,828,271
I am inserting several million rows using the following simple `insert` clause: ``` insert into DEST_TABLE select * from SRC_TABLE ``` However, there may be duplicates while inserting, which will throw an error and the entire operation will end. Is there a way to perform the insertion operation from start to finish...
2012/10/10
[ "https://Stackoverflow.com/questions/12828271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/759959/" ]
Best to avoid the issue all together and filter them out beforehand: ``` insert into DEST_TABLE select * from SRC_TABLE EXCEPT select * from DEST_TABLE ```
These are the way to handle duplicate rows. 1. remove the constraint and insert rows. then to remove duplicates create clustered index on table with option ignore\_dup\_row 2. remove all constraints create clusetered index on table with option ignore\_dup\_row. it wouldn't insert if row is duplicated.
401,909
The alternating series test is a sufficient condition for the convergence of a numerical series. I am searching for a counterexample for its inverse: i.e. a series (alternating, of course) which converges, but for which the hypothesis of the theorem are false. In particular, if one writes the series as $\sum (-1)^n a\...
2013/05/25
[ "https://math.stackexchange.com/questions/401909", "https://math.stackexchange.com", "https://math.stackexchange.com/users/354/" ]
Put: $$ b\_n = \begin{cases} n^{-2} &: n \text{ odd} \\ 2^{-n} &: n \text{ even} \end{cases} $$ $b\_n$ is not monotonically decreasing. Still, $\sum (-1)^n b\_n$ converges.
If you want a conditionally convergent series in which the signs alternate, but we do not have monotonicity, look at $$\frac{1}{2}-1+\frac{1}{4}-\frac{1}{3}+\frac{1}{6}-\frac{1}{5}+\frac{1}{8}-\frac{1}{7}+\cdots.$$ It is not hard to show that this converges to the same number as its more familiar sister.
222
I've recently been getting into the hobby of Geocaching. However, I'm finding there are many, particularly in cities, that I just cannot find no matter how hard I look for them. They tend to be very small, and often have camouflage of some kind. What tips can you offer to help me improve my rate of finding them?
2012/01/25
[ "https://outdoors.stackexchange.com/questions/222", "https://outdoors.stackexchange.com", "https://outdoors.stackexchange.com/users/88/" ]
**Read the cache page closely.** There may be hints in other places as well as the obvious encrypted hint - the cache description, title, and previous logs may all pose clues that would help you on your search. I tend to try without first but if I'm really stuck I'll read all I can to try and give me a bit more of an i...
First, pick the location you think it closest to the mark, based on the GPS. Then, walk in an outward spiral, looking at any place that someone would be likely to hide a geocache. Think like a person who is hiding it. Where would you put it? Don't forget to look up. Maybe it's at eye level or above. If you wander arou...
222
I've recently been getting into the hobby of Geocaching. However, I'm finding there are many, particularly in cities, that I just cannot find no matter how hard I look for them. They tend to be very small, and often have camouflage of some kind. What tips can you offer to help me improve my rate of finding them?
2012/01/25
[ "https://outdoors.stackexchange.com/questions/222", "https://outdoors.stackexchange.com", "https://outdoors.stackexchange.com/users/88/" ]
First, pick the location you think it closest to the mark, based on the GPS. Then, walk in an outward spiral, looking at any place that someone would be likely to hide a geocache. Think like a person who is hiding it. Where would you put it? Don't forget to look up. Maybe it's at eye level or above. If you wander arou...
Look for patterns: if several caches have been placed by one owner, what kinds of containers are being used; are similar hiding places being used. Logs: look at photos - the person may be blocking the actual hiding place, but the background may be a clue; if the cache container is shown, you know its size, shape, and ...
222
I've recently been getting into the hobby of Geocaching. However, I'm finding there are many, particularly in cities, that I just cannot find no matter how hard I look for them. They tend to be very small, and often have camouflage of some kind. What tips can you offer to help me improve my rate of finding them?
2012/01/25
[ "https://outdoors.stackexchange.com/questions/222", "https://outdoors.stackexchange.com", "https://outdoors.stackexchange.com/users/88/" ]
**Read the cache page closely.** There may be hints in other places as well as the obvious encrypted hint - the cache description, title, and previous logs may all pose clues that would help you on your search. I tend to try without first but if I'm really stuck I'll read all I can to try and give me a bit more of an i...
In cities, an issue with geocaching is the **accuracy of the GPS** - you need to assume a greater margin for error than when you are in the open countryside as tall buildings do affect the signal. As @xpda says, some sort of **regular search pattern may be required**, and be aware that geocaches may be hidden out of r...
222
I've recently been getting into the hobby of Geocaching. However, I'm finding there are many, particularly in cities, that I just cannot find no matter how hard I look for them. They tend to be very small, and often have camouflage of some kind. What tips can you offer to help me improve my rate of finding them?
2012/01/25
[ "https://outdoors.stackexchange.com/questions/222", "https://outdoors.stackexchange.com", "https://outdoors.stackexchange.com/users/88/" ]
In cities, an issue with geocaching is the **accuracy of the GPS** - you need to assume a greater margin for error than when you are in the open countryside as tall buildings do affect the signal. As @xpda says, some sort of **regular search pattern may be required**, and be aware that geocaches may be hidden out of r...
Look for patterns: if several caches have been placed by one owner, what kinds of containers are being used; are similar hiding places being used. Logs: look at photos - the person may be blocking the actual hiding place, but the background may be a clue; if the cache container is shown, you know its size, shape, and ...
222
I've recently been getting into the hobby of Geocaching. However, I'm finding there are many, particularly in cities, that I just cannot find no matter how hard I look for them. They tend to be very small, and often have camouflage of some kind. What tips can you offer to help me improve my rate of finding them?
2012/01/25
[ "https://outdoors.stackexchange.com/questions/222", "https://outdoors.stackexchange.com", "https://outdoors.stackexchange.com/users/88/" ]
**Read the cache page closely.** There may be hints in other places as well as the obvious encrypted hint - the cache description, title, and previous logs may all pose clues that would help you on your search. I tend to try without first but if I'm really stuck I'll read all I can to try and give me a bit more of an i...
I've only been geocaching since June 2010 but only in the last few months did I finally figure out what to look for and my count has soared. Now I'm in the process of placing my first hide. It takes practice. At first, all I did was tag along behind veteran cacher pinkdolphin, my mentor and friend in NC, who has logged...
222
I've recently been getting into the hobby of Geocaching. However, I'm finding there are many, particularly in cities, that I just cannot find no matter how hard I look for them. They tend to be very small, and often have camouflage of some kind. What tips can you offer to help me improve my rate of finding them?
2012/01/25
[ "https://outdoors.stackexchange.com/questions/222", "https://outdoors.stackexchange.com", "https://outdoors.stackexchange.com/users/88/" ]
**Read the cache page closely.** There may be hints in other places as well as the obvious encrypted hint - the cache description, title, and previous logs may all pose clues that would help you on your search. I tend to try without first but if I'm really stuck I'll read all I can to try and give me a bit more of an i...
Look for patterns: if several caches have been placed by one owner, what kinds of containers are being used; are similar hiding places being used. Logs: look at photos - the person may be blocking the actual hiding place, but the background may be a clue; if the cache container is shown, you know its size, shape, and ...
222
I've recently been getting into the hobby of Geocaching. However, I'm finding there are many, particularly in cities, that I just cannot find no matter how hard I look for them. They tend to be very small, and often have camouflage of some kind. What tips can you offer to help me improve my rate of finding them?
2012/01/25
[ "https://outdoors.stackexchange.com/questions/222", "https://outdoors.stackexchange.com", "https://outdoors.stackexchange.com/users/88/" ]
I've only been geocaching since June 2010 but only in the last few months did I finally figure out what to look for and my count has soared. Now I'm in the process of placing my first hide. It takes practice. At first, all I did was tag along behind veteran cacher pinkdolphin, my mentor and friend in NC, who has logged...
Look for patterns: if several caches have been placed by one owner, what kinds of containers are being used; are similar hiding places being used. Logs: look at photos - the person may be blocking the actual hiding place, but the background may be a clue; if the cache container is shown, you know its size, shape, and ...
7,753
This is my first question on the cstheory stack, so don't be too rude if I'm violating etiquette somehow ) As we know, in mathematics even famous mathematicians, superstars and geniuses are doing serious mistakes time to time. For example, both 4-color theorem and Fermat theorem provide us dramatic cases of how even ...
2011/08/15
[ "https://cstheory.stackexchange.com/questions/7753", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/6172/" ]
An infamous example in computational geometry is the incorrect proof of the Zone Theorem for hyperplane arrangements published by Edelsbrunner, O'Rourke, and Seidel [FOCS 1983, SICOMP 1986]. The proof also appears in Edelsbrunner's 1987 computational geometry textbook. > > **Zone Theorem:** In any arrangement of $n$ ...
There have been conjectures that turned out to be false (e.g., constant-distortion embedding of negative type metrics disproved by Khot and Vishnoi), but there's nothing wrong with posing a false conjecture since after all it's a conjecture. An example of an actual confusion, which didn't last long though, is parallel...
7,753
This is my first question on the cstheory stack, so don't be too rude if I'm violating etiquette somehow ) As we know, in mathematics even famous mathematicians, superstars and geniuses are doing serious mistakes time to time. For example, both 4-color theorem and Fermat theorem provide us dramatic cases of how even ...
2011/08/15
[ "https://cstheory.stackexchange.com/questions/7753", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/6172/" ]
An infamous example in computational geometry is the incorrect proof of the Zone Theorem for hyperplane arrangements published by Edelsbrunner, O'Rourke, and Seidel [FOCS 1983, SICOMP 1986]. The proof also appears in Edelsbrunner's 1987 computational geometry textbook. > > **Zone Theorem:** In any arrangement of $n$ ...
The Needham-Shroeder public key cryptography protocol, a 5-line protocol, has been shown insecure 17 years after its publication. This is the favorite example of Verification people for doing formal analysis of crypto protocols.
7,753
This is my first question on the cstheory stack, so don't be too rude if I'm violating etiquette somehow ) As we know, in mathematics even famous mathematicians, superstars and geniuses are doing serious mistakes time to time. For example, both 4-color theorem and Fermat theorem provide us dramatic cases of how even ...
2011/08/15
[ "https://cstheory.stackexchange.com/questions/7753", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/6172/" ]
An infamous example in computational geometry is the incorrect proof of the Zone Theorem for hyperplane arrangements published by Edelsbrunner, O'Rourke, and Seidel [FOCS 1983, SICOMP 1986]. The proof also appears in Edelsbrunner's 1987 computational geometry textbook. > > **Zone Theorem:** In any arrangement of $n$ ...
[Dick Lipton has a new post out](http://rjlipton.wordpress.com/2011/08/18/math-is-like-the-stock-market/) on the non-monotonicity of mathematical knowledge, and in it he documents examples of claims made that turned out to be false, or at least needed fixing.
7,753
This is my first question on the cstheory stack, so don't be too rude if I'm violating etiquette somehow ) As we know, in mathematics even famous mathematicians, superstars and geniuses are doing serious mistakes time to time. For example, both 4-color theorem and Fermat theorem provide us dramatic cases of how even ...
2011/08/15
[ "https://cstheory.stackexchange.com/questions/7753", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/6172/" ]
An infamous example in computational geometry is the incorrect proof of the Zone Theorem for hyperplane arrangements published by Edelsbrunner, O'Rourke, and Seidel [FOCS 1983, SICOMP 1986]. The proof also appears in Edelsbrunner's 1987 computational geometry textbook. > > **Zone Theorem:** In any arrangement of $n$ ...
"I was shocked to learn that the binary search program that Bentley proved correct and subsequently tested in Chapter 5 of Programming Pearls contains a bug. Once I tell you what it is, you will understand why it escaped detection for two decades. Lest you think I'm picking on Bentley, let me tell you how I discovered ...
75,864
In all my life I have never seen a clockwise revolving door. How did counterclockwise become standard?
2015/04/03
[ "https://ux.stackexchange.com/questions/75864", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/38522/" ]
Revolving door traditionally revolve in the direction based on the locations driving habits. That is, right-hand traffic or left-hand traffic. In countries where right-hand traffic is the standard, revolving doors *tend* to rotate counterclockwise. This coincides with user expectations of "keeping to the right" even w...
This is a great question! It's interesting because it represents a design tradeoff. First, it's not the case that revolving doors are never clockwise. [Wikipedia](http://en.m.wikipedia.org/wiki/Revolving_door) notes that "in left hand traffic countries such as Australia and New Zealand, revolving doors revolve clockw...
60,003,545
Considering a dataset such as the classical `mtcars`, I want to know the number of observations (=rows) by different levels of factors, taking them separately as well as together. For example, the following code will generate a column N with the number of observations per level of cyl and gear, but not the number of o...
2020/01/31
[ "https://Stackoverflow.com/questions/60003545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3609394/" ]
Here is one way that you might approach this, relying on `mutate()` and `ave()` instead of `group_by()` and `summarise()` for compactness: ``` library(dplyr) mtcars %>% mutate(n = ave(cyl, cyl, gear, FUN = length), n_cyl = ave(cyl, cyl, FUN = length), n_gear = ave(gear, gear, FUN = length)) %>% ...
with mutate ``` mtcars %>% group_by(cyl, gear) %>% mutate(N = n()) %>% group_by(gear) %>% mutate(Ngear = n()) %>% group_by(cyl) %>% mutate(Ncyl = n()) %>% select(cyl, gear, N, Ngear, Ncyl) %>% distinct() ```
60,003,545
Considering a dataset such as the classical `mtcars`, I want to know the number of observations (=rows) by different levels of factors, taking them separately as well as together. For example, the following code will generate a column N with the number of observations per level of cyl and gear, but not the number of o...
2020/01/31
[ "https://Stackoverflow.com/questions/60003545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3609394/" ]
Here is a way using combinations, then loop through, get counts, finally merge recursively: ``` # get all combinations of columns x1 <- c("cyl", "gear") x2 <- do.call(c, lapply(seq_along(x1), combn, x = x1, simplify = FALSE)) # group by all combos get count, then merge list of dataframes using reduce res <- purrr::re...
with mutate ``` mtcars %>% group_by(cyl, gear) %>% mutate(N = n()) %>% group_by(gear) %>% mutate(Ngear = n()) %>% group_by(cyl) %>% mutate(Ncyl = n()) %>% select(cyl, gear, N, Ngear, Ncyl) %>% distinct() ```
60,003,545
Considering a dataset such as the classical `mtcars`, I want to know the number of observations (=rows) by different levels of factors, taking them separately as well as together. For example, the following code will generate a column N with the number of observations per level of cyl and gear, but not the number of o...
2020/01/31
[ "https://Stackoverflow.com/questions/60003545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3609394/" ]
Here is one way that you might approach this, relying on `mutate()` and `ave()` instead of `group_by()` and `summarise()` for compactness: ``` library(dplyr) mtcars %>% mutate(n = ave(cyl, cyl, gear, FUN = length), n_cyl = ave(cyl, cyl, FUN = length), n_gear = ave(gear, gear, FUN = length)) %>% ...
Here is a way using combinations, then loop through, get counts, finally merge recursively: ``` # get all combinations of columns x1 <- c("cyl", "gear") x2 <- do.call(c, lapply(seq_along(x1), combn, x = x1, simplify = FALSE)) # group by all combos get count, then merge list of dataframes using reduce res <- purrr::re...
60,003,545
Considering a dataset such as the classical `mtcars`, I want to know the number of observations (=rows) by different levels of factors, taking them separately as well as together. For example, the following code will generate a column N with the number of observations per level of cyl and gear, but not the number of o...
2020/01/31
[ "https://Stackoverflow.com/questions/60003545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3609394/" ]
Here is one way that you might approach this, relying on `mutate()` and `ave()` instead of `group_by()` and `summarise()` for compactness: ``` library(dplyr) mtcars %>% mutate(n = ave(cyl, cyl, gear, FUN = length), n_cyl = ave(cyl, cyl, FUN = length), n_gear = ave(gear, gear, FUN = length)) %>% ...
Another way that uses NSE and creates a list of dataframes equal to the length of groups. ``` library(dplyr) #Columns can be created programatically as well if needed all the combination cols <- list('cyl', 'gear', c('cyl', 'gear')) purrr::map(cols, ~count(mtcars, !!!syms(.x), name = paste0('n_',...
60,003,545
Considering a dataset such as the classical `mtcars`, I want to know the number of observations (=rows) by different levels of factors, taking them separately as well as together. For example, the following code will generate a column N with the number of observations per level of cyl and gear, but not the number of o...
2020/01/31
[ "https://Stackoverflow.com/questions/60003545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3609394/" ]
Here is one way that you might approach this, relying on `mutate()` and `ave()` instead of `group_by()` and `summarise()` for compactness: ``` library(dplyr) mtcars %>% mutate(n = ave(cyl, cyl, gear, FUN = length), n_cyl = ave(cyl, cyl, FUN = length), n_gear = ave(gear, gear, FUN = length)) %>% ...
Not strictly speaking a `tidyverse` approach, but you can also do: ``` mtcars %>% mutate(Ncyl = with(stack(table(cyl)), values[match(cyl, ind)]), Ngear = with(stack(table(gear)), values[match(gear, ind)])) %>% group_by(cyl, gear) %>% summarise(N = n(), Ncyl = first(Ncyl), Ngear = first...
60,003,545
Considering a dataset such as the classical `mtcars`, I want to know the number of observations (=rows) by different levels of factors, taking them separately as well as together. For example, the following code will generate a column N with the number of observations per level of cyl and gear, but not the number of o...
2020/01/31
[ "https://Stackoverflow.com/questions/60003545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3609394/" ]
A bit of a hack but without any intermediate structures. ``` mtcars %>% mutate(cylgear = paste(cyl, gear)) %>% group_by(cylgear, cyl, gear) %>% summarise(combination = length(cylgear), Ngear = length(gear), Ncyl = length(cyl)) #> Joining, by = "cyl" #> Joining, by = "gear" #> # A ti...
with mutate ``` mtcars %>% group_by(cyl, gear) %>% mutate(N = n()) %>% group_by(gear) %>% mutate(Ngear = n()) %>% group_by(cyl) %>% mutate(Ncyl = n()) %>% select(cyl, gear, N, Ngear, Ncyl) %>% distinct() ```
60,003,545
Considering a dataset such as the classical `mtcars`, I want to know the number of observations (=rows) by different levels of factors, taking them separately as well as together. For example, the following code will generate a column N with the number of observations per level of cyl and gear, but not the number of o...
2020/01/31
[ "https://Stackoverflow.com/questions/60003545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3609394/" ]
Here is one way that you might approach this, relying on `mutate()` and `ave()` instead of `group_by()` and `summarise()` for compactness: ``` library(dplyr) mtcars %>% mutate(n = ave(cyl, cyl, gear, FUN = length), n_cyl = ave(cyl, cyl, FUN = length), n_gear = ave(gear, gear, FUN = length)) %>% ...
A bit of a hack but without any intermediate structures. ``` mtcars %>% mutate(cylgear = paste(cyl, gear)) %>% group_by(cylgear, cyl, gear) %>% summarise(combination = length(cylgear), Ngear = length(gear), Ncyl = length(cyl)) #> Joining, by = "cyl" #> Joining, by = "gear" #> # A ti...
60,003,545
Considering a dataset such as the classical `mtcars`, I want to know the number of observations (=rows) by different levels of factors, taking them separately as well as together. For example, the following code will generate a column N with the number of observations per level of cyl and gear, but not the number of o...
2020/01/31
[ "https://Stackoverflow.com/questions/60003545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3609394/" ]
A bit of a hack but without any intermediate structures. ``` mtcars %>% mutate(cylgear = paste(cyl, gear)) %>% group_by(cylgear, cyl, gear) %>% summarise(combination = length(cylgear), Ngear = length(gear), Ncyl = length(cyl)) #> Joining, by = "cyl" #> Joining, by = "gear" #> # A ti...
Another way that uses NSE and creates a list of dataframes equal to the length of groups. ``` library(dplyr) #Columns can be created programatically as well if needed all the combination cols <- list('cyl', 'gear', c('cyl', 'gear')) purrr::map(cols, ~count(mtcars, !!!syms(.x), name = paste0('n_',...
60,003,545
Considering a dataset such as the classical `mtcars`, I want to know the number of observations (=rows) by different levels of factors, taking them separately as well as together. For example, the following code will generate a column N with the number of observations per level of cyl and gear, but not the number of o...
2020/01/31
[ "https://Stackoverflow.com/questions/60003545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3609394/" ]
A bit of a hack but without any intermediate structures. ``` mtcars %>% mutate(cylgear = paste(cyl, gear)) %>% group_by(cylgear, cyl, gear) %>% summarise(combination = length(cylgear), Ngear = length(gear), Ncyl = length(cyl)) #> Joining, by = "cyl" #> Joining, by = "gear" #> # A ti...
Not strictly speaking a `tidyverse` approach, but you can also do: ``` mtcars %>% mutate(Ncyl = with(stack(table(cyl)), values[match(cyl, ind)]), Ngear = with(stack(table(gear)), values[match(gear, ind)])) %>% group_by(cyl, gear) %>% summarise(N = n(), Ncyl = first(Ncyl), Ngear = first...
60,003,545
Considering a dataset such as the classical `mtcars`, I want to know the number of observations (=rows) by different levels of factors, taking them separately as well as together. For example, the following code will generate a column N with the number of observations per level of cyl and gear, but not the number of o...
2020/01/31
[ "https://Stackoverflow.com/questions/60003545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3609394/" ]
Not strictly speaking a `tidyverse` approach, but you can also do: ``` mtcars %>% mutate(Ncyl = with(stack(table(cyl)), values[match(cyl, ind)]), Ngear = with(stack(table(gear)), values[match(gear, ind)])) %>% group_by(cyl, gear) %>% summarise(N = n(), Ncyl = first(Ncyl), Ngear = first...
with mutate ``` mtcars %>% group_by(cyl, gear) %>% mutate(N = n()) %>% group_by(gear) %>% mutate(Ngear = n()) %>% group_by(cyl) %>% mutate(Ncyl = n()) %>% select(cyl, gear, N, Ngear, Ncyl) %>% distinct() ```
20,066,059
I got multiple tables, all of the same structure, containing the same columns. The columns are all `varchar(250)`. Now I have a query, that connects all the tables via `UNION ALL` and selects a column named `InsertX` that contains values like "134,856710602534" My problem is: after `UNION`ing all the tables and selec...
2013/11/19
[ "https://Stackoverflow.com/questions/20066059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1254177/" ]
Change this ``` destinationType: Camera.DestinationType.DATA_URL ``` to ``` destinationType: Camera.DestinationType.FILE_URI ``` It will return you the imageuri,For getting the exact location you can make use of filesystem api in phonegap ``` window.resolveLocalFileSystemURI(imageURI, resolveOnSuccess, fsFail)...
1.destinationType: Camera.DestinationType.DATA\_URL DATA\_URL returns base64 string only here image not store in album; 2.destinationType: Camera.DestinationType.FILE\_URL FILE\_URL returns image url. here image stored in album. if u need both i mean base64 string and image stored in album. you need do something ...
266,178
At last count, there are 149 Stack Exchange communities. Only 2 have prominent disclaimers on their main page: [Health](https://health.stackexchange.com/questions) and [Law](https://law.stackexchange.com/questions). The other 147 do not. (It appears that [Judaism used to have one too](https://meta.stackexchange.com/que...
2015/09/11
[ "https://meta.stackexchange.com/questions/266178", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/-1/" ]
I think one reason is to waive all responsibilities, not just from SE, but also from the users posting an answer. And it doesn't only protect the contributors, but also the ones seeking advice. Some countries (I don't care to find which ones exactly, and maybe SE feels the same), have strict rules regarding who can gi...
That only 2 out of 149 communities have such disclaimers, help to perpetuate the myth that there is something special about health and law; that when it comes to these two specific spheres of human life, there is somehow a priesthood of experts who have a monopoly over the truth; that those who have not spent many hund...
266,178
At last count, there are 149 Stack Exchange communities. Only 2 have prominent disclaimers on their main page: [Health](https://health.stackexchange.com/questions) and [Law](https://law.stackexchange.com/questions). The other 147 do not. (It appears that [Judaism used to have one too](https://meta.stackexchange.com/que...
2015/09/11
[ "https://meta.stackexchange.com/questions/266178", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/-1/" ]
These disclaimers exist to **put our users' minds at ease**. Not those people who are visiting, really, but those who are answering the questions. While it is very unlikely that anyone on those sites would ever post something that would actually get them into trouble, because they know better than to do that, having th...
That only 2 out of 149 communities have such disclaimers, help to perpetuate the myth that there is something special about health and law; that when it comes to these two specific spheres of human life, there is somehow a priesthood of experts who have a monopoly over the truth; that those who have not spent many hund...
266,178
At last count, there are 149 Stack Exchange communities. Only 2 have prominent disclaimers on their main page: [Health](https://health.stackexchange.com/questions) and [Law](https://law.stackexchange.com/questions). The other 147 do not. (It appears that [Judaism used to have one too](https://meta.stackexchange.com/que...
2015/09/11
[ "https://meta.stackexchange.com/questions/266178", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/-1/" ]
These disclaimers exist to **put our users' minds at ease**. Not those people who are visiting, really, but those who are answering the questions. While it is very unlikely that anyone on those sites would ever post something that would actually get them into trouble, because they know better than to do that, having th...
I think one reason is to waive all responsibilities, not just from SE, but also from the users posting an answer. And it doesn't only protect the contributors, but also the ones seeking advice. Some countries (I don't care to find which ones exactly, and maybe SE feels the same), have strict rules regarding who can gi...
10,923,402
I am trying to copy from one Windows 7 system to another. I want the destination directory to be `C:\Windows\Temp`. If I omit the destination directory, it copies the file to the remote computer's home directory for "myuser". Great, but I can't get it to copy to `C:\Windows\Temp`. User "myuser" has permission to write ...
2012/06/06
[ "https://Stackoverflow.com/questions/10923402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1316093/" ]
Do you actually know what path syntax your server is using? Or are you guessing? Just connect with WinSCP GUI and see the initial remote directory. This will give you an idea what the syntax is. There are lot of options, depending on server software: * `/cygwin/C/temp/` * `/C:/temp/` * `/C/temp/` * `C:/temp/` * `/t...
Anything under your "\windows" folder is arguably a very poor choice, from a security perspective. And that's probably the problem: security restrictions. Try substituting a different directory. For example: 1) open a command prompt, and type "echo %temp%" 2) You'll probably see something like "c:\Users\xxx\AppDat...
10,923,402
I am trying to copy from one Windows 7 system to another. I want the destination directory to be `C:\Windows\Temp`. If I omit the destination directory, it copies the file to the remote computer's home directory for "myuser". Great, but I can't get it to copy to `C:\Windows\Temp`. User "myuser" has permission to write ...
2012/06/06
[ "https://Stackoverflow.com/questions/10923402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1316093/" ]
Just follow the steps:- 1. Right click on file (Which you want to edit) hover on **edit** then click on **config** 2. Click on Internal editor then **click up button** until become in **first position** 3. Then click on **OK** 4. Then open file it will open on default editor (Only one time edit) 5. Then Change Interna...
Anything under your "\windows" folder is arguably a very poor choice, from a security perspective. And that's probably the problem: security restrictions. Try substituting a different directory. For example: 1) open a command prompt, and type "echo %temp%" 2) You'll probably see something like "c:\Users\xxx\AppDat...
2,990,799
I am a newbie to Java Persistence API and Hibernate. What is the difference between [`FetchType.LAZY`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) and [`FetchType.EAGER`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) in Java Persistence API?
2010/06/07
[ "https://Stackoverflow.com/questions/2990799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324968/" ]
`EAGER` loading of collections means that they are fetched fully at the time their parent is fetched. So if you have `Course` and it has `List<Student>`, all the students are fetched *from the database* at the time the `Course` is fetched. `LAZY` on the other hand means that the contents of the `List` are fetched only...
I want to add this note to what was said above. Suppose you are using Spring (MVC and Data) with this simple architect: > > Controller <-> Service <-> Repository > > > And you want to return some data to the front-end if you are using `FetchType.LAZY`, you will get a `LazyInitializationException` after you retur...
2,990,799
I am a newbie to Java Persistence API and Hibernate. What is the difference between [`FetchType.LAZY`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) and [`FetchType.EAGER`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) in Java Persistence API?
2010/06/07
[ "https://Stackoverflow.com/questions/2990799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324968/" ]
From the [Javadoc](http://java.sun.com/javaee/5/docs/api/javax/persistence/FetchType.html): > > The EAGER strategy is a requirement on the persistence provider runtime that data must be eagerly fetched. The LAZY strategy is a hint to the persistence provider runtime that data should be fetched lazily when it is first...
> > public enum FetchType > extends java.lang.Enum > Defines strategies for fetching data from the database. The EAGER strategy is a requirement on the persistence provider runtime that data must be eagerly fetched. The LAZY strategy is a hint to the persistence provider runtime that data should be fetched lazily wh...
2,990,799
I am a newbie to Java Persistence API and Hibernate. What is the difference between [`FetchType.LAZY`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) and [`FetchType.EAGER`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) in Java Persistence API?
2010/06/07
[ "https://Stackoverflow.com/questions/2990799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324968/" ]
Basically, ``` LAZY = fetch when needed EAGER = fetch immediately ```
I want to add this note to what was said above. Suppose you are using Spring (MVC and Data) with this simple architect: > > Controller <-> Service <-> Repository > > > And you want to return some data to the front-end if you are using `FetchType.LAZY`, you will get a `LazyInitializationException` after you retur...
2,990,799
I am a newbie to Java Persistence API and Hibernate. What is the difference between [`FetchType.LAZY`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) and [`FetchType.EAGER`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) in Java Persistence API?
2010/06/07
[ "https://Stackoverflow.com/questions/2990799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324968/" ]
Both `FetchType.LAZY` and `FetchType.EAGER` are used to define the default fetch plan. Unfortunately, you can only override the default fetch plan for LAZY fetching. EAGER fetching is less flexible and can lead to many performance issues. My advice is to restrain the urge of making your associations EAGER because fet...
There is one tiny comment: If you use **lazy** type, if you close session you will not able to fetch data from database later(See Output below). But with **Eager** type, you fetch data while you fetching Instructor, so after session.close() you will be able to use/show these courseList data. ``` @OneToMany(//fetch ...
2,990,799
I am a newbie to Java Persistence API and Hibernate. What is the difference between [`FetchType.LAZY`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) and [`FetchType.EAGER`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) in Java Persistence API?
2010/06/07
[ "https://Stackoverflow.com/questions/2990799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324968/" ]
By default, for all collection and map objects the fetching rule is `FetchType.LAZY` and for other instances it follows the `FetchType.EAGER` policy. In brief, `@OneToMany` and `@ManyToMany` relations does not fetch the related objects (collection and map) implicictly but the retrieval operation is cascaded through ...
There is one tiny comment: If you use **lazy** type, if you close session you will not able to fetch data from database later(See Output below). But with **Eager** type, you fetch data while you fetching Instructor, so after session.close() you will be able to use/show these courseList data. ``` @OneToMany(//fetch ...
2,990,799
I am a newbie to Java Persistence API and Hibernate. What is the difference between [`FetchType.LAZY`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) and [`FetchType.EAGER`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) in Java Persistence API?
2010/06/07
[ "https://Stackoverflow.com/questions/2990799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324968/" ]
Basically, ``` LAZY = fetch when needed EAGER = fetch immediately ```
The best way to understand the difference between these is if you understand lazy-okay. FetchType.LAZY tells hibernate to only fetch related entities from the database when you use the relationship. P.S: In many projects I have worked on, I have seen that many software developers do not pay attention to them, and ther...
2,990,799
I am a newbie to Java Persistence API and Hibernate. What is the difference between [`FetchType.LAZY`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) and [`FetchType.EAGER`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) in Java Persistence API?
2010/06/07
[ "https://Stackoverflow.com/questions/2990799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324968/" ]
I want to add this note to what was said above. Suppose you are using Spring (MVC and Data) with this simple architect: > > Controller <-> Service <-> Repository > > > And you want to return some data to the front-end if you are using `FetchType.LAZY`, you will get a `LazyInitializationException` after you retur...
***Book.java*** ``` import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; ...
2,990,799
I am a newbie to Java Persistence API and Hibernate. What is the difference between [`FetchType.LAZY`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) and [`FetchType.EAGER`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) in Java Persistence API?
2010/06/07
[ "https://Stackoverflow.com/questions/2990799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324968/" ]
Basically, ``` LAZY = fetch when needed EAGER = fetch immediately ```
`JOIN` is the big deal ====================== Take it in easy way : assume we have a class called `User` and another class called an `Address` and suppose each **user** have one or more **addresses** that mean relationship (one-to-many) here if you execute : **`FetchType.LAZY`** execute sql command like without `joi...
2,990,799
I am a newbie to Java Persistence API and Hibernate. What is the difference between [`FetchType.LAZY`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) and [`FetchType.EAGER`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) in Java Persistence API?
2010/06/07
[ "https://Stackoverflow.com/questions/2990799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324968/" ]
Both `FetchType.LAZY` and `FetchType.EAGER` are used to define the default fetch plan. Unfortunately, you can only override the default fetch plan for LAZY fetching. EAGER fetching is less flexible and can lead to many performance issues. My advice is to restrain the urge of making your associations EAGER because fet...
***Book.java*** ``` import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; ...
2,990,799
I am a newbie to Java Persistence API and Hibernate. What is the difference between [`FetchType.LAZY`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) and [`FetchType.EAGER`](http://docs.oracle.com/javaee/7/api/javax/persistence/FetchType.html) in Java Persistence API?
2010/06/07
[ "https://Stackoverflow.com/questions/2990799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324968/" ]
Both `FetchType.LAZY` and `FetchType.EAGER` are used to define the default fetch plan. Unfortunately, you can only override the default fetch plan for LAZY fetching. EAGER fetching is less flexible and can lead to many performance issues. My advice is to restrain the urge of making your associations EAGER because fet...
The best way to understand the difference between these is if you understand lazy-okay. FetchType.LAZY tells hibernate to only fetch related entities from the database when you use the relationship. P.S: In many projects I have worked on, I have seen that many software developers do not pay attention to them, and ther...
298,049
I have an endgame character with a lot of gear and I'd absolutely hate losing it, so I thought of making a backup by copying the .plr file.... except it's not there. There is only the .plr.bak file. The thing is, I deleted the .plr back some time ago, and when I recovered it from the recycle bin it was way older than...
2017/01/15
[ "https://gaming.stackexchange.com/questions/298049", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/177107/" ]
The .plr.bak (backup) file is the same as the .plr but with the added .bak extension. Remove the .bak then load terraria and see if the character shows up then. The .bak may not be as current as the .plr file was, but should be very close if not exactly the same. My files are currently 8 minutes apart for example.
Isn't your character on the cloud ? If you click on the cloud icon next to the play, when you select your character, then the plr file gets uploaded into the steam cloud, and deleted from your Players folder, only the bak file remains. If that's the problem, then all you need to do is click on the cloud icon again to...
11,055,439
I am not so clear on character pointer and how they work. The program builds, but crashes when I run it. ``` char *ab = NULL; //ab = "abc123"; // works fine sprintf(ab, "abc%d", 123); // this line seems to crash the program ``` I don't get how this can be wrong, when sprintf takes in a (char \* str) as a first a...
2012/06/15
[ "https://Stackoverflow.com/questions/11055439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698810/" ]
You have allocated no memory to use with `ab`. The first assignment works because you are assigning to `ab` a string constant: `"abc123"`. Memory for constant strings are provided by the compiler on your behalf: you don't need to allocate this memory. Before you can use `ab` with e.g. `sprintf`, you'll need to alloca...
You need to allocate memory for your data. Indeed `sprintf` takes `char*`, but it doesn't allocate memory for you. The first line works fine because compiler automatically allocates data for constant tables of chars defined at compile time.
11,055,439
I am not so clear on character pointer and how they work. The program builds, but crashes when I run it. ``` char *ab = NULL; //ab = "abc123"; // works fine sprintf(ab, "abc%d", 123); // this line seems to crash the program ``` I don't get how this can be wrong, when sprintf takes in a (char \* str) as a first a...
2012/06/15
[ "https://Stackoverflow.com/questions/11055439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698810/" ]
You have allocated no memory to use with `ab`. The first assignment works because you are assigning to `ab` a string constant: `"abc123"`. Memory for constant strings are provided by the compiler on your behalf: you don't need to allocate this memory. Before you can use `ab` with e.g. `sprintf`, you'll need to alloca...
"ab" is null and sprintf is trying to write to it, you have to allocate it first. ``` char ab[20]; sprintf(ab, "abc%d", 123); // ``` or ``` char * ab = malloc(20); // new, whatever sprintf(ab, "abc%d", 123); // ```
11,055,439
I am not so clear on character pointer and how they work. The program builds, but crashes when I run it. ``` char *ab = NULL; //ab = "abc123"; // works fine sprintf(ab, "abc%d", 123); // this line seems to crash the program ``` I don't get how this can be wrong, when sprintf takes in a (char \* str) as a first a...
2012/06/15
[ "https://Stackoverflow.com/questions/11055439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698810/" ]
You have allocated no memory to use with `ab`. The first assignment works because you are assigning to `ab` a string constant: `"abc123"`. Memory for constant strings are provided by the compiler on your behalf: you don't need to allocate this memory. Before you can use `ab` with e.g. `sprintf`, you'll need to alloca...
You can do this ``` char ab[10]; //allocate memory sprintf(ab, "abc%d", 123); ```
11,055,439
I am not so clear on character pointer and how they work. The program builds, but crashes when I run it. ``` char *ab = NULL; //ab = "abc123"; // works fine sprintf(ab, "abc%d", 123); // this line seems to crash the program ``` I don't get how this can be wrong, when sprintf takes in a (char \* str) as a first a...
2012/06/15
[ "https://Stackoverflow.com/questions/11055439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698810/" ]
Unlike in `Java` or other higher level languages, many of the `C` library's string functions don't simply set a string reference, instead they operate on a block of pre-allocated memory called a character array. Your first line is saying that `ab` points to a non-existent memory location. You'd have more luck if, ins...
"ab" is null and sprintf is trying to write to it, you have to allocate it first. ``` char ab[20]; sprintf(ab, "abc%d", 123); // ``` or ``` char * ab = malloc(20); // new, whatever sprintf(ab, "abc%d", 123); // ```
11,055,439
I am not so clear on character pointer and how they work. The program builds, but crashes when I run it. ``` char *ab = NULL; //ab = "abc123"; // works fine sprintf(ab, "abc%d", 123); // this line seems to crash the program ``` I don't get how this can be wrong, when sprintf takes in a (char \* str) as a first a...
2012/06/15
[ "https://Stackoverflow.com/questions/11055439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698810/" ]
Unlike in `Java` or other higher level languages, many of the `C` library's string functions don't simply set a string reference, instead they operate on a block of pre-allocated memory called a character array. Your first line is saying that `ab` points to a non-existent memory location. You'd have more luck if, ins...
There are several things to think about here. Your original example is below: ``` char *ab = NULL; //ab = "abc123"; // works fine sprintf(ab, "abc%d", 123); // this line seems to crash the program ``` `char *ab = NULL;` is a pointer to a character and is initialized to NULL; I don't think `ab = "abc123";` worked ...