qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
12,759,835 | I have to build a Minesweeper solver, but don't really know where to start. The problem is, I have to utilize some metaheuristic algorithm, like ant colony optimization, simulated annealing, genetic programming etc. I have found some related materials on the Internet, but I'm not really sure which of them are useful an... | 2012/10/06 | [
"https://Stackoverflow.com/questions/12759835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1448655/"
] | "ant colony optimization, simulated annealing, genetic programming" ... big words, but I am not sure how you would use any of them!
I suggest having two solvers:
1. Perfect solver: Where there is a perfect answer without any doubt and solving it.
2. Imperfect solver: Where there is doubt and you would like to find th... | Metaheuristics might not the best algorithm for Minesweeper - at least not for the easy parts.
Instead, a simple rule engine with inference could probably already tag many of the bombs and reveal the free spots. The inference is needed to reason further once a bomb has been tagged, with that information. For inspirati... |
1,318,052 | My webapp is hosted on a unix server using MySQL as database.
I wrote a Perl script to run backup of my database. The Perl script is inside the *cgi-bin* folde and it is working. I only need to set the cronjob and run the Perl script once a day.
The backups are stored in a folder named *db\_backups*,. However, I also... | 2009/08/23 | [
"https://Stackoverflow.com/questions/1318052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/80353/"
] | `if (-M $file > 10) { unlink $file }`
or, coupled with `File::Find::Rule`
```
my $ten_days_ago = time() - 10 * 86400;
my @to_delete = File::Find::Rule->file()
->mtime("<=$ten_days_ago")
->in("/path/to/db_backup");
unlink @to_delete;
``` | You should be able to do it without resorting to Unix commands. Loop through the files in your directory, use [`stat`](http://perldoc.perl.org/functions/stat.html) on each file to get its last modify time for a file, then use [`unlink`](http://perldoc.perl.org/functions/unlink.html) on the file to delete it if it's old... |
1,318,052 | My webapp is hosted on a unix server using MySQL as database.
I wrote a Perl script to run backup of my database. The Perl script is inside the *cgi-bin* folde and it is working. I only need to set the cronjob and run the Perl script once a day.
The backups are stored in a folder named *db\_backups*,. However, I also... | 2009/08/23 | [
"https://Stackoverflow.com/questions/1318052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/80353/"
] | On Unix you can't, because *the file's creation date is not stored in the filesystem*.
You may want to check out [stat](http://perldoc.perl.org/functions/stat.html), and [-M](http://perldoc.perl.org/functions/-X.html) (modification time)/[-C](http://perldoc.perl.org/functions/-X.html) (*inode change time*)/[-A](http:/... | You should be able to do it without resorting to Unix commands. Loop through the files in your directory, use [`stat`](http://perldoc.perl.org/functions/stat.html) on each file to get its last modify time for a file, then use [`unlink`](http://perldoc.perl.org/functions/unlink.html) on the file to delete it if it's old... |
1,318,052 | My webapp is hosted on a unix server using MySQL as database.
I wrote a Perl script to run backup of my database. The Perl script is inside the *cgi-bin* folde and it is working. I only need to set the cronjob and run the Perl script once a day.
The backups are stored in a folder named *db\_backups*,. However, I also... | 2009/08/23 | [
"https://Stackoverflow.com/questions/1318052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/80353/"
] | >
> *i have searched high and low for unix commands
> and cannot find anything that matches what i needed.*
>
>
>
Check out [`find(1)`](http://linux.die.net/man/1/find) and [`xargs(1)`](http://linux.die.net/man/1/xargs). Warning: these commands may change your life at the shell prompt.
```
$ find /path/to/backup... | You should be able to do it without resorting to Unix commands. Loop through the files in your directory, use [`stat`](http://perldoc.perl.org/functions/stat.html) on each file to get its last modify time for a file, then use [`unlink`](http://perldoc.perl.org/functions/unlink.html) on the file to delete it if it's old... |
1,318,052 | My webapp is hosted on a unix server using MySQL as database.
I wrote a Perl script to run backup of my database. The Perl script is inside the *cgi-bin* folde and it is working. I only need to set the cronjob and run the Perl script once a day.
The backups are stored in a folder named *db\_backups*,. However, I also... | 2009/08/23 | [
"https://Stackoverflow.com/questions/1318052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/80353/"
] | `if (-M $file > 10) { unlink $file }`
or, coupled with `File::Find::Rule`
```
my $ten_days_ago = time() - 10 * 86400;
my @to_delete = File::Find::Rule->file()
->mtime("<=$ten_days_ago")
->in("/path/to/db_backup");
unlink @to_delete;
``` | On Unix you can't, because *the file's creation date is not stored in the filesystem*.
You may want to check out [stat](http://perldoc.perl.org/functions/stat.html), and [-M](http://perldoc.perl.org/functions/-X.html) (modification time)/[-C](http://perldoc.perl.org/functions/-X.html) (*inode change time*)/[-A](http:/... |
1,318,052 | My webapp is hosted on a unix server using MySQL as database.
I wrote a Perl script to run backup of my database. The Perl script is inside the *cgi-bin* folde and it is working. I only need to set the cronjob and run the Perl script once a day.
The backups are stored in a folder named *db\_backups*,. However, I also... | 2009/08/23 | [
"https://Stackoverflow.com/questions/1318052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/80353/"
] | `if (-M $file > 10) { unlink $file }`
or, coupled with `File::Find::Rule`
```
my $ten_days_ago = time() - 10 * 86400;
my @to_delete = File::Find::Rule->file()
->mtime("<=$ten_days_ago")
->in("/path/to/db_backup");
unlink @to_delete;
``` | >
> *i have searched high and low for unix commands
> and cannot find anything that matches what i needed.*
>
>
>
Check out [`find(1)`](http://linux.die.net/man/1/find) and [`xargs(1)`](http://linux.die.net/man/1/xargs). Warning: these commands may change your life at the shell prompt.
```
$ find /path/to/backup... |
1,318,052 | My webapp is hosted on a unix server using MySQL as database.
I wrote a Perl script to run backup of my database. The Perl script is inside the *cgi-bin* folde and it is working. I only need to set the cronjob and run the Perl script once a day.
The backups are stored in a folder named *db\_backups*,. However, I also... | 2009/08/23 | [
"https://Stackoverflow.com/questions/1318052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/80353/"
] | On Unix you can't, because *the file's creation date is not stored in the filesystem*.
You may want to check out [stat](http://perldoc.perl.org/functions/stat.html), and [-M](http://perldoc.perl.org/functions/-X.html) (modification time)/[-C](http://perldoc.perl.org/functions/-X.html) (*inode change time*)/[-A](http:/... | >
> *i have searched high and low for unix commands
> and cannot find anything that matches what i needed.*
>
>
>
Check out [`find(1)`](http://linux.die.net/man/1/find) and [`xargs(1)`](http://linux.die.net/man/1/xargs). Warning: these commands may change your life at the shell prompt.
```
$ find /path/to/backup... |
58,907,126 | I have a `csv` file in which a row sometimes has two values for a column. Currently I m trying to split using `,` but is not working as expected. Can someone throw light on how to achieve the expected output. I do not want to use any `npm` library.
```
//users.csv
name,age,hobbies
james,20,"reading,playing"
marie,18,s... | 2019/11/18 | [
"https://Stackoverflow.com/questions/58907126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11082661/"
] | The syntax problem is already mentioned in the [comments](https://stackoverflow.com/questions/58907118/reactjs-using-state-in-link-component/58907194#comment104076934_58907118). If you need to pass the entire state, you can use object spread like so
```
search: `?email=${JSON.stringify({...this.state})}`
```
And you... | Looks like you need to fix your object syntax. Probably something like this:
```
{
senderEmail: this.state.senderEmail,
senderName: this.state.senderName
}
```
etc. |
30,252,950 | I would like to know, how the complexity of a rule based application can be measured?
Is there a standard way defined by IBM ?
or something with Function Point to measure the complexity of a software based application
Complexity can always be based on some parameters like the 1) Parameters being passed / 2) Number ... | 2015/05/15 | [
"https://Stackoverflow.com/questions/30252950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/495444/"
] | There is no defined way of measuring the 'complexity' of an ODM application. However, you should make sure you use the correct topology for your needs (see the [Deployment Architecture](http://www-01.ibm.com/support/knowledgecenter/SSQP76_8.7.0/com.ibm.odm.dserver.rules.deploying/topics/tpc_ds_managing_env.html?lang=en... | For me there are 3 key factors:
* Integrations with other applications (SOA approach for ws -ESB, BPM, .net, etc)
* Programming level, if you need to use a lot of functions for the rules (fors, maps, vectors, etc)
* Rule projects volume, how many decision services you would have.
Hope this help you. |
20,333,417 | I want to select every row in a table, but everything i try, it only selects the first.
I tried the following snippet, which I found somewhere. It doesn't help me out though.
```
function addJQuery(callback) {
var script = document.createElement("script");
script.setAttribute("src",
"http://aja... | 2013/12/02 | [
"https://Stackoverflow.com/questions/20333417",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3058215/"
] | make sure you're including the jquery document.ready function when using a jquery selector.
```
$(document).ready(function() {
var rows = $("#report_list tr");
console.log(rows);
});
``` | Remove the spaces in the src: "<http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js>");
When I removed the spaces it worked: [Demo](http://jsfiddle.net/tbsXR/)
```
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");
``` |
30,803,570 | Is there an easy way to get, increment and replace an integer from a `ConcurrentHashMap`?
```
ConcurrentHashMap<MyResource, AtomicInteger> map;
```
Let's say that every value has already been initialized like this:
```
map.get(i) = new AtomicInteger(0);
```
and that we do not add any new keys.
**How can I make a... | 2015/06/12 | [
"https://Stackoverflow.com/questions/30803570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1746602/"
] | You can use compute to perform atomic operations like the one you're asking for. The compute method will return the incremented value or 1 if it's the first call.
```
Map<MyResource, Integer> map = new ConcurrentHashMap<>();
map.compute(resourceKey, (k, v) -> v == null ? 1 : v + 1);
``` | The AtomicInteger will work fine with multiple threads, that's its purpose. So if the map doesn't change, you're fine.
Problems will occur if several threads try to modify the map at the same time, for example two threads adding each their own AtomicInteger. In this case, synchronize the map itself. |
595,800 | Due to **group policies** enforced on our systems, we can't change the **background of our desktop** permanently. The **IE**'s "Set as desktop background" is working but temporarily.
PS: I have got administrator privileges to my system. | 2013/05/15 | [
"https://superuser.com/questions/595800",
"https://superuser.com",
"https://superuser.com/users/86538/"
] | You would just find the background image file it is currently using and overwrite it, rather than trying to point your preferences at a different file.
So if your current background file is c:\windows\system\background.png, you would MAKE A BACKUP copy, background.png.bak or similar. Then you would copy the one you wa... | I have the same situation here. I've done it in a bit different way + does not require administrator privileges:
1. Create a new directory: **C:\Wallpaper**
2. Move to there your wallpaper, resize it to your screen dimensions and rename it to **background.jpg**. To resize the image without any 3rd party app, open back... |
89,227 | Trying to find title/author of story I read many years ago, around 1964. Story was written from the point of view of a snail like creature. The central character describes (stream-of-consciousness?) himself and other characters moving along a path in a constant search for food. The story ends with the main character fa... | 2015/05/07 | [
"https://scifi.stackexchange.com/questions/89227",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/3011/"
] | There may be others but I nominate ["James"](https://www.isfdb.org/cgi-bin/title.cgi?62952), a short story by [Gordon R. Dickson](https://en.wikipedia.org/wiki/Gordon_R._Dickson), first published in the [*The Magazine of Fantasy and Science Fiction*, May 1955](https://www.isfdb.org/cgi-bin/pl.cgi?61290+c), available at... | You don't give much detail, but it sounds like Dragon's Egg by Robert Forward. From Wikipedia: *Dragon's Egg is a neutron star with a surface gravity 67 billion times that of Earth, and inhabited by cheela, intelligent creatures the size of a sesame seed who live, think and develop a million times faster than humans.* |
89,227 | Trying to find title/author of story I read many years ago, around 1964. Story was written from the point of view of a snail like creature. The central character describes (stream-of-consciousness?) himself and other characters moving along a path in a constant search for food. The story ends with the main character fa... | 2015/05/07 | [
"https://scifi.stackexchange.com/questions/89227",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/3011/"
] | This is "On the Fourth Planet" (1963) by J. F. Bone. The question was asked before as ["Short story where creatures have squares of territory."](https://scifi.stackexchange.com/questions/36463/short-story-where-creatures-have-squares-of-territory/45888#45888) Originally published in the April 1963 issue of *Galaxy* and... | You don't give much detail, but it sounds like Dragon's Egg by Robert Forward. From Wikipedia: *Dragon's Egg is a neutron star with a surface gravity 67 billion times that of Earth, and inhabited by cheela, intelligent creatures the size of a sesame seed who live, think and develop a million times faster than humans.* |
89,227 | Trying to find title/author of story I read many years ago, around 1964. Story was written from the point of view of a snail like creature. The central character describes (stream-of-consciousness?) himself and other characters moving along a path in a constant search for food. The story ends with the main character fa... | 2015/05/07 | [
"https://scifi.stackexchange.com/questions/89227",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/3011/"
] | This is "On the Fourth Planet" (1963) by J. F. Bone. The question was asked before as ["Short story where creatures have squares of territory."](https://scifi.stackexchange.com/questions/36463/short-story-where-creatures-have-squares-of-territory/45888#45888) Originally published in the April 1963 issue of *Galaxy* and... | There may be others but I nominate ["James"](https://www.isfdb.org/cgi-bin/title.cgi?62952), a short story by [Gordon R. Dickson](https://en.wikipedia.org/wiki/Gordon_R._Dickson), first published in the [*The Magazine of Fantasy and Science Fiction*, May 1955](https://www.isfdb.org/cgi-bin/pl.cgi?61290+c), available at... |
11,371,458 | I'm trying to programmatically create some javascript buttons to toggle visibility on the page (for snappy tag filtering). This works for one tag:
```
trigger = ".sales-focus-btn"
target = ".sales-focus"
jQuery ->
$(trigger).toggle ->
$("#primary-content").find('.container').hide()
$("#primary-content").... | 2012/07/07 | [
"https://Stackoverflow.com/questions/11371458",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1023216/"
] | Of course it's possible:
```
content = $('#primary-content')
container = content.find('.container')
tags = [
'.sales-focus'
'.service-focus'
'.other-focus'
]
$.each tags, (tag) ->
target = content.find(tag)
$(tag + "-btn").toggle ->
container.hide()
target.show()
, ->
... | You can call `toggle` in a loop, but you have to be aware of the weird JS scoping rules. Basically, if you generate a function inside a loop, like this:
```
for n in [1, 2, 3]
$(".btn-#{n}").click -> alert "you clicked #{n}"
```
You will notice that [all the buttons print "you clicked 3" when pressed](http://jsfid... |
124,158 | Suppose I have two 5-digit numbers (A and B) and two 50-digit numbers(C and D). Do the operations **A+B** and **C+D** have equal complexity in terms of time and space? or **C+D** is more complex due to the size of digits? | 2020/04/15 | [
"https://cs.stackexchange.com/questions/124158",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/119524/"
] | The complexity of arithmetic operations is typically measured in *bit operations*, though not everybody agrees this is the correct measure. There is a [Wikipedia page](https://en.wikipedia.org/wiki/Computational_complexity_of_mathematical_operations#Arithmetic_functions) listing the complexity of the best algorithms cu... | It depends on the model you use. [Yuval Filmus's answer](https://cs.stackexchange.com/a/124164/83244) assumes you use a [multitape Turing machine](https://en.wikipedia.org/wiki/Multitape_Turing_machine). This is also mentioned in [the Wikipedia page](https://en.wikipedia.org/wiki/Computational_complexity_of_mathematica... |
10,131,546 | I like to do my development over SSH on a remote server -- is there any way to run and access meteor's debug server in that situation?
It listens for <http://localhost://3000>, not on <http://example.com://3000>, so I can't access it.
Thanks! | 2012/04/12 | [
"https://Stackoverflow.com/questions/10131546",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/573180/"
] | I just found the code in app/meteor/run.js and hardcoded the Status.listening statement's host value to my host, and it worked for now! Perhaps --host can be added as an option to "meteor run" in the future as a sustainable solution. | you could also do an ssh local port forward, more information is [here](http://magazine.redhat.com/2007/11/06/ssh-port-forwarding/#local). |
1,546,535 | I have the following URL:
```
http://domain.com/index.php?m=feedback&cSubject=My Subject
```
I want to have a rewrite rule so that the following:
```
http://domain.com/feedback?Subject=My Subject
```
maps to the previous url. Heres my rule at the moment:
```
RewriteRule ^feedback?Subject=(.*)$ index.php?m=feedba... | 2009/10/09 | [
"https://Stackoverflow.com/questions/1546535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/82586/"
] | Query Strings are not parsed by Apache Mod\_Rewrite, but there is a workaround. Try this
```
RewriteRule ^feedback/?$ index.php?m=feedback&c%{QUERY_STRING} [NC,L]
``` | You can use RewriteCond statement to do exactly what you want:
```
RewriteEngine On
RewriteCond %{QUERY_STRING} Subject=(.*)
RewriteRule ^feedback$ index.php?m=feedback&cSubject=%1 [L]
``` |
1,546,535 | I have the following URL:
```
http://domain.com/index.php?m=feedback&cSubject=My Subject
```
I want to have a rewrite rule so that the following:
```
http://domain.com/feedback?Subject=My Subject
```
maps to the previous url. Heres my rule at the moment:
```
RewriteRule ^feedback?Subject=(.*)$ index.php?m=feedba... | 2009/10/09 | [
"https://Stackoverflow.com/questions/1546535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/82586/"
] | Query Strings are not parsed by Apache Mod\_Rewrite, but there is a workaround. Try this
```
RewriteRule ^feedback/?$ index.php?m=feedback&c%{QUERY_STRING} [NC,L]
``` | There seems to be an = missing from clops answer to give..
```
RewriteRule ^feedback/?$ index.php?m=feedback&c=%{QUERY_STRING} [NC,L]
```
.. at least I need one to make it work. |
1,546,535 | I have the following URL:
```
http://domain.com/index.php?m=feedback&cSubject=My Subject
```
I want to have a rewrite rule so that the following:
```
http://domain.com/feedback?Subject=My Subject
```
maps to the previous url. Heres my rule at the moment:
```
RewriteRule ^feedback?Subject=(.*)$ index.php?m=feedba... | 2009/10/09 | [
"https://Stackoverflow.com/questions/1546535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/82586/"
] | You can use RewriteCond statement to do exactly what you want:
```
RewriteEngine On
RewriteCond %{QUERY_STRING} Subject=(.*)
RewriteRule ^feedback$ index.php?m=feedback&cSubject=%1 [L]
``` | There seems to be an = missing from clops answer to give..
```
RewriteRule ^feedback/?$ index.php?m=feedback&c=%{QUERY_STRING} [NC,L]
```
.. at least I need one to make it work. |
63,567,252 | All the programming I have learnt is through manuals and websites such as this. So I wouldn't call myself a programmer but I do use a lot of quick and dirty macros to make my life easier. Occasionally, it all falls down and assistance is required!
I have a workbook that summarises the jobs I have worked on. In order t... | 2020/08/24 | [
"https://Stackoverflow.com/questions/63567252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9847670/"
] | Under the modern experience, you can only copy a site page to the same Site Pages library in the same site. You could vote on this idea in uservoice:
<https://sharepoint.uservoice.com/forums/329214-sites-and-collaboration/suggestions/35035618-add-the-ability-to-copy-a-modern-site-page-from-on>
As a workaround, you co... | This still doesn't seem to be an option.
Here's a flow I made to accomplish this
[Manually trigger a flow and ask for SourceSiteURL, PageName, DestinationURL and FailAction](https://i.stack.imgur.com/mOSXy.png)
[Init Integer variable for FailAction](https://i.stack.imgur.com/LLdxn.png)
[Switch to set fail action fro... |
56,263,515 | I have defined an existing table in redshift with certain columns. This is already being successfully mapped to from one S3 bucket using a jsonpaths definition & COPY FROM JSON command. This all works fine.
But I now have differently formatted data which is stored in a different S3 bucket and would like to also put th... | 2019/05/22 | [
"https://Stackoverflow.com/questions/56263515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5906010/"
] | The best way to approach this problem is to define default values in your table definition.
```
CREATE TABLE events (
platform_name VARCHAR(10),
app_id VARCHAR(10) default 'null',
app_version VARCHAR(10) default 'null'
)
```
Keep only the fields available in your dataset inside the map file
```
{
"j... | Let's take a different approach.
Leave your `events` table as is, create a new table `events2`? as
```
CREATE TABLE events2 (
platform_name VARCHAR(10)
)
```
Load `events2` table with
```
{
"jsonpaths": [
"$['platform']"
]
}
```
Create a view like the following to see all events data
```
CREATE VIEW all_eve... |
27,141,195 | Hi guys anybody knows how to evaluate y a string starts with symbol "@", i am trying
```
myvar.substring(0,1)==="@"
```
But it gives me error, any idea?
**UPDATE**
I am working with .NET and mvc4, so it recognizes the @ as a symbol for cshtml, i am looking for a way out to compare that symbol | 2014/11/26 | [
"https://Stackoverflow.com/questions/27141195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2777991/"
] | Instead of
```
myvar.substring(0,1)==="@"
```
Try
```
myvar.substring(0,1)==="@@" //use two '@' as shown here
``` | Try `charCodeAt` to get an integer for the character '@' so you don't need to use '@':
```
myvar.charCodeAt(0) === 64
``` |
142,112 | I have a table with a list of companies (only the most important properties):
[](https://i.stack.imgur.com/OElgH.png)
There is more data for each company, including another list of Licenses.
To expand that company details, should I use:
1. New **tab... | 2022/01/16 | [
"https://ux.stackexchange.com/questions/142112",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/144788/"
] | Both ways work, so that is not an issue.
Take a closer look at how your users work with the table:
* Do they only open the details to glance at them and then go on to other entries? - Then the accordion would be the better option.
* Do they open dsome entries from the list and then work within the details with few ... | As a user, I would prefer accordion as the primary UI for seeing company details. I'm just not sure if it should be exclusive, or should multiple ones be allowed to be open at the same time.
Multiple open at the same time would allow search + cross-comparison, using browser-native functionality. But it might get a bit... |
142,112 | I have a table with a list of companies (only the most important properties):
[](https://i.stack.imgur.com/OElgH.png)
There is more data for each company, including another list of Licenses.
To expand that company details, should I use:
1. New **tab... | 2022/01/16 | [
"https://ux.stackexchange.com/questions/142112",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/144788/"
] | Both ways work, so that is not an issue.
Take a closer look at how your users work with the table:
* Do they only open the details to glance at them and then go on to other entries? - Then the accordion would be the better option.
* Do they open dsome entries from the list and then work within the details with few ... | If you are in a browser you should most likely open a native-browser tab, since the user is familiar with those. The user can place multiple browser windows on multiple monitors and arrange them however he likes, or even save tabs as bookmarks.
The main benefit of an accordion is if you want to quickly show the detail... |
387,357 | I would like to setup an IDS/IPS (network intrusion prevention and detection system) like [snort](http://www.snort.org/), but I would prefer not have to dedicate a computer to handle it.
Are there any applications or routers that can be hacked or some other free or not too expensive IDS that I could use?
I would pref... | 2012/02/08 | [
"https://superuser.com/questions/387357",
"https://superuser.com",
"https://superuser.com/users/65742/"
] | Try out [Suricata](http://www.openinfosecfoundation.org/index.php/download-suricata).
>
> Suricata is a rule-based ID/PS engine that utilises externally
> developed rule sets to monitor network traffic and provide alerts to
> the system administrator when suspicious events occur. Designed to be
> compatible with ... | You can run snort on your local machine, either through a virtual machine or directly if you're running a unix variant already. Unfortunately advanced intrusion detection systems require huge signature files and a lot of processing power to run in real time which is going to rule out all consumer routers. The big enter... |
33,640,805 | I'm using `npm` `3.3.6` and when I try to install a bunch of modules I get the error below:
`npm i babel-cli babel-plugin-syntax-async-functions babel-plugin-transform-regenerator babel-polyfill babel-preset-es2015 babelify watchify browserify --save-dev`
```
npm ERR! Darwin 15.0.0
npm ERR! argv "/Users/thomas/.nvm/v... | 2015/11/10 | [
"https://Stackoverflow.com/questions/33640805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/340688/"
] | I am seeing a similar issue. The issue is caused when the node\_modules directory exists and you run npm install. There is some name collision. If you remove the node\_modules directory you won't have the issue. | I had a very similar issue and it was because I was trying to do an npm install from a mounted HGFS volume in Ubunutu.
This is because I use VMWare Fusion on OSX to virtualise Ubuntu, then mount shared OSX directories in Ubuntu.
Another npm install with the same source in a non-mounted directory (ie, my Ubuntu home f... |
33,640,805 | I'm using `npm` `3.3.6` and when I try to install a bunch of modules I get the error below:
`npm i babel-cli babel-plugin-syntax-async-functions babel-plugin-transform-regenerator babel-polyfill babel-preset-es2015 babelify watchify browserify --save-dev`
```
npm ERR! Darwin 15.0.0
npm ERR! argv "/Users/thomas/.nvm/v... | 2015/11/10 | [
"https://Stackoverflow.com/questions/33640805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/340688/"
] | I had a very similar issue and it was because I was trying to do an npm install from a mounted HGFS volume in Ubunutu.
This is because I use VMWare Fusion on OSX to virtualise Ubuntu, then mount shared OSX directories in Ubuntu.
Another npm install with the same source in a non-mounted directory (ie, my Ubuntu home f... | When I have had this error I kill/close all running instances of node in my task manager (process explorer on windows). It's often vscode or webstorm that has an open node process running. For me after closing these programs and ensuring there is no running node processes npm install will now work again. |
33,640,805 | I'm using `npm` `3.3.6` and when I try to install a bunch of modules I get the error below:
`npm i babel-cli babel-plugin-syntax-async-functions babel-plugin-transform-regenerator babel-polyfill babel-preset-es2015 babelify watchify browserify --save-dev`
```
npm ERR! Darwin 15.0.0
npm ERR! argv "/Users/thomas/.nvm/v... | 2015/11/10 | [
"https://Stackoverflow.com/questions/33640805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/340688/"
] | I am seeing a similar issue. The issue is caused when the node\_modules directory exists and you run npm install. There is some name collision. If you remove the node\_modules directory you won't have the issue. | When I have had this error I kill/close all running instances of node in my task manager (process explorer on windows). It's often vscode or webstorm that has an open node process running. For me after closing these programs and ensuring there is no running node processes npm install will now work again. |
43,530,464 | I want to achieve some kind of half transparent color overlay over hover on a table row, I created a little [DEMO](https://jsfiddle.net/d3xx2zxw/) here.
However I don't want the text to be altered in any way, so just the background, and the reason I want it to be kind of a overlay is that I just want the cells to be s... | 2017/04/20 | [
"https://Stackoverflow.com/questions/43530464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7015437/"
] | No need for JavaScript. CSS to the rescue!
This sets the background colors slightly darker on hover. You can play with the actual color values to make the colors darker or lighter on hover.
```css
.prTableCell {
padding: 7px;
width: 60px;
text-align: center;
border: 1px solid #e1e1e1;
cursor: default;
... | If I'm understanding you correctly, you were very close with your `rgba` background(except that you were targeting the row and not the cells). Is this what you're looking for?
```js
$(document).ready(function () {
$("table#compTable .prTableCell:even").css("background-color", "#eeeeee");
$("table#compTable .... |
43,530,464 | I want to achieve some kind of half transparent color overlay over hover on a table row, I created a little [DEMO](https://jsfiddle.net/d3xx2zxw/) here.
However I don't want the text to be altered in any way, so just the background, and the reason I want it to be kind of a overlay is that I just want the cells to be s... | 2017/04/20 | [
"https://Stackoverflow.com/questions/43530464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7015437/"
] | If I'm understanding you correctly, you were very close with your `rgba` background(except that you were targeting the row and not the cells). Is this what you're looking for?
```js
$(document).ready(function () {
$("table#compTable .prTableCell:even").css("background-color", "#eeeeee");
$("table#compTable .... | annswer at <https://jsfiddle.net/v9jphr5h/>
```
tr:nth-child(2n)
{
background-color:#ffe;
}
tr:nth-child(n+2):hover>td,
tr:nth-child(n+2):hover>td.prTableCell[title]{
background: rgba(204, 204, 204, 0.5)
}
```
bottom line:
- your rgba-approach works
- absolutely no need for jquery
- (unless you want to co... |
43,530,464 | I want to achieve some kind of half transparent color overlay over hover on a table row, I created a little [DEMO](https://jsfiddle.net/d3xx2zxw/) here.
However I don't want the text to be altered in any way, so just the background, and the reason I want it to be kind of a overlay is that I just want the cells to be s... | 2017/04/20 | [
"https://Stackoverflow.com/questions/43530464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7015437/"
] | No need for JavaScript. CSS to the rescue!
This sets the background colors slightly darker on hover. You can play with the actual color values to make the colors darker or lighter on hover.
```css
.prTableCell {
padding: 7px;
width: 60px;
text-align: center;
border: 1px solid #e1e1e1;
cursor: default;
... | annswer at <https://jsfiddle.net/v9jphr5h/>
```
tr:nth-child(2n)
{
background-color:#ffe;
}
tr:nth-child(n+2):hover>td,
tr:nth-child(n+2):hover>td.prTableCell[title]{
background: rgba(204, 204, 204, 0.5)
}
```
bottom line:
- your rgba-approach works
- absolutely no need for jquery
- (unless you want to co... |
95,834 | A recent question about Kol Isha got me thinking: why isn't there a similar "Kol Ish" prohibition against women hearing men sing?
If you've ever seen a teenage girl listening to pop music you'd know there's an attraction to a male voice.
I tried googling it and found nothing (besides an all-male acapella group calle... | 2018/10/04 | [
"https://judaism.stackexchange.com/questions/95834",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/18059/"
] | [Sefer Chasidim 614](https://www.sefaria.org/Sefer_Hasidim.614?lang=bi)
>
> מכל מה שכתוב בשיר השירים צריך להזהר שלא ישמע קול אשה והוא הדין לאשה שלא תשמע קול איש. שמכל שהאיש מוזהר האשה מוזהרת.
>
> One must be careful from anything in Shir Hashirim, to not hear a woman's voice, and the same law to a woman to not h... | On one level the answer may be that the derivative source for *kol isha* does not exist for *kol ish*. The issue of *kol isha* is presented in the Talmud ([Berachot 24a](http://hebrewbooks.org/shas.aspx?mesechta=1&daf=24&format=pdf)) as follows:
>
> א"ר יצחק טפח באשה ערוה למאי אילימא לאסתכולי בה והא א"ר ששת למה מנה
>... |
42,052,723 | I'm trying to get data from a SQL Server 2000 database and insert it into another database in SQL Server 2012.
The linked server was created, but I get an error when I use `SELECT` from one of the tables.
Something like this:
```
SELECT *
FROM linked_server_name.database_name.schema.table_name
```
Error:
>
> SQ... | 2017/02/05 | [
"https://Stackoverflow.com/questions/42052723",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5164438/"
] | Use the "Microsoft OLE DB Provider for SQL Server" (SQLOLEDB) OLE DB provider, not SQL Server Native Client 11.0" (SQLNCLI11) OLE DB provider to access SQL Server 2000. Although SQLOLEDB is deprecated, you'll need to use it for SQL Server 2000, which is unsupported anyway. | Here is how I fixed it today using SQL Server 2014 on Windows 8.1 Pro. I was trying to add a Linked Server for a remote SQL Server 2000 instance. While using the ***SQL Server Native Client 11.0*** I received the same error as the OP.
Then I tried creating an ODBC data source on my machine, using "**ODBC Driver 11 fo... |
45,046,738 | I'm trying to scrape a website and want to get all the descendants of a specific div class. For example, suppose I have a website that looks like the following:
[Edit: The question's author indicates in the comments that all of the `div` elements should be at the same level; I've therefore taken the liberty of closing... | 2017/07/12 | [
"https://Stackoverflow.com/questions/45046738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7237305/"
] | Ultimately, I came up with this solution. The "children" object captured all children of 'div' and successive children; then I iterated over that
```
children = soup.findChildren('div', {'class': 'i-want-this'})
content = []
for item in children:
item = [content for content in item.text.split('\n') if len(cont... | This might be what you want:
```
div = soup.find_all('div', {'class': 'i-want-this'})
for e in div:
print (e.descendents) #or append to list, or whatever you're trying to do.
``` |
45,046,738 | I'm trying to scrape a website and want to get all the descendants of a specific div class. For example, suppose I have a website that looks like the following:
[Edit: The question's author indicates in the comments that all of the `div` elements should be at the same level; I've therefore taken the liberty of closing... | 2017/07/12 | [
"https://Stackoverflow.com/questions/45046738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7237305/"
] | This might be what you want:
```
div = soup.find_all('div', {'class': 'i-want-this'})
for e in div:
print (e.descendents) #or append to list, or whatever you're trying to do.
``` | I shoved your HTML into a file called `temp.htm`.
You need only a tiny part of scrapy for tasks like this: `Selector`. Just feed your HTML into it, then use its `xpath` method.
In this case I can specify one of the two `div` elements with the `class` of interest, by number, then ask for all of its descendants and the... |
45,046,738 | I'm trying to scrape a website and want to get all the descendants of a specific div class. For example, suppose I have a website that looks like the following:
[Edit: The question's author indicates in the comments that all of the `div` elements should be at the same level; I've therefore taken the liberty of closing... | 2017/07/12 | [
"https://Stackoverflow.com/questions/45046738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7237305/"
] | Ultimately, I came up with this solution. The "children" object captured all children of 'div' and successive children; then I iterated over that
```
children = soup.findChildren('div', {'class': 'i-want-this'})
content = []
for item in children:
item = [content for content in item.text.split('\n') if len(cont... | I shoved your HTML into a file called `temp.htm`.
You need only a tiny part of scrapy for tasks like this: `Selector`. Just feed your HTML into it, then use its `xpath` method.
In this case I can specify one of the two `div` elements with the `class` of interest, by number, then ask for all of its descendants and the... |
6,655,177 | I am trying to detect ALL versions of IE by using jquery `$.browser.msie`.
It works for 8, 7, 6, but it ignores IE9. Why is that and what is a solution for javascript to detect ie9?
JS version: jQuery JavaScript Library **v1.5** | 2011/07/11 | [
"https://Stackoverflow.com/questions/6655177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/266250/"
] | IE9 can emulate older browsers, causing the variety of "works/doesn't work" responses you see here.
"Trident/5.0" is present in IE9's user-agent string in all modes, according to [this SO question](https://stackoverflow.com/questions/5825385/javascript-can-i-detect-ie9-if-its-in-ie7-or-ie8-compatibility-mode). | It works for me: <http://jsfiddle.net/jcxXH/> |
6,655,177 | I am trying to detect ALL versions of IE by using jquery `$.browser.msie`.
It works for 8, 7, 6, but it ignores IE9. Why is that and what is a solution for javascript to detect ie9?
JS version: jQuery JavaScript Library **v1.5** | 2011/07/11 | [
"https://Stackoverflow.com/questions/6655177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/266250/"
] | As of version `1.9` of jQuery `$.browser` is no longer supported. Use `jQuery.suport` instead. With this change you'll need to check on what functionality you want to check. So just browser check is no longer supported in it. It is recommended to do a feature check instead of browser check.
[Docs here](http://api.jque... | It works for me: <http://jsfiddle.net/jcxXH/> |
6,655,177 | I am trying to detect ALL versions of IE by using jquery `$.browser.msie`.
It works for 8, 7, 6, but it ignores IE9. Why is that and what is a solution for javascript to detect ie9?
JS version: jQuery JavaScript Library **v1.5** | 2011/07/11 | [
"https://Stackoverflow.com/questions/6655177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/266250/"
] | It works for me: <http://jsfiddle.net/jcxXH/> | you can override the detection of IE noFullScreen: { msie: /msie [0-6]/, ... } to
noFullScreen: { msie: /abcdefgh/ } |
6,655,177 | I am trying to detect ALL versions of IE by using jquery `$.browser.msie`.
It works for 8, 7, 6, but it ignores IE9. Why is that and what is a solution for javascript to detect ie9?
JS version: jQuery JavaScript Library **v1.5** | 2011/07/11 | [
"https://Stackoverflow.com/questions/6655177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/266250/"
] | IE9 can emulate older browsers, causing the variety of "works/doesn't work" responses you see here.
"Trident/5.0" is present in IE9's user-agent string in all modes, according to [this SO question](https://stackoverflow.com/questions/5825385/javascript-can-i-detect-ie9-if-its-in-ie7-or-ie8-compatibility-mode). | you can override the detection of IE noFullScreen: { msie: /msie [0-6]/, ... } to
noFullScreen: { msie: /abcdefgh/ } |
6,655,177 | I am trying to detect ALL versions of IE by using jquery `$.browser.msie`.
It works for 8, 7, 6, but it ignores IE9. Why is that and what is a solution for javascript to detect ie9?
JS version: jQuery JavaScript Library **v1.5** | 2011/07/11 | [
"https://Stackoverflow.com/questions/6655177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/266250/"
] | As of version `1.9` of jQuery `$.browser` is no longer supported. Use `jQuery.suport` instead. With this change you'll need to check on what functionality you want to check. So just browser check is no longer supported in it. It is recommended to do a feature check instead of browser check.
[Docs here](http://api.jque... | you can override the detection of IE noFullScreen: { msie: /msie [0-6]/, ... } to
noFullScreen: { msie: /abcdefgh/ } |
4,517,198 | I would like to get current mouse position but I don't want to use:
```
$(document).bind('mousemove',function(e){
$("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
});
```
because I just need to get the position and process the information | 2010/12/23 | [
"https://Stackoverflow.com/questions/4517198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99256/"
] | I don't believe there's a way to *query* the mouse position, but you can use a `mousemove` handler that just stores the information away, so you can query the stored information.
```
jQuery(function($) {
var currentMousePos = { x: -1, y: -1 };
$(document).mousemove(function(event) {
currentMousePos.x =... | Moreover, `mousemove` events are not triggered if you perform drag'n'drop over a browser window.
To track mouse coordinates during drag'n'drop you should attach handler for `document.ondragover` event and use it's originalEvent property.
*Example:*
```
var globalDragOver = function (e)
{
var original = e.original... |
4,517,198 | I would like to get current mouse position but I don't want to use:
```
$(document).bind('mousemove',function(e){
$("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
});
```
because I just need to get the position and process the information | 2010/12/23 | [
"https://Stackoverflow.com/questions/4517198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99256/"
] | You can't read mouse position in jQuery without using an event. Note firstly that the `event.pageX` and `event.pageY` properties exists on any event, so you could do:
```
$('#myEl').click(function(e) {
console.log(e.pageX);
});
```
Your other option is to use a closure to give your whole code access to a variabl... | ```
var CurrentMouseXPostion;
var CurrentMouseYPostion;
$(document).mousemove(function(event) {
CurrentMouseXPostion = event.pageX;
CurrentMouseYPostion = event.pageY;
});
```
Make an eventListener on the main object , in my case the document object, to get the mouse coords every frame and store them in glob... |
4,517,198 | I would like to get current mouse position but I don't want to use:
```
$(document).bind('mousemove',function(e){
$("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
});
```
because I just need to get the position and process the information | 2010/12/23 | [
"https://Stackoverflow.com/questions/4517198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99256/"
] | I used this method:
```
$(document).mousemove(function(e) {
window.x = e.pageX;
window.y = e.pageY;
});
function show_popup(str) {
$("#popup_content").html(str);
$("#popup").fadeIn("fast");
$("#popup").css("top", y);
$("#popup").css("left", x);
}
```
In this way I'll always have the distance... | ```
var CurrentMouseXPostion;
var CurrentMouseYPostion;
$(document).mousemove(function(event) {
CurrentMouseXPostion = event.pageX;
CurrentMouseYPostion = event.pageY;
});
```
Make an eventListener on the main object , in my case the document object, to get the mouse coords every frame and store them in glob... |
4,517,198 | I would like to get current mouse position but I don't want to use:
```
$(document).bind('mousemove',function(e){
$("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
});
```
because I just need to get the position and process the information | 2010/12/23 | [
"https://Stackoverflow.com/questions/4517198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99256/"
] | use `window.event` - it contains last `event` and as any `event` contains `pageX`, `pageY` etc. Works for Chrome, Safari, IE but not FF. | ```
var CurrentMouseXPostion;
var CurrentMouseYPostion;
$(document).mousemove(function(event) {
CurrentMouseXPostion = event.pageX;
CurrentMouseYPostion = event.pageY;
});
```
Make an eventListener on the main object , in my case the document object, to get the mouse coords every frame and store them in glob... |
4,517,198 | I would like to get current mouse position but I don't want to use:
```
$(document).bind('mousemove',function(e){
$("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
});
```
because I just need to get the position and process the information | 2010/12/23 | [
"https://Stackoverflow.com/questions/4517198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99256/"
] | I don't believe there's a way to *query* the mouse position, but you can use a `mousemove` handler that just stores the information away, so you can query the stored information.
```
jQuery(function($) {
var currentMousePos = { x: -1, y: -1 };
$(document).mousemove(function(event) {
currentMousePos.x =... | I used this method:
```
$(document).mousemove(function(e) {
window.x = e.pageX;
window.y = e.pageY;
});
function show_popup(str) {
$("#popup_content").html(str);
$("#popup").fadeIn("fast");
$("#popup").css("top", y);
$("#popup").css("left", x);
}
```
In this way I'll always have the distance... |
4,517,198 | I would like to get current mouse position but I don't want to use:
```
$(document).bind('mousemove',function(e){
$("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
});
```
because I just need to get the position and process the information | 2010/12/23 | [
"https://Stackoverflow.com/questions/4517198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99256/"
] | I don't believe there's a way to *query* the mouse position, but you can use a `mousemove` handler that just stores the information away, so you can query the stored information.
```
jQuery(function($) {
var currentMousePos = { x: -1, y: -1 };
$(document).mousemove(function(event) {
currentMousePos.x =... | use `window.event` - it contains last `event` and as any `event` contains `pageX`, `pageY` etc. Works for Chrome, Safari, IE but not FF. |
4,517,198 | I would like to get current mouse position but I don't want to use:
```
$(document).bind('mousemove',function(e){
$("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
});
```
because I just need to get the position and process the information | 2010/12/23 | [
"https://Stackoverflow.com/questions/4517198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99256/"
] | You can't read mouse position in jQuery without using an event. Note firstly that the `event.pageX` and `event.pageY` properties exists on any event, so you could do:
```
$('#myEl').click(function(e) {
console.log(e.pageX);
});
```
Your other option is to use a closure to give your whole code access to a variabl... | I came across this, tot it would be nice to share...
What do you guys think?
```
$(document).ready(function() {
window.mousemove = function(e) {
p = $(e).position(); //remember $(e) - could be any html tag also..
left = e.left; //retrieving the left position of the div...
top = e.top; ... |
4,517,198 | I would like to get current mouse position but I don't want to use:
```
$(document).bind('mousemove',function(e){
$("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
});
```
because I just need to get the position and process the information | 2010/12/23 | [
"https://Stackoverflow.com/questions/4517198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99256/"
] | ```
var CurrentMouseXPostion;
var CurrentMouseYPostion;
$(document).mousemove(function(event) {
CurrentMouseXPostion = event.pageX;
CurrentMouseYPostion = event.pageY;
});
```
Make an eventListener on the main object , in my case the document object, to get the mouse coords every frame and store them in glob... | I came across this, tot it would be nice to share...
What do you guys think?
```
$(document).ready(function() {
window.mousemove = function(e) {
p = $(e).position(); //remember $(e) - could be any html tag also..
left = e.left; //retrieving the left position of the div...
top = e.top; ... |
4,517,198 | I would like to get current mouse position but I don't want to use:
```
$(document).bind('mousemove',function(e){
$("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
});
```
because I just need to get the position and process the information | 2010/12/23 | [
"https://Stackoverflow.com/questions/4517198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99256/"
] | You can't read mouse position in jQuery without using an event. Note firstly that the `event.pageX` and `event.pageY` properties exists on any event, so you could do:
```
$('#myEl').click(function(e) {
console.log(e.pageX);
});
```
Your other option is to use a closure to give your whole code access to a variabl... | I used this method:
```
$(document).mousemove(function(e) {
window.x = e.pageX;
window.y = e.pageY;
});
function show_popup(str) {
$("#popup_content").html(str);
$("#popup").fadeIn("fast");
$("#popup").css("top", y);
$("#popup").css("left", x);
}
```
In this way I'll always have the distance... |
4,517,198 | I would like to get current mouse position but I don't want to use:
```
$(document).bind('mousemove',function(e){
$("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
});
```
because I just need to get the position and process the information | 2010/12/23 | [
"https://Stackoverflow.com/questions/4517198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99256/"
] | Moreover, `mousemove` events are not triggered if you perform drag'n'drop over a browser window.
To track mouse coordinates during drag'n'drop you should attach handler for `document.ondragover` event and use it's originalEvent property.
*Example:*
```
var globalDragOver = function (e)
{
var original = e.original... | I came across this, tot it would be nice to share...
What do you guys think?
```
$(document).ready(function() {
window.mousemove = function(e) {
p = $(e).position(); //remember $(e) - could be any html tag also..
left = e.left; //retrieving the left position of the div...
top = e.top; ... |
38,111,317 | WiX bundle does not allow me to install SqlLocalDB.msi silently and errors out stating following :
>
> The required IACCEPTSQLNCLILICENSETERMS=YES command-line parameter is missing. By specifying this parameter, you acknowledge that you accept the end user license terms for SQL Server 2016.
>
>
>
I tried to inser... | 2016/06/29 | [
"https://Stackoverflow.com/questions/38111317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1076116/"
] | So I actually asked this on mailing list and got the answer.
```
<MsiPackage SourceFile="SqlLocalDB.msi" Vital="yes" DisplayInternalUI="no">
<MsiProperty Name="ALLUSERS" Value="1"/>
<MsiProperty Name="IACCEPTSQLNCLILICENSETERMS" Value="YES"/>
</MsiPackage>
```
Just adding ALLUSERS MsiProperty solved the issu... | Can you try this? I am not able to test this now, but I think this should work.
```
<MsiPackage SourceFile="SqlLocalDB.msi" Vital="yes" DisplayInternalUI="no">
<MsiProperty Name="IACCEPTSQLNCLILICENSETERMS" Value="YES"/>
</MsiPackage>
``` |
38,111,317 | WiX bundle does not allow me to install SqlLocalDB.msi silently and errors out stating following :
>
> The required IACCEPTSQLNCLILICENSETERMS=YES command-line parameter is missing. By specifying this parameter, you acknowledge that you accept the end user license terms for SQL Server 2016.
>
>
>
I tried to inser... | 2016/06/29 | [
"https://Stackoverflow.com/questions/38111317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1076116/"
] | Can you try this? I am not able to test this now, but I think this should work.
```
<MsiPackage SourceFile="SqlLocalDB.msi" Vital="yes" DisplayInternalUI="no">
<MsiProperty Name="IACCEPTSQLNCLILICENSETERMS" Value="YES"/>
</MsiPackage>
``` | Keep in mind that newer SqlLocalDB installers ask you to accept the 'sqllocaldb' license terms so add the property
```
<MsiProperty Name="IACCEPTSQLLOCALDBLICENSETERMS" Value="YES" />
``` |
38,111,317 | WiX bundle does not allow me to install SqlLocalDB.msi silently and errors out stating following :
>
> The required IACCEPTSQLNCLILICENSETERMS=YES command-line parameter is missing. By specifying this parameter, you acknowledge that you accept the end user license terms for SQL Server 2016.
>
>
>
I tried to inser... | 2016/06/29 | [
"https://Stackoverflow.com/questions/38111317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1076116/"
] | So I actually asked this on mailing list and got the answer.
```
<MsiPackage SourceFile="SqlLocalDB.msi" Vital="yes" DisplayInternalUI="no">
<MsiProperty Name="ALLUSERS" Value="1"/>
<MsiProperty Name="IACCEPTSQLNCLILICENSETERMS" Value="YES"/>
</MsiPackage>
```
Just adding ALLUSERS MsiProperty solved the issu... | WIX V4
add WixUtilExtension to your project references then add the following line inside the Wix tag
```
xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"
```
add this to check if it's already installed or not
```
<util:RegistrySearch Id="Sql32" Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server Local ... |
38,111,317 | WiX bundle does not allow me to install SqlLocalDB.msi silently and errors out stating following :
>
> The required IACCEPTSQLNCLILICENSETERMS=YES command-line parameter is missing. By specifying this parameter, you acknowledge that you accept the end user license terms for SQL Server 2016.
>
>
>
I tried to inser... | 2016/06/29 | [
"https://Stackoverflow.com/questions/38111317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1076116/"
] | So I actually asked this on mailing list and got the answer.
```
<MsiPackage SourceFile="SqlLocalDB.msi" Vital="yes" DisplayInternalUI="no">
<MsiProperty Name="ALLUSERS" Value="1"/>
<MsiProperty Name="IACCEPTSQLNCLILICENSETERMS" Value="YES"/>
</MsiPackage>
```
Just adding ALLUSERS MsiProperty solved the issu... | Keep in mind that newer SqlLocalDB installers ask you to accept the 'sqllocaldb' license terms so add the property
```
<MsiProperty Name="IACCEPTSQLLOCALDBLICENSETERMS" Value="YES" />
``` |
38,111,317 | WiX bundle does not allow me to install SqlLocalDB.msi silently and errors out stating following :
>
> The required IACCEPTSQLNCLILICENSETERMS=YES command-line parameter is missing. By specifying this parameter, you acknowledge that you accept the end user license terms for SQL Server 2016.
>
>
>
I tried to inser... | 2016/06/29 | [
"https://Stackoverflow.com/questions/38111317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1076116/"
] | WIX V4
add WixUtilExtension to your project references then add the following line inside the Wix tag
```
xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"
```
add this to check if it's already installed or not
```
<util:RegistrySearch Id="Sql32" Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server Local ... | Keep in mind that newer SqlLocalDB installers ask you to accept the 'sqllocaldb' license terms so add the property
```
<MsiProperty Name="IACCEPTSQLLOCALDBLICENSETERMS" Value="YES" />
``` |
38,766,699 | This code works to click on a specific location on the screen but how do you click at the cursor's coordinates?
```
tell application "System Events"
click at {10, 10}
end tell
``` | 2016/08/04 | [
"https://Stackoverflow.com/questions/38766699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1512804/"
] | below an example with python in applescript , python is living in your system naturaly,no installation to be planned.
```
set x to 30
set y to 5
set l to 50 -- click same location 50 times
do shell script "
/usr/bin/python <<END
import sys
import time
from Quartz.CoreGraphics import *
def mouseEvent(type, posx... | You should definitely grab the AppleScript toolbox. It has scripting commands to get your mouse location and mouse clicking. [AppleScript Toolbox is a scripting addition/AppleScript-plugin (a.k.a. “OSAX”) providing commands not available in regular AppleScript](https://astoolbox.wordpress.com). |
38,766,699 | This code works to click on a specific location on the screen but how do you click at the cursor's coordinates?
```
tell application "System Events"
click at {10, 10}
end tell
``` | 2016/08/04 | [
"https://Stackoverflow.com/questions/38766699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1512804/"
] | You can also in applescrit using command-tool cliclick
```
dowload https://github.com/BlueM/cliclick
unzip cliclick-master.zip
in a Terminal
cd /Users/yourname/Downloads/cliclick-master
make
now you have in /Users/yourname/Downloads/cliclick-master/
cliclick , command tool for using a mouse in applescript with ... | You should definitely grab the AppleScript toolbox. It has scripting commands to get your mouse location and mouse clicking. [AppleScript Toolbox is a scripting addition/AppleScript-plugin (a.k.a. “OSAX”) providing commands not available in regular AppleScript](https://astoolbox.wordpress.com). |
38,766,699 | This code works to click on a specific location on the screen but how do you click at the cursor's coordinates?
```
tell application "System Events"
click at {10, 10}
end tell
``` | 2016/08/04 | [
"https://Stackoverflow.com/questions/38766699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1512804/"
] | ```
use framework "Foundation"
property NSEvent : a reference to current application's NSEvent
property NSScreen : a reference to current application's NSScreen
# Get display size
set display to NSDeviceSize ¬
of deviceDescription() ¬
of item 1 ¬
of NSScreen's screens() as ... | You should definitely grab the AppleScript toolbox. It has scripting commands to get your mouse location and mouse clicking. [AppleScript Toolbox is a scripting addition/AppleScript-plugin (a.k.a. “OSAX”) providing commands not available in regular AppleScript](https://astoolbox.wordpress.com). |
38,766,699 | This code works to click on a specific location on the screen but how do you click at the cursor's coordinates?
```
tell application "System Events"
click at {10, 10}
end tell
``` | 2016/08/04 | [
"https://Stackoverflow.com/questions/38766699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1512804/"
] | below an example with python in applescript , python is living in your system naturaly,no installation to be planned.
```
set x to 30
set y to 5
set l to 50 -- click same location 50 times
do shell script "
/usr/bin/python <<END
import sys
import time
from Quartz.CoreGraphics import *
def mouseEvent(type, posx... | I created a command line tool in Xcode using the Swift programming language to produce an executable:
```
// Location of Mouse pointer
var ml = NSEvent.mouseLocation
ml.y = NSHeight(NSScreen.screens[0].frame) - ml.y
let location = CGPoint(x: ml.x, y: ml.y)
// Single mouse click.
var e = CGEven... |
38,766,699 | This code works to click on a specific location on the screen but how do you click at the cursor's coordinates?
```
tell application "System Events"
click at {10, 10}
end tell
``` | 2016/08/04 | [
"https://Stackoverflow.com/questions/38766699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1512804/"
] | You can also in applescrit using command-tool cliclick
```
dowload https://github.com/BlueM/cliclick
unzip cliclick-master.zip
in a Terminal
cd /Users/yourname/Downloads/cliclick-master
make
now you have in /Users/yourname/Downloads/cliclick-master/
cliclick , command tool for using a mouse in applescript with ... | I created a command line tool in Xcode using the Swift programming language to produce an executable:
```
// Location of Mouse pointer
var ml = NSEvent.mouseLocation
ml.y = NSHeight(NSScreen.screens[0].frame) - ml.y
let location = CGPoint(x: ml.x, y: ml.y)
// Single mouse click.
var e = CGEven... |
38,766,699 | This code works to click on a specific location on the screen but how do you click at the cursor's coordinates?
```
tell application "System Events"
click at {10, 10}
end tell
``` | 2016/08/04 | [
"https://Stackoverflow.com/questions/38766699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1512804/"
] | ```
use framework "Foundation"
property NSEvent : a reference to current application's NSEvent
property NSScreen : a reference to current application's NSScreen
# Get display size
set display to NSDeviceSize ¬
of deviceDescription() ¬
of item 1 ¬
of NSScreen's screens() as ... | I created a command line tool in Xcode using the Swift programming language to produce an executable:
```
// Location of Mouse pointer
var ml = NSEvent.mouseLocation
ml.y = NSHeight(NSScreen.screens[0].frame) - ml.y
let location = CGPoint(x: ml.x, y: ml.y)
// Single mouse click.
var e = CGEven... |
95,563 | I am looking for the word/phrase that is used to say that a (potential) erroneous conclusion has been drawn from data without having a correlation to other supporting data points.
For example, if someone has the dataset of the number of red cars sold in the US per month as `Jan: 10, Feb: 10, Mar: 9, Apr: 8, May: 7, et... | 2014/04/28 | [
"https://stats.stackexchange.com/questions/95563",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/44612/"
] | I am not clear that you need a technical term here. In your example, someone is jumping to a conclusion based on looking at some of the data only.
We often do that in real life, as when we judge something or someone by first or brief acquaintance. Sometimes it works; sometimes it doesn't. When we judge the temperatur... | What you're describing can be summarized as "no control or comparison condition." |
30,406,066 | ```
CREATE TABLE `movies`.`movie`
( `movie_id` INT(3) NULL AUTO_INCREMENT, `movie_name` VARCHAR(25) NULL,
`movie_embedded_id` VARCHAR(50) NULL, `rating_no` INT(3) NULL,
`movie_description` VARCHAR(50) NULL, PRIMARY KEY (`movie_id`(3))) ENGINE = InnoDB;
```
I keep getting this error:
>
> #1089 - Incorrect prefix... | 2015/05/22 | [
"https://Stackoverflow.com/questions/30406066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4847509/"
] | With the part
```
PRIMARY KEY (`movie_id`(3))
```
you are telling mysql to create a **sub part key\*** on the first 3 Bytes of movie id. This only works for string types.
You need to use
```
PRIMARY KEY (`movie_id`)
```
without providing a length.
\*Is this sure the query resulting in the error? Never saw th... | You can also get this error when creating an index if you specify a prefix length that is longer than the length of the actual column. If you tried to create an index containing `someColumn(20)` but in the table *someColumn* is `VARCHAR(15)`, then this error will occur. |
30,406,066 | ```
CREATE TABLE `movies`.`movie`
( `movie_id` INT(3) NULL AUTO_INCREMENT, `movie_name` VARCHAR(25) NULL,
`movie_embedded_id` VARCHAR(50) NULL, `rating_no` INT(3) NULL,
`movie_description` VARCHAR(50) NULL, PRIMARY KEY (`movie_id`(3))) ENGINE = InnoDB;
```
I keep getting this error:
>
> #1089 - Incorrect prefix... | 2015/05/22 | [
"https://Stackoverflow.com/questions/30406066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4847509/"
] | With the part
```
PRIMARY KEY (`movie_id`(3))
```
you are telling mysql to create a **sub part key\*** on the first 3 Bytes of movie id. This only works for string types.
You need to use
```
PRIMARY KEY (`movie_id`)
```
without providing a length.
\*Is this sure the query resulting in the error? Never saw th... | after selecting PRIMARY KEY when you create table, don't input any value in pop dialog |
30,406,066 | ```
CREATE TABLE `movies`.`movie`
( `movie_id` INT(3) NULL AUTO_INCREMENT, `movie_name` VARCHAR(25) NULL,
`movie_embedded_id` VARCHAR(50) NULL, `rating_no` INT(3) NULL,
`movie_description` VARCHAR(50) NULL, PRIMARY KEY (`movie_id`(3))) ENGINE = InnoDB;
```
I keep getting this error:
>
> #1089 - Incorrect prefix... | 2015/05/22 | [
"https://Stackoverflow.com/questions/30406066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4847509/"
] | after selecting PRIMARY KEY when you create table, don't input any value in pop dialog | You can also get this error when creating an index if you specify a prefix length that is longer than the length of the actual column. If you tried to create an index containing `someColumn(20)` but in the table *someColumn* is `VARCHAR(15)`, then this error will occur. |
25,734,008 | I need to make sure that a specific line is visible when the user loads the page, even if that line appears many lines later in the page. In other words, when the page loads, it instantly jumps to that marked line. The line simply needs to be somewhere within the visible screen of the browser window. It is marked like ... | 2014/09/08 | [
"https://Stackoverflow.com/questions/25734008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/834616/"
] | So if you can't edit the HTML at all, then you'll need to use JavaScript or jQuery. This is a function that I've used to scroll to an element.
Javascript
----------
This will query the DOM for all elements that have your class `scrollhere`. And we'll select just the first item in the array (to go to the first element... | This snippet may help you
```
$('html, body').animate({
scrollTop: ($('.class').first().offset().top)
},500);
``` |
25,734,008 | I need to make sure that a specific line is visible when the user loads the page, even if that line appears many lines later in the page. In other words, when the page loads, it instantly jumps to that marked line. The line simply needs to be somewhere within the visible screen of the browser window. It is marked like ... | 2014/09/08 | [
"https://Stackoverflow.com/questions/25734008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/834616/"
] | So if you can't edit the HTML at all, then you'll need to use JavaScript or jQuery. This is a function that I've used to scroll to an element.
Javascript
----------
This will query the DOM for all elements that have your class `scrollhere`. And we'll select just the first item in the array (to go to the first element... | This is a pure JavaScript example. No jQuery required.
Here is a simple example of this answer in [JSFiddle](http://jsfiddle.net/h1vyye9r/).
```
window.onload = function() {
var divs = document.getElementsByTagName("div");
for (var i in divs) {
if (divs[i].className.indexOf("class2") > -1) {
... |
25,734,008 | I need to make sure that a specific line is visible when the user loads the page, even if that line appears many lines later in the page. In other words, when the page loads, it instantly jumps to that marked line. The line simply needs to be somewhere within the visible screen of the browser window. It is marked like ... | 2014/09/08 | [
"https://Stackoverflow.com/questions/25734008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/834616/"
] | This is a pure JavaScript example. No jQuery required.
Here is a simple example of this answer in [JSFiddle](http://jsfiddle.net/h1vyye9r/).
```
window.onload = function() {
var divs = document.getElementsByTagName("div");
for (var i in divs) {
if (divs[i].className.indexOf("class2") > -1) {
... | This snippet may help you
```
$('html, body').animate({
scrollTop: ($('.class').first().offset().top)
},500);
``` |
12,034,527 | If possible please i'd ask a favor, i've been trying to change this it but i haven't succeeded, i wanted to change it in my php file, but no result!
now this script below is a resize script, but it renames my file... i don't need it to do so, can you please see it and tell me how to remove the renaming of the file?
I... | 2012/08/20 | [
"https://Stackoverflow.com/questions/12034527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559406/"
] | try changing to
```
$image->createFile('resized_'.$_FILES['Filedata']['name']);
function createFile($output_filename = null) {
if($this->ext == "JPG" OR $this->ext == "JPEG") {
imageJPEG($this->dst_r, $this->uploaddir.$output_filename, $this->quality);
} elseif($this->ext == "PNG") {
imagePNG(... | You confuse the file's actual name (`$_FILES['Filedata']['name']`) with the temporary name (`$_FILES['Filedata']['tmp_name']`). The first is the file the client uploaded. The second is a temporary file that the server created one the server's machine. So you have to use the actual, client-side name here. |
12,034,527 | If possible please i'd ask a favor, i've been trying to change this it but i haven't succeeded, i wanted to change it in my php file, but no result!
now this script below is a resize script, but it renames my file... i don't need it to do so, can you please see it and tell me how to remove the renaming of the file?
I... | 2012/08/20 | [
"https://Stackoverflow.com/questions/12034527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559406/"
] | try changing to
```
$image->createFile('resized_'.$_FILES['Filedata']['name']);
function createFile($output_filename = null) {
if($this->ext == "JPG" OR $this->ext == "JPEG") {
imageJPEG($this->dst_r, $this->uploaddir.$output_filename, $this->quality);
} elseif($this->ext == "PNG") {
imagePNG(... | This will make your day
```
$image->createFile(preg_replace("/\.[^\.]*$/", "", $targetFile));
``` |
57,927,301 | According to firebase doc, it seems that client side SDK allows email address as well as user profile information to be updated directly.
<https://firebase.google.com/docs/auth/android/manage-users#update_a_users_profile>
If I build an android app without any UI workflow for users to change email address, I am confi... | 2019/09/13 | [
"https://Stackoverflow.com/questions/57927301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/482594/"
] | Yes, it's possible for users to get a hold of the token that would be used to call the backend APIs exposed by Firebase Authentication that would normally be used by the SDK. There is no equivalent to database security rules.
The fact of the matter is that users normally *should* be able to change their email address,... | I am now facing the same issue, and I think I will just not worry about the 0.01%. This is mostly because if they change their own email with Firebase Authentication via reverse-engineering and my web server is unaware of their new email, this would not have any impact on the other genuine users except maybe not being ... |
17,917,228 | I created a form in wordpress but this code isn't work .
```
<?php
$metaname = $wpdb->escape($_REQUEST['apply_name']);
$metakey = $wpdb->escape($_REQUEST['apply_email']);
$metavalue = $wpdb->escape($_REQUEST['regcat']);
$wpdb->query($wpdb->prepare(
"
INSERT INTO $wpdb->jz_users
( user... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17917228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2428537/"
] | You could use a query like this:
```
db.execSQL("DELETE FROM " + TABLE_NAME +
" WHERE " + currentdate + " - " + TIMESTAMP_DB + " > 2*24*60*60");
```
For the `update` method, write the SQL expression in the `WHERE` clause in the `whereClause` parameter; `whereArgs` is needed only for string values:
```
db... | You can also do like this::
```
db.execSQL(String.format("DELETE FROM %s WHERE %s = %d",
Table_NAME,Table_ColumnName,Integer.parseInt(Value)));
```
It will execute the statement Directly.
and as you have asked WhereClause means the ColumnNames and expression that you want to use. and Where args is S... |
17,917,228 | I created a form in wordpress but this code isn't work .
```
<?php
$metaname = $wpdb->escape($_REQUEST['apply_name']);
$metakey = $wpdb->escape($_REQUEST['apply_email']);
$metavalue = $wpdb->escape($_REQUEST['regcat']);
$wpdb->query($wpdb->prepare(
"
INSERT INTO $wpdb->jz_users
( user... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17917228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2428537/"
] | You can also do like this::
```
db.execSQL(String.format("DELETE FROM %s WHERE %s = %d",
Table_NAME,Table_ColumnName,Integer.parseInt(Value)));
```
It will execute the statement Directly.
and as you have asked WhereClause means the ColumnNames and expression that you want to use. and Where args is S... | ```
public void deleteContact(Integer id) {
SQLiteDatabase db = this.getWritableDatabase();
db.delete("AddressList",
"id = ? ",
new String[]{Integer.toString(id)});
}
```
or
you can use raw SQL query to Delete row
```
public void deleteContact(Integer id) {
SQLiteDa... |
17,917,228 | I created a form in wordpress but this code isn't work .
```
<?php
$metaname = $wpdb->escape($_REQUEST['apply_name']);
$metakey = $wpdb->escape($_REQUEST['apply_email']);
$metavalue = $wpdb->escape($_REQUEST['regcat']);
$wpdb->query($wpdb->prepare(
"
INSERT INTO $wpdb->jz_users
( user... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17917228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2428537/"
] | You could use a query like this:
```
db.execSQL("DELETE FROM " + TABLE_NAME +
" WHERE " + currentdate + " - " + TIMESTAMP_DB + " > 2*24*60*60");
```
For the `update` method, write the SQL expression in the `WHERE` clause in the `whereClause` parameter; `whereArgs` is needed only for string values:
```
db... | This is very "huge" question and can have more working approaches depend on your personal requirements e.q security, performance etc.
At first i recommend to you use parametrized statements instead of your "harcoded" which are unsafe and not much human readable, so use placeholders e.q.
```
select * from test where i... |
17,917,228 | I created a form in wordpress but this code isn't work .
```
<?php
$metaname = $wpdb->escape($_REQUEST['apply_name']);
$metakey = $wpdb->escape($_REQUEST['apply_email']);
$metavalue = $wpdb->escape($_REQUEST['regcat']);
$wpdb->query($wpdb->prepare(
"
INSERT INTO $wpdb->jz_users
( user... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17917228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2428537/"
] | You could use a query like this:
```
db.execSQL("DELETE FROM " + TABLE_NAME +
" WHERE " + currentdate + " - " + TIMESTAMP_DB + " > 2*24*60*60");
```
For the `update` method, write the SQL expression in the `WHERE` clause in the `whereClause` parameter; `whereArgs` is needed only for string values:
```
db... | ```
public void deleteContact(Integer id) {
SQLiteDatabase db = this.getWritableDatabase();
db.delete("AddressList",
"id = ? ",
new String[]{Integer.toString(id)});
}
```
or
you can use raw SQL query to Delete row
```
public void deleteContact(Integer id) {
SQLiteDa... |
17,917,228 | I created a form in wordpress but this code isn't work .
```
<?php
$metaname = $wpdb->escape($_REQUEST['apply_name']);
$metakey = $wpdb->escape($_REQUEST['apply_email']);
$metavalue = $wpdb->escape($_REQUEST['regcat']);
$wpdb->query($wpdb->prepare(
"
INSERT INTO $wpdb->jz_users
( user... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17917228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2428537/"
] | This is very "huge" question and can have more working approaches depend on your personal requirements e.q security, performance etc.
At first i recommend to you use parametrized statements instead of your "harcoded" which are unsafe and not much human readable, so use placeholders e.q.
```
select * from test where i... | ```
public void deleteContact(Integer id) {
SQLiteDatabase db = this.getWritableDatabase();
db.delete("AddressList",
"id = ? ",
new String[]{Integer.toString(id)});
}
```
or
you can use raw SQL query to Delete row
```
public void deleteContact(Integer id) {
SQLiteDa... |
4,266,121 | I have a select element with 20+ options and size 10. I do not have the multiple attribute on the select. However a tester is able to select multiple options. The tester is using IE7 on Win XP.
How is this possible?
Could the tester have a client override to enable this?
**Update:**
In response to most of the comm... | 2010/11/24 | [
"https://Stackoverflow.com/questions/4266121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/197310/"
] | The tester might be playing around with the request headers, changing the number of options directly on them.
Another way to do this is use firebug/ie developer tools and dynamically add a `multiple="multiple"` attribute to the select, then select several options.
These are just *two* ways off the top of my head. You... | The client can override anything they want - by sending them the HTML to render the form, you are guaranteeing nothing about what will be sent back.
You should be parsing the information being sent back and checking for validity - if you expect only one value for that form input element, either error or drop the addit... |
4,266,121 | I have a select element with 20+ options and size 10. I do not have the multiple attribute on the select. However a tester is able to select multiple options. The tester is using IE7 on Win XP.
How is this possible?
Could the tester have a client override to enable this?
**Update:**
In response to most of the comm... | 2010/11/24 | [
"https://Stackoverflow.com/questions/4266121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/197310/"
] | The tester might be playing around with the request headers, changing the number of options directly on them.
Another way to do this is use firebug/ie developer tools and dynamically add a `multiple="multiple"` attribute to the select, then select several options.
These are just *two* ways off the top of my head. You... | **You need to check everything on the server**
Simple! You can't trust anything coming from the browser. If you expected one item to be selected, then check it on the server and display a message if not.
You're tester has uncovered a fundamental security issue with your site and I'd thank them for this. |
4,266,121 | I have a select element with 20+ options and size 10. I do not have the multiple attribute on the select. However a tester is able to select multiple options. The tester is using IE7 on Win XP.
How is this possible?
Could the tester have a client override to enable this?
**Update:**
In response to most of the comm... | 2010/11/24 | [
"https://Stackoverflow.com/questions/4266121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/197310/"
] | The client can override anything they want - by sending them the HTML to render the form, you are guaranteeing nothing about what will be sent back.
You should be parsing the information being sent back and checking for validity - if you expect only one value for that form input element, either error or drop the addit... | **You need to check everything on the server**
Simple! You can't trust anything coming from the browser. If you expected one item to be selected, then check it on the server and display a message if not.
You're tester has uncovered a fundamental security issue with your site and I'd thank them for this. |
92,957 | I've been experimenting with some photography for a few months now and I noticed that this happens on pictures with lower shutter speeds:
[](https://i.stack.imgur.com/fdepu.jpg)
[](https://i.stack.imgur.com/SJP6S.jpg)... | 2017/09/26 | [
"https://photo.stackexchange.com/questions/92957",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/68703/"
] | >
> If a zoom lens has a focal distance scale on it, does that mean that the lens is parfocal?
>
>
>
**No,** many zoom lenses are [*varifocal*](https://en.wikipedia.org/wiki/Varifocal_lens). As it's used in photography, the term [*parfocal*](https://en.wikipedia.org/wiki/Parfocal_lens) means that the lens should r... | I have never heard the term “parfocal” applied to a zoom lens, however I understand your question. Parfocal in the jargon of microscopes and telescopes pertains to an interchangeable objective and/or eyepiece. Microscopes often sport a turret that holds an array of objective lenses of various powers. One switches objec... |
137,431 | I have a Zigbee Pro with Arduino whose range is 2 miles as per specifications. But practically its maximum range is only 200 meters. I am using XCTU software. Is there any setting/configuration in XCTU to increase range?
If not possible to increase range, is there any module which is compatible with Arduino? | 2014/11/06 | [
"https://electronics.stackexchange.com/questions/137431",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/49855/"
] | 1- Depend on the manufacturer of your ZigBee maybe it provides a setting/configuration to increase the range. You should provide information about manufacturer and model.
2- Technically it is possible to increase the range of your signal improving the:
* Antenna (gain, sensitivity to body effects etc.)- Choose an ex... | Probably ZigBee devices' range is 2 km only in deep space. Depending on the power of your module (high-power ones can transmit up to 20 dBm (100 mW, although it's not legal in all countries). Note that this is the same power used by WiFi, so it's reasonable to expect a similar order of magnitude for range.
Also note t... |
137,431 | I have a Zigbee Pro with Arduino whose range is 2 miles as per specifications. But practically its maximum range is only 200 meters. I am using XCTU software. Is there any setting/configuration in XCTU to increase range?
If not possible to increase range, is there any module which is compatible with Arduino? | 2014/11/06 | [
"https://electronics.stackexchange.com/questions/137431",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/49855/"
] | 1- Depend on the manufacturer of your ZigBee maybe it provides a setting/configuration to increase the range. You should provide information about manufacturer and model.
2- Technically it is possible to increase the range of your signal improving the:
* Antenna (gain, sensitivity to body effects etc.)- Choose an ex... | I've been fooling around with the HopeRF RFM69HW module, which supports lower frequencies (433MHz penetrates obstacles better than 900MHz or 2.4GHz), lower bitrates (down to 1200 bit/s for robust reception), and reasonably high power (18dBm, or 20dBm at a reduced duty cycle). The best result I've gotten so far has been... |
46,008,174 | I try to run on any Kube slave node:
```
$ kubectl top nodes
```
And get an error:
```
Error from server (Forbidden): User "system:node:ip-10-43-0-13" cannot get services/proxy in the namespace "kube-system". (get services http:heapster:)
```
On master node it works:
```
$ kubectl top nodes
NAME CPU(c... | 2017/09/01 | [
"https://Stackoverflow.com/questions/46008174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/898680/"
] | You should try this out, but you need to read, and practice further.
PDO manual: <http://php.net/manual/en/book.pdo.php>
It's a lot to look at, but just take a look at their examples to get an idea of how it works.
Read this as well to make it easier: <https://code.tutsplus.com/tutorials/why-you-should-be-using-php... | I am answering on john's post.
The reason it executes every time you reload the page is because the browser resends the post data to the server. You need to use header() to redirect on post. Your code is not perfect but it works. You should organize it. Maybe place all database logic in a class. An example of redirec... |
1,365,633 | I am preparing for a competitive exam. Sorry if the question sounds naive.
The Below example was listed when I was studying **Fundamental Principle of Counting** which is
>
> If you must make a number of separate decisions, then MULTIPLY the
> number of ways to make each individual decision to find the number of
> ... | 2015/07/18 | [
"https://math.stackexchange.com/questions/1365633",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/255330/"
] | The fundamental principle of counting works when decisions are independent, in other words if taking one decision does not affect the choices for the others. In this case this does not work. If we give $6$ coins to Alex we are forced to give $0$ coins to everyone else.
This problem in particular can be solved through ... | I think the answer is $n+k-1\choose n $
where n= 6 , and k=3
since, we have no limit about how much coin we can gave to each person ! |
1,365,633 | I am preparing for a competitive exam. Sorry if the question sounds naive.
The Below example was listed when I was studying **Fundamental Principle of Counting** which is
>
> If you must make a number of separate decisions, then MULTIPLY the
> number of ways to make each individual decision to find the number of
> ... | 2015/07/18 | [
"https://math.stackexchange.com/questions/1365633",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/255330/"
] | The fundamental principle of counting works when decisions are independent, in other words if taking one decision does not affect the choices for the others. In this case this does not work. If we give $6$ coins to Alex we are forced to give $0$ coins to everyone else.
This problem in particular can be solved through ... | Here's a solution using the FPC:
Imagine Alex gets $a$ coins. The problem is then how many ways can we divide $6-a$ coins between Bea and Chad, which is a simple partition.
Imagine the $o$'s are coins:
$$o\;o\;o\;o\;o\;o$$
There are $7$ possible partition places, so for an example if $a=0$ and we have $oo|oooo$, th... |
1,365,633 | I am preparing for a competitive exam. Sorry if the question sounds naive.
The Below example was listed when I was studying **Fundamental Principle of Counting** which is
>
> If you must make a number of separate decisions, then MULTIPLY the
> number of ways to make each individual decision to find the number of
> ... | 2015/07/18 | [
"https://math.stackexchange.com/questions/1365633",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/255330/"
] | I think the answer is $n+k-1\choose n $
where n= 6 , and k=3
since, we have no limit about how much coin we can gave to each person ! | Here's a solution using the FPC:
Imagine Alex gets $a$ coins. The problem is then how many ways can we divide $6-a$ coins between Bea and Chad, which is a simple partition.
Imagine the $o$'s are coins:
$$o\;o\;o\;o\;o\;o$$
There are $7$ possible partition places, so for an example if $a=0$ and we have $oo|oooo$, th... |
30,099,348 | I am making a little app in php which is putting text to image. I got it wotking with imagettftext. I was also able to put it to a imagettfbbox with specific width using this function <http://php.net/manual/en/function.imagettftext.php#89505>. My only problem is that I want the text to be aligned to the right side of t... | 2015/05/07 | [
"https://Stackoverflow.com/questions/30099348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1266565/"
] | This should do the trick:
```
Sub Trigger_Email()
Dim rng As Range
Dim rng2 As Range
Dim OutApp As Object
Dim OutMail As Object
Dim StrBody As String
StrBody = "Hello Recruitment Team," & "<br>" & "<br>" & _
"Please work on the below request details and open it for Vendor Sourcing. The... | ```vb
Sub Macro2()
Dim LastRow As Double
LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range("A1:AM" & LastRow).Select
ActiveWorkbook.Worksheets(str).Sort.SortFields.Clear... |
2,019,844 | A function is said to be well defined if x=y implies f(x)=f(y). If x=y then surely wont f(x)=f(y). I cant get this through my head. Plz explain what a well defined function is n what is an ill defined one. It puzzles me a lot to think of an ill defined one. | 2016/11/18 | [
"https://math.stackexchange.com/questions/2019844",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/389997/"
] | One example of a not-well-defined function would be $f(\frac{a}{b})=a+b.$
Then, while $\frac{1}{2} = \frac{2}{4}$, we have $f(\frac{1}{2}) = 3$ but $f(\frac{2}{4})=6.$ So you'll often see, in proofs about rational numbers, that the fractions is specified to be "in lowest terms" and maybe "with denominator positive", so... | Suppose I say: $f(x) = $ some number greater than $x$
Then of course you say 'well, that could be lots of things, e.g. f(5) could be 6, or 7, or ... So, what *is* it?!'
OK, so the problem is that this 'function' does not uniquely specify what f(x) is for any x, i.e. You could have x= 5 , y= 5, but f(x) = 6, and f(y) ... |
2,019,844 | A function is said to be well defined if x=y implies f(x)=f(y). If x=y then surely wont f(x)=f(y). I cant get this through my head. Plz explain what a well defined function is n what is an ill defined one. It puzzles me a lot to think of an ill defined one. | 2016/11/18 | [
"https://math.stackexchange.com/questions/2019844",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/389997/"
] | One example of a not-well-defined function would be $f(\frac{a}{b})=a+b.$
Then, while $\frac{1}{2} = \frac{2}{4}$, we have $f(\frac{1}{2}) = 3$ but $f(\frac{2}{4})=6.$ So you'll often see, in proofs about rational numbers, that the fractions is specified to be "in lowest terms" and maybe "with denominator positive", so... | A function $f$ is well defined or 'single-valued' in the sense that $(a,b)\in f$ and $(a,b')\in f$ imply that $b=b'$. This operation is written as $f(a)=b$.
What this means is, that a single element of $A$ cannot have more than one image in $B$ under $f:A\to B$. Thus the mapping $f$ is a particular relation $f\subset ... |
2,019,844 | A function is said to be well defined if x=y implies f(x)=f(y). If x=y then surely wont f(x)=f(y). I cant get this through my head. Plz explain what a well defined function is n what is an ill defined one. It puzzles me a lot to think of an ill defined one. | 2016/11/18 | [
"https://math.stackexchange.com/questions/2019844",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/389997/"
] | One example of a not-well-defined function would be $f(\frac{a}{b})=a+b.$
Then, while $\frac{1}{2} = \frac{2}{4}$, we have $f(\frac{1}{2}) = 3$ but $f(\frac{2}{4})=6.$ So you'll often see, in proofs about rational numbers, that the fractions is specified to be "in lowest terms" and maybe "with denominator positive", so... | What makes the concept of a well-defined function $f$ confusing is the fact that functions are by definition well-defined. So to explain what it means to not be well-defined, we have to take an example where $f$ is not a function.
Lets take the following procedure and call it $f$: The input is an integer $n$. The outp... |
37,965 | For the second Pumpkin Landing Task I need to carry five pumpkins to a shed, however I'm having quite a bit of trouble. The biggest issue I have is when I try ot proceed left, since the pumpkins have a tendency to lean the side.
What are some things to keep in mind for completing this task, and are there any tricks to... | 2011/11/22 | [
"https://gaming.stackexchange.com/questions/37965",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/8350/"
] | When you stop walking, the pumpkins move on the opposite side you were walking just before stopping (even if it was just an instant). Forward speed has no effect.
The trick is to go towards the shed and stop a moment before the pumpkins fall.
Then just tap the direction in which they are falling and watch them going b... | I did it! I managed to complete this right after I asked the question. It would appear that the advice the woman gives you at the start is incorrect: Your speed doesn't seem to have any affect on the movement of the pumpkins, it seems to be based entirely on time. Whether I was standing still or moving ahead at full sp... |
26,731,261 | I am working on a certain problem where given a URL I need to map it to a country. Even if I can reliably answer the question "Is this particular URL relevant to United States?" that should be sufficient.
I am happy to have false negatives but never a false positive.
Currently I am considering the following approac... | 2014/11/04 | [
"https://Stackoverflow.com/questions/26731261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54082/"
] | Macros within the same crate
============================
New method (since Rust 1.32, 2019-01-17)
----------------------------------------
```
foo::bar!(); // works
mod foo {
macro_rules! bar {
() => ()
}
pub(crate) use bar; // <-- the trick
}
foo::bar!(); // works
```
With the `pub use... | This answer is outdated as of Rust 1.1.0-stable.
---
You need to add `#![macro_escape]` at the top of `macros.rs` and include it using `mod macros;` as mentioned in the [Macros Guide](http://doc.rust-lang.org/guide-macros.html#scoping-and-macro-import/export).
```
$ cat macros.rs
#![macro_escape]
#[macro_export]
ma... |
26,731,261 | I am working on a certain problem where given a URL I need to map it to a country. Even if I can reliably answer the question "Is this particular URL relevant to United States?" that should be sufficient.
I am happy to have false negatives but never a false positive.
Currently I am considering the following approac... | 2014/11/04 | [
"https://Stackoverflow.com/questions/26731261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54082/"
] | This answer is outdated as of Rust 1.1.0-stable.
---
You need to add `#![macro_escape]` at the top of `macros.rs` and include it using `mod macros;` as mentioned in the [Macros Guide](http://doc.rust-lang.org/guide-macros.html#scoping-and-macro-import/export).
```
$ cat macros.rs
#![macro_escape]
#[macro_export]
ma... | Adding `#![macro_use]` to the top of your file containing macros will cause all macros to be pulled into main.rs.
For example, let's assume this file is called node.rs:
```
#![macro_use]
macro_rules! test {
() => { println!("Nuts"); }
}
macro_rules! best {
() => { println!("Run"); }
}
pub fn fun_times() {
... |
26,731,261 | I am working on a certain problem where given a URL I need to map it to a country. Even if I can reliably answer the question "Is this particular URL relevant to United States?" that should be sufficient.
I am happy to have false negatives but never a false positive.
Currently I am considering the following approac... | 2014/11/04 | [
"https://Stackoverflow.com/questions/26731261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54082/"
] | This answer is outdated as of Rust 1.1.0-stable.
---
You need to add `#![macro_escape]` at the top of `macros.rs` and include it using `mod macros;` as mentioned in the [Macros Guide](http://doc.rust-lang.org/guide-macros.html#scoping-and-macro-import/export).
```
$ cat macros.rs
#![macro_escape]
#[macro_export]
ma... | I have [came across the same problem](https://stackoverflow.com/questions/63233545/how-do-i-use-rust-macros-in-the-same-crate) in Rust 1.44.1, and this solution works for later versions (known working for Rust 1.7).
Say you have a new project as:
```
src/
main.rs
memory.rs
chunk.rs
```
In **main.rs**, y... |
26,731,261 | I am working on a certain problem where given a URL I need to map it to a country. Even if I can reliably answer the question "Is this particular URL relevant to United States?" that should be sufficient.
I am happy to have false negatives but never a false positive.
Currently I am considering the following approac... | 2014/11/04 | [
"https://Stackoverflow.com/questions/26731261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54082/"
] | Alternative approach as of `1.32.0` (2018 edition)
==================================================
Note that while [the instructions from @lukas-kalbertodt](https://stackoverflow.com/revisions/31749071/4) are still up to date and work well, the idea of having to remember special namespacing rules for macros can be ... | This answer is outdated as of Rust 1.1.0-stable.
---
You need to add `#![macro_escape]` at the top of `macros.rs` and include it using `mod macros;` as mentioned in the [Macros Guide](http://doc.rust-lang.org/guide-macros.html#scoping-and-macro-import/export).
```
$ cat macros.rs
#![macro_escape]
#[macro_export]
ma... |
26,731,261 | I am working on a certain problem where given a URL I need to map it to a country. Even if I can reliably answer the question "Is this particular URL relevant to United States?" that should be sufficient.
I am happy to have false negatives but never a false positive.
Currently I am considering the following approac... | 2014/11/04 | [
"https://Stackoverflow.com/questions/26731261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54082/"
] | Macros within the same crate
============================
New method (since Rust 1.32, 2019-01-17)
----------------------------------------
```
foo::bar!(); // works
mod foo {
macro_rules! bar {
() => ()
}
pub(crate) use bar; // <-- the trick
}
foo::bar!(); // works
```
With the `pub use... | Adding `#![macro_use]` to the top of your file containing macros will cause all macros to be pulled into main.rs.
For example, let's assume this file is called node.rs:
```
#![macro_use]
macro_rules! test {
() => { println!("Nuts"); }
}
macro_rules! best {
() => { println!("Run"); }
}
pub fn fun_times() {
... |
26,731,261 | I am working on a certain problem where given a URL I need to map it to a country. Even if I can reliably answer the question "Is this particular URL relevant to United States?" that should be sufficient.
I am happy to have false negatives but never a false positive.
Currently I am considering the following approac... | 2014/11/04 | [
"https://Stackoverflow.com/questions/26731261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54082/"
] | Macros within the same crate
============================
New method (since Rust 1.32, 2019-01-17)
----------------------------------------
```
foo::bar!(); // works
mod foo {
macro_rules! bar {
() => ()
}
pub(crate) use bar; // <-- the trick
}
foo::bar!(); // works
```
With the `pub use... | I have [came across the same problem](https://stackoverflow.com/questions/63233545/how-do-i-use-rust-macros-in-the-same-crate) in Rust 1.44.1, and this solution works for later versions (known working for Rust 1.7).
Say you have a new project as:
```
src/
main.rs
memory.rs
chunk.rs
```
In **main.rs**, y... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.