qid
int64 1
74.7M
| question
stringlengths 0
58.3k
| date
stringlengths 10
10
| metadata
sequence | response_j
stringlengths 2
48.3k
| response_k
stringlengths 2
40.5k
|
---|---|---|---|---|---|
29,604,313 | I would like to change the vmsize of a running Azure web role during deployment preferrably using powershell.
Is this at all possible?
The use case here is that not all of our customers (and test environments) should run the same vm sizes, but they all use the same .csdef file. | 2015/04/13 | [
"https://Stackoverflow.com/questions/29604313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/571308/"
] | You can use the Set-AzureDeployment cmdlet to upgrade a webrole size, which you could then work into your existing PowerShell script. For instance, if you automatically deploy every customer web service/web role at a basic level/scale and then only upgraded them to larger capacity as needed, you could then use the following cmdlet as needed:
```
Set-AzureDeployment -Upgrade -ServiceName "MySvc1" -Mode Auto `
-Package "C:\Temp\MyApp.cspkg" -Configuration "C:\Temp\MyServiceConfig.Cloud.csfg"
```
I would envision you just adding a parameter to your current PowerShell script, and if specified, run the above cmdlet to Upgrade the Azure Web role. | This is not possible for a role, you have to do a new deployment with the settings change. You can however change the number of instances without redeploying maybe that could help you out?
On plain VM's you can use the following powershell snippet:
```
Get-AzureVM –ServiceName $ServiceName –Name $Name |
Set-AzureVMSize $VMSize |
Update-AzureVM
```
[Taken from here](https://msdn.microsoft.com/en-us/library/dn168976%28v=nav.70%29.aspx) |
29,604,313 | I would like to change the vmsize of a running Azure web role during deployment preferrably using powershell.
Is this at all possible?
The use case here is that not all of our customers (and test environments) should run the same vm sizes, but they all use the same .csdef file. | 2015/04/13 | [
"https://Stackoverflow.com/questions/29604313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/571308/"
] | This is not possible for a role, you have to do a new deployment with the settings change. You can however change the number of instances without redeploying maybe that could help you out?
On plain VM's you can use the following powershell snippet:
```
Get-AzureVM –ServiceName $ServiceName –Name $Name |
Set-AzureVMSize $VMSize |
Update-AzureVM
```
[Taken from here](https://msdn.microsoft.com/en-us/library/dn168976%28v=nav.70%29.aspx) | We use `MSBuild` to convert VM size in Service Definition file. It's part of the build step that runs before the deployment.
```
<Target Name="ChangeVM">
<RegexReplace
Pattern='vmsize="Standard_D3"'
Replacement='vmsize="$(VMSize)"'
Files='../Web/ServiceDefinition.csdef' />
</Target>
```
Where `(VMSize)` is the parameter coming from your build server. |
29,604,313 | I would like to change the vmsize of a running Azure web role during deployment preferrably using powershell.
Is this at all possible?
The use case here is that not all of our customers (and test environments) should run the same vm sizes, but they all use the same .csdef file. | 2015/04/13 | [
"https://Stackoverflow.com/questions/29604313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/571308/"
] | You can use the Set-AzureDeployment cmdlet to upgrade a webrole size, which you could then work into your existing PowerShell script. For instance, if you automatically deploy every customer web service/web role at a basic level/scale and then only upgraded them to larger capacity as needed, you could then use the following cmdlet as needed:
```
Set-AzureDeployment -Upgrade -ServiceName "MySvc1" -Mode Auto `
-Package "C:\Temp\MyApp.cspkg" -Configuration "C:\Temp\MyServiceConfig.Cloud.csfg"
```
I would envision you just adding a parameter to your current PowerShell script, and if specified, run the above cmdlet to Upgrade the Azure Web role. | We use `MSBuild` to convert VM size in Service Definition file. It's part of the build step that runs before the deployment.
```
<Target Name="ChangeVM">
<RegexReplace
Pattern='vmsize="Standard_D3"'
Replacement='vmsize="$(VMSize)"'
Files='../Web/ServiceDefinition.csdef' />
</Target>
```
Where `(VMSize)` is the parameter coming from your build server. |
28,853,341 | I have a HTML page which is divided into two frame sets,
the first frame contains 4 buttons, the second frame shows forms, only 1 of 4 forms can be shown according to which button is clicked.
e.g. if the user clicks on button 'form1' in frame1, the 2nd frame should show 'FORM1' if the user clicks on button 'frame3' in frame1, the 2nd frame should show 'FORM3'.
What I need is to be able to change the source of the form in the second frame based on the button clicked in the first frame.
Here is main frame file:
```
<html>
<head>
<title>User Management</title>
</head>
<frameset rows="9% ,91%" >
<frame src="buttons.php"
name='Frame1'
scrolling="no"
name="work_disply"
noresize="noresize" />
<frame src="form1.php"
name='Frame2'
scrolling="yes"
name="work_ground"
noresize="noresize" />
</frameset>
</html>
``` | 2015/03/04 | [
"https://Stackoverflow.com/questions/28853341",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2339140/"
] | This should do what you need:
```
<a target="Frame2" href="form1.php">Show form 1</a>
<a target="Frame2" href="form2.php">Show form 2</a>
<a target="Frame2" href="form3.php">Show form 3</a>
<a target="Frame2" href="form4.php">Show form 4</a>
```
More about targets and frames in [HTML 4 spec](http://www.w3.org/TR/html401/present/frames.html#adef-target). | In frame1 that is in buttons.php your code for buttons should be like this
```
<input type="button1" value="button1"
onClick="parent.Frame2.location.href='Form1.php'">
</form>
<input type="button2" value="button2"
onClick="parent.Frame2.location.href='Form2.php'">
</form>
<input type="button3" value="button3"
onClick="parent.Frame2.location.href='Form3.php'">
</form>
<input type="button4" value="button4"
onClick="parent.Frame2.location.href='Form4.php'">
</form>
```
This will solve your problem... |
28,853,341 | I have a HTML page which is divided into two frame sets,
the first frame contains 4 buttons, the second frame shows forms, only 1 of 4 forms can be shown according to which button is clicked.
e.g. if the user clicks on button 'form1' in frame1, the 2nd frame should show 'FORM1' if the user clicks on button 'frame3' in frame1, the 2nd frame should show 'FORM3'.
What I need is to be able to change the source of the form in the second frame based on the button clicked in the first frame.
Here is main frame file:
```
<html>
<head>
<title>User Management</title>
</head>
<frameset rows="9% ,91%" >
<frame src="buttons.php"
name='Frame1'
scrolling="no"
name="work_disply"
noresize="noresize" />
<frame src="form1.php"
name='Frame2'
scrolling="yes"
name="work_ground"
noresize="noresize" />
</frameset>
</html>
``` | 2015/03/04 | [
"https://Stackoverflow.com/questions/28853341",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2339140/"
] | This should do what you need:
```
<a target="Frame2" href="form1.php">Show form 1</a>
<a target="Frame2" href="form2.php">Show form 2</a>
<a target="Frame2" href="form3.php">Show form 3</a>
<a target="Frame2" href="form4.php">Show form 4</a>
```
More about targets and frames in [HTML 4 spec](http://www.w3.org/TR/html401/present/frames.html#adef-target). | Child (Frame1):
```
// Get Button Values & Pass to Parent
$(document).ready(function() {
$('#list-1').click(function() {
// alert($(this).attr("value"));
window.parent.fchanger($(this).attr("value"));
});
});
$(document).ready(function() {
$('#list-2').click(function() {
// alert($(this).attr("value"));
window.parent.fchanger($(this).attr("value"));
});
});
$(document).ready(function() {
$('#list-3').click(function() {
// alert($(this).attr("value"));
window.parent.fchanger($(this).attr("value"));
});
});
$(document).ready(function() {
$('#list-4').click(function() {
// alert($(this).attr("value"));
window.parent.fchanger($(this).attr("value"));
});
});
```
Parent File to set the 'src' of Frame1:
```
function fchanger(fname){
// alert("Welcome");
// document.getElementById("Frame2").src = 'form10.php' ;
switch (fname) {
case 'form1':
document.getElementById("Frame2").src = 'form1.php' ;
break;
case 'form2':
document.getElementById("Frame2").src = 'form2.php' ;
break;
case 'form3':
document.getElementById("Frame2").src = 'form3.php' ;
break;
case 'form4':
document.getElementById("Frame2").src = 'form4.php' ;
break;
case 'form5':
document.getElementById("Frame2").src = 'form5.php' ;
break;
case 'form6':
document.getElementById("Frame2").src = 'form6.php' ;
break;
case 'form7':
document.getElementById("Frame2").src = 'form7.php' ;
break;
case 'form8':
document.getElementById("Frame2").src = 'form8.php' ;
break;
case 'form9':
document.getElementById("Frame2").src = 'form9.php' ;
break;
case 'form10':
document.getElementById("Frame2").src = 'form10.php' ;
break;
case 'form11':
document.getElementById("Frame2").src = 'form11.php' ;
break;
default:
text = "Looking forward to the Weekend";
} }
``` |
39,965,322 | I know recipes aren't versioned, but is it possible in an environment to have some recipes use a specific version of their cookbook and some use a different version? | 2016/10/10 | [
"https://Stackoverflow.com/questions/39965322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1028270/"
] | You can only pin cookbooks in environments. There is no way to mix a cookbook with recipes from different cookbook versions. | Nope.
Cookbooks are the unit of versioning, there's no way to pin recipes.
You can copy either the old or the new cookbook to a new name (`cookbook_v1` or `cookbook_ng`) or you can include two different versions of the recipe in the new cookbook (`recipes/stuff_v1.rb` `recipes/stuff_v2.rb`) but you can't do what you're asking. |
6,781,204 | How does WebLogic 11g load libraries in an EAR file? I have this problem with a web application, that when deployed as a WAR (with libraries it depends on in WEB-INF/lib), it works just fine. However, when it's inside an EAR file, WebLogic does not find those libraries unless I put them in APP-INF/lib. Does that mean that if I'm deploying as an EAR I'd have to pull out all JAR files from the WEB-INF/lib directory and place them in APP-INF/lib ? or is there a configuration that can be done in WebLogic to avoid this?
Thanks! | 2011/07/21 | [
"https://Stackoverflow.com/questions/6781204",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86857/"
] | If you have JAR files that you need to share between multiple WAR files or between WAR files and EAR files then you will need to package them in the EAR.
If WAR#1 has a JAR in its WEB-INF/lib and is packaged in an EAR with WAR#2, then WAR#2 will not be able to see the JAR files in WAR#1/WEB-INF/lib. | Solving your problem will take some understanding of how Java EE classloading works in a container. You should look at [this link](http://download.oracle.com/docs/cd/E12839_01/web.1111/e13706/classloading.htm) to get an understanding, but the basic problem is that when you package your application as an EAR, you've introduced another classloader (the application classloader) into the class loading hierarchy. You can configure WebLogic to load from your webapp by using the [prefer-web-inf-classes](http://download.oracle.com/docs/cd/E12839_01/web.1111/e13706/classloading.htm#i1090543) element. |
49,018,118 | I have decided to make my own Tool bar
So i removed the regular ToolBar :
```
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="false"
android:theme="@style/Theme.AppCompat.Light.NoActionBar> //removetollbar
```
and make my own tool bar
```
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.v7.widget.Toolbar>
```
then i include in main xml
```
<include
layout="@layout/customtoolbar"
android:id="@+id/custombar" >
</include>
```
and in the code i set it up :
```
_CustomToolBar = (android.support.v7.widget.Toolbar)
findViewById(R.id.custombar);
setSupportActionBar(_CustomToolBar);
android.support.v7.widget.Toolbar _CustomToolBar;
```
>
> now when the app run the custom toolbar is not there
>
>
>
Please help. | 2018/02/27 | [
"https://Stackoverflow.com/questions/49018118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6528032/"
] | In your `<include>` tag, you've set the id of the toolbar to be `@+id/custombar`, but you're looking it up using `R.id.toolbar`. Change that line to this:
```
_CustomToolBar = (android.support.v7.widget.Toolbar) findViewById(R.id.custombar);
``` | Didn't get your question clearly, but still I will post how I code to set custom toolbar.
1) My Manifest have NoActionBar theme to remove default toolbar.
2) My custom\_toolbar.xml file -
```
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="5dp"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
```
3) Way I include it in my main.xml
```
<include layout="@layout/custom_toolbar" />
```
4) My Java code -
```
// In onCreate method
android.support.v7.widget.Toolbar _CustomToolBar = (android.support.v7.widget.Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(_CustomToolBar);
```
And it is working properly.
[](https://i.stack.imgur.com/xyddz.png)
So Here whats the different between our code.
1) Give your custom toolbar proper id `android:id="@+id/customToolbar"` instead of giving it to you `include`.
2) Give height and background color to your custom toolbar so that it will be visible properly
```
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
```
3) And instead of linking `include id` to toolbar, link your `custom toolbar id`
```
findViewById(R.id.customToolbar);
``` |
16,594,511 | So I need to upgrade an rails 2.3.14 app to rails 3. We use git, so decided to create another branch 'rails3' (git checkout -b rails3). The easiest solution I found to the problem of the upgrade was removing all stuff and generating a new project and copy/pasting controllers , views, etc.. from master. But now `git status` tells me those files were deleted and regenerated, not *modified*, although most of them are in the same place they were before. So changes remain obscure, other programmers wont see the subtle changes to files.
What have I've done:
```none
/path/to/rails_project/ (master) $ git checkout -b rails3
/path/to/rails_project/ (rails3) $ rm -rf ./* # not git rm
/path/to/ $ rails new rails_project
/path/to/rails_project/ (rails3) $ cp old/project/stuff/from/another/dir
```
How can I 'tell' git that these files were modified, not deleted and regenerated? I have the upgraded app in a totally different directory so its fine to implode cosmos and do all from start. | 2013/05/16 | [
"https://Stackoverflow.com/questions/16594511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1740079/"
] | this might be a clean solution for you:
```
<form action="" method="post">
<input type="submit" name="page" value="Home" />
<input type="submit" name="page" value="About Us" />
<input type="submit" name="page" value="Games" />
<input type="submit" name="page" value="Pages" />
</form>
<?php
switch($_POST["page"]){
case "About Us":
include 'au.php';
break;
case "Games":
include 'games.php';
break;
case "Pages":
include 'pages.php';
break;
default:
include 'home.php';
break;
}
``` | So, this will check, if `$_POST` is not set, load home.php else, if it is set then continue
```
if (!isset($_POST)){ // if post is not set, show home.php
include 'home.php';
}else if (isset($_POST['AboutUs'])){
include 'au.php';
}else if (isset($_POST['Games'])){
include 'games.php';
} // and you can keep going like that
``` |
16,594,511 | So I need to upgrade an rails 2.3.14 app to rails 3. We use git, so decided to create another branch 'rails3' (git checkout -b rails3). The easiest solution I found to the problem of the upgrade was removing all stuff and generating a new project and copy/pasting controllers , views, etc.. from master. But now `git status` tells me those files were deleted and regenerated, not *modified*, although most of them are in the same place they were before. So changes remain obscure, other programmers wont see the subtle changes to files.
What have I've done:
```none
/path/to/rails_project/ (master) $ git checkout -b rails3
/path/to/rails_project/ (rails3) $ rm -rf ./* # not git rm
/path/to/ $ rails new rails_project
/path/to/rails_project/ (rails3) $ cp old/project/stuff/from/another/dir
```
How can I 'tell' git that these files were modified, not deleted and regenerated? I have the upgraded app in a totally different directory so its fine to implode cosmos and do all from start. | 2013/05/16 | [
"https://Stackoverflow.com/questions/16594511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1740079/"
] | this might be a clean solution for you:
```
<form action="" method="post">
<input type="submit" name="page" value="Home" />
<input type="submit" name="page" value="About Us" />
<input type="submit" name="page" value="Games" />
<input type="submit" name="page" value="Pages" />
</form>
<?php
switch($_POST["page"]){
case "About Us":
include 'au.php';
break;
case "Games":
include 'games.php';
break;
case "Pages":
include 'pages.php';
break;
default:
include 'home.php';
break;
}
``` | Just so you have options to choose from...
```
<html>
<head>
<title>
Test
</title>
</head>
<body>
<?php
include 'header.php';
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" id="menuForm">
<input type="submit" name="submit" value="Home" />
<input type="submit" name="submit" value="About Us" />
<input type="submit" name="submit" value="Games" />
<input type="submit" name="submit" value="Pages" />
</form>
<?php
switch ($_POST["submit"]) {
case 'Home': {
include 'home.php';
break;
}
case 'About Us': {
include 'au.php';
break;
}
case 'Games': {
include 'games.php';
break;
}
case 'Pages': {
include 'pages.php';
break;
}
default: {
include 'home.php';
break;
}
}
?>
</body>
</html>
```
Hope this helps. |
37,894,081 | I see that no active development is going on from vogels page from a long time i.e, about 5 months <https://github.com/ryanfitz/vogels>
Are there any better options?
Has anyone faced issues with scalibility or I/O time with it? | 2016/06/18 | [
"https://Stackoverflow.com/questions/37894081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2379271/"
] | I've been using vogels on a project recently. While it seems like it isn't as well maintained as it used to be, it's still quite a nice API wrapper - certainly much nicer than using the SDK directly.
I haven't encountered any performance cost with it - it's really just assembling AWS SDK calls, and doesn't do anything too crazy. The code is simple enough that anything I was unsure about I can dive in and check it out, and the docs are pretty good.
However another option that I've found recently is this library, open sourced by Medium. It's promised based and looks well maintained:
<https://github.com/Medium/dynamite> | I've been using Vogels for around 6 months now and it's done everything I've needed it to do. The raw dynamoDB api is too low level for what I need. I too noticed that the module wasn't being 'maintained' so I created a fork of the project and republished it to npm:
[npm](https://www.npmjs.com/package/dynogels)
[github](https://github.com/clarkie/dynogels)
I'm actively working on it to bring it up to modern standards and looking for more contributors to help out. |
50,309,017 | I have a invite link of private channel, and I wanna forwards (or delivery) posts from this channel to me. My desired pseudo code is like below.
```
def get_channel(bot, update):
message=update.channel_post.text
print(message)
updater = Updater(my_token)
channel_handler = MessageHandler(Filters.text, get_channel,
channel_post_updates=True, invite_link='http://t.me/aa23faba22939bf')
updater.dispatcher.add_handler(channel_handler)
```
This works well when my bot is in the channel which I created(invite\_link is added for my purpose. I don't know where invite\_link should be input). But what I want is that my bot forwards posts from channel in which my bot is 'not' included. I prefer python, but any API will be ok. I searched all the google world but have no clues.. Any tips appreciated. | 2018/05/12 | [
"https://Stackoverflow.com/questions/50309017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9247484/"
] | With awk:
```
kubectl get pods -l run=hello-kube -o yaml | awk '/podIP:/ {print $2}'
```
Output:
```
10.244.1.9
``` | You may also use the format json to get the value with jsonpath, something like,
```
kubectl get pods -l app=cron -o=jsonpath='{.items[0].status.podIP}'
```
Thanks |
50,309,017 | I have a invite link of private channel, and I wanna forwards (or delivery) posts from this channel to me. My desired pseudo code is like below.
```
def get_channel(bot, update):
message=update.channel_post.text
print(message)
updater = Updater(my_token)
channel_handler = MessageHandler(Filters.text, get_channel,
channel_post_updates=True, invite_link='http://t.me/aa23faba22939bf')
updater.dispatcher.add_handler(channel_handler)
```
This works well when my bot is in the channel which I created(invite\_link is added for my purpose. I don't know where invite\_link should be input). But what I want is that my bot forwards posts from channel in which my bot is 'not' included. I prefer python, but any API will be ok. I searched all the google world but have no clues.. Any tips appreciated. | 2018/05/12 | [
"https://Stackoverflow.com/questions/50309017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9247484/"
] | With awk:
```
kubectl get pods -l run=hello-kube -o yaml | awk '/podIP:/ {print $2}'
```
Output:
```
10.244.1.9
``` | You can also use `yq` (<https://github.com/mikefarah/yq>), which is a tool similar to `jq`.
Then do:
```
% yq read file.yaml items.0.spec.podIP
10.244.1.9
``` |
4,298,595 | I have the following from the slime repl (no clojure.contib functions found):
```
M-X slime
user=> (:require 'clojure.contrib.string)
nil
user=> (doc clojure.contrib.string/blank?)
java.lang.Exception: Unable to resolve var: clojure.contrib.string/blank? in this context (NO_SOURCE_FILE:10)
```
And the following when starting clojure from console (but here everything is being found OK):
```
adr@~/clojure/cloj-1.2$ java -cp /home/adr/clojure/cloj-1.2/clojure.jar:/home/adr/clojure/cloj-1.2/clojure-contrib.jar -server clojure.main
user=> (:require 'clojure.contrib.string)
nil
user=> (doc clojure.contrib.string/blank?)
-------------------------
clojure.contrib.string/blank?
([s])
True if s is nil, empty, or contains only whitespace.
nil
```
In my .emacs I have the following:
```
(setq inferior-lisp-program "java -cp /home/adr/clojure/cloj-1.2/clojure.jar:/home/adr/clojure/cloj-1.2/clojure-contrib.jar -server clojure.main")
```
My clojure jars (1.2) are at '/home/adr/clojure/cloj-1.2'.
I;m a newbie with emacs, been following some tutorials. For some time I've been trying to use the clojure.contrib library from Emacs, but "M-X slime" finds no clojure.contrib. Please, help
**Edit**: if that would help, now i saw that when using M-X slime there is a message:
```
(progn (load "/home/adr/.emacs.d/elpa/slime-20100404/swank-loader.lisp" :verbose t) (funcall (read-from-string "swank-loader:init")) (funcall (read-from-string "swank:start-server") "/tmp/slime.4493" :coding-system "iso-latin-1-unix"))
Clojure 1.2.0
user=> java.lang.Exception: Unable to resolve symbol: progn in this context (NO_SOURCE_FILE:1)
```
**Edit2:** But there is no such error message if I use M-X slime-connect after having started a "lein swank" in a directory (though even starting with "M-X slime-connect" there are no clojure-contrib libraries found in the REPL (though they are downloaded by leiningen as dependency)). | 2010/11/28 | [
"https://Stackoverflow.com/questions/4298595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/160992/"
] | The new [ECMAScript 5 specification](http://www.ecma262-5.com/ELS5_HTML.htm) allows property names to be reserved words. Some engines might have adopted this new "feature", while others might still require property names to be quoted when they happen to be reserved words. | For sake of clarity you might want to avoid `delete` or `new` or other operators as property names, even while newer specs is relaxed about it |
10,515,412 | I have a table with column node\_id as number, where,
```
node_id
0
2000
300300300
400400400
```
what i am trying to get is convert this number into string and add '-' after every third digit from right.
So expected output is,
```
node_id
000-000-000
000-002-000
300-300-300
400-400-400
```
This is the query which i am using,
```
select TO_CHAR( lpad(t1.node_id,9,'0'), '999G999G999', 'NLS_NUMERIC_CHARACTERS="-"'), node_id from table t1;
```
The output i am getting is,
```
node_id
0
2-000
300-300-300
400-400-400
```
My problem is I also need to prepend '0' to each record such that the total length is 11.
I tried adding to\_char immediately around lpad so as to convert the lpad output to varchar, but that also gives the same output. | 2012/05/09 | [
"https://Stackoverflow.com/questions/10515412",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1073023/"
] | Just change your format mask to:
```
'099G999G999'
```
(Note the leading '0') | An alternative for prepending 0s that works in any database is something like:
```
right('000000000000' || cast(<val> to varchar(100)), <numdigits>)
```
Of course, some databases use "concat()" or "+" instead of "||" for concatenation. |
6,345 | Nel romanzo *Non so niente di te* di Paola Mastrocola, pubblicato da Einaudi, ho letto (il corsivo è mio):
>
> Ognuno ha il suo modo di non dormire, la notte, il suo stile, le sue tecniche di insonnia. C'è chi [...]. E c'è chi si ribella, non ammette, non concepisce che possa capitare a lui, è ostile, sbuffa, *sbraita*, finge di dormire, strizza gli occhi perché il sonno arrivi, si sforza di non pensarci e ci pensa sempre di piú, finendo per restare a letto teso come una corda di violino.
>
>
>
Siccome non conoscevo il significato del verbo "sbraitare", l'ho cercato nel [vocabolario Treccani](http://www.treccani.it/vocabolario/sbraitare/), dove ho trovato questa accezione del termine:
>
> protestare manifestando a voce alta il proprio risentimento: *s. contro il governo, contro le tasse; tutti sbraitano, ma nessuno ha il coraggio di ribellarsi*.
>
>
>
Comunque, non mi sembra il caso di mettersi a gridare durante la notte quando si ha l'insonnia. Per questa ragione vi chiedo: il verbo "sbraitare" può avere un uso figurato che non implichi parlare a voce alta o gridare? Si tratta di un uso letterario o è invece comune? | 2015/12/20 | [
"https://italian.stackexchange.com/questions/6345",
"https://italian.stackexchange.com",
"https://italian.stackexchange.com/users/707/"
] | Il termine ***[sbraitare](http://dizionari.repubblica.it/Italiano/S/sbraitare.php)*** nel brano viene probabilmente usato nel senso figurato di protestare, indignarsi:
>
> * Vociare concitatamente, scompostamente, quasi urlando: sbraitava come un ossesso di avere ragione
> * (per estensione) Protestare, ribellarsi, mostrarsi indignato contro qualcuno o qualcosa: *sbraitare contro il governo*
>
>
>
(Hoepli) | La definizione del Treccani è obsoleta, scorretta o, comunque, imprecisa, ciò perché 'sbraitare' non implica necessariamente una 'voce alta'. Infatti, essa -- la voce --, può anche essere normale, giusto quello che serve acché possa essere sentita.
Peraltro, a suffragio di quanto sopra, 'sbraitare silenziosamente' non è neanche riportato nell'elenco degli ossimori italiani, sebbene uno che sbraitasse silenziosamente dovrebbe essere portato subito al più vicino centro d'igiene mentale. |
6,345 | Nel romanzo *Non so niente di te* di Paola Mastrocola, pubblicato da Einaudi, ho letto (il corsivo è mio):
>
> Ognuno ha il suo modo di non dormire, la notte, il suo stile, le sue tecniche di insonnia. C'è chi [...]. E c'è chi si ribella, non ammette, non concepisce che possa capitare a lui, è ostile, sbuffa, *sbraita*, finge di dormire, strizza gli occhi perché il sonno arrivi, si sforza di non pensarci e ci pensa sempre di piú, finendo per restare a letto teso come una corda di violino.
>
>
>
Siccome non conoscevo il significato del verbo "sbraitare", l'ho cercato nel [vocabolario Treccani](http://www.treccani.it/vocabolario/sbraitare/), dove ho trovato questa accezione del termine:
>
> protestare manifestando a voce alta il proprio risentimento: *s. contro il governo, contro le tasse; tutti sbraitano, ma nessuno ha il coraggio di ribellarsi*.
>
>
>
Comunque, non mi sembra il caso di mettersi a gridare durante la notte quando si ha l'insonnia. Per questa ragione vi chiedo: il verbo "sbraitare" può avere un uso figurato che non implichi parlare a voce alta o gridare? Si tratta di un uso letterario o è invece comune? | 2015/12/20 | [
"https://italian.stackexchange.com/questions/6345",
"https://italian.stackexchange.com",
"https://italian.stackexchange.com/users/707/"
] | >
> Comunque, non mi sembra il caso di mettersi a gridare durante la notte quando si ha l'insonnia.
>
>
>
Beh, sicuramente non è il caso, ma se lo vedi come un gesto di disappunto ha senso che capiti.
>
> il verbo "sbraitare" può avere un uso figurato che non implichi parlare a voce alta o gridare?
>
>
>
Non che io sappia (salvo il caso citato da Josh61), oltretutto appunto, come ho già detto implicitamente sopra ritengo che nel brano sia usato in modo letterale. Se ci fai caso nessuna delle altre azioni è usata in senso figurato (in particolare "sbuffa", "finge di dormire", e "strizza gli occhi" sembrano voler descrivere la situazione in senso letterale), il che suggerisce che anche lo sbraitare non lo sia.
>
> Si tratta di un uso letterario o è invece comune?
>
>
>
È molto comune, assolutamente non letterario. | La definizione del Treccani è obsoleta, scorretta o, comunque, imprecisa, ciò perché 'sbraitare' non implica necessariamente una 'voce alta'. Infatti, essa -- la voce --, può anche essere normale, giusto quello che serve acché possa essere sentita.
Peraltro, a suffragio di quanto sopra, 'sbraitare silenziosamente' non è neanche riportato nell'elenco degli ossimori italiani, sebbene uno che sbraitasse silenziosamente dovrebbe essere portato subito al più vicino centro d'igiene mentale. |
6,345 | Nel romanzo *Non so niente di te* di Paola Mastrocola, pubblicato da Einaudi, ho letto (il corsivo è mio):
>
> Ognuno ha il suo modo di non dormire, la notte, il suo stile, le sue tecniche di insonnia. C'è chi [...]. E c'è chi si ribella, non ammette, non concepisce che possa capitare a lui, è ostile, sbuffa, *sbraita*, finge di dormire, strizza gli occhi perché il sonno arrivi, si sforza di non pensarci e ci pensa sempre di piú, finendo per restare a letto teso come una corda di violino.
>
>
>
Siccome non conoscevo il significato del verbo "sbraitare", l'ho cercato nel [vocabolario Treccani](http://www.treccani.it/vocabolario/sbraitare/), dove ho trovato questa accezione del termine:
>
> protestare manifestando a voce alta il proprio risentimento: *s. contro il governo, contro le tasse; tutti sbraitano, ma nessuno ha il coraggio di ribellarsi*.
>
>
>
Comunque, non mi sembra il caso di mettersi a gridare durante la notte quando si ha l'insonnia. Per questa ragione vi chiedo: il verbo "sbraitare" può avere un uso figurato che non implichi parlare a voce alta o gridare? Si tratta di un uso letterario o è invece comune? | 2015/12/20 | [
"https://italian.stackexchange.com/questions/6345",
"https://italian.stackexchange.com",
"https://italian.stackexchange.com/users/707/"
] | >
> Comunque, non mi sembra il caso di mettersi a gridare durante la notte quando si ha l'insonnia.
>
>
>
Beh, sicuramente non è il caso, ma se lo vedi come un gesto di disappunto ha senso che capiti.
>
> il verbo "sbraitare" può avere un uso figurato che non implichi parlare a voce alta o gridare?
>
>
>
Non che io sappia (salvo il caso citato da Josh61), oltretutto appunto, come ho già detto implicitamente sopra ritengo che nel brano sia usato in modo letterale. Se ci fai caso nessuna delle altre azioni è usata in senso figurato (in particolare "sbuffa", "finge di dormire", e "strizza gli occhi" sembrano voler descrivere la situazione in senso letterale), il che suggerisce che anche lo sbraitare non lo sia.
>
> Si tratta di un uso letterario o è invece comune?
>
>
>
È molto comune, assolutamente non letterario. | Il termine ***[sbraitare](http://dizionari.repubblica.it/Italiano/S/sbraitare.php)*** nel brano viene probabilmente usato nel senso figurato di protestare, indignarsi:
>
> * Vociare concitatamente, scompostamente, quasi urlando: sbraitava come un ossesso di avere ragione
> * (per estensione) Protestare, ribellarsi, mostrarsi indignato contro qualcuno o qualcosa: *sbraitare contro il governo*
>
>
>
(Hoepli) |
46,622,918 | This is my sample html code.
```
<div class="content">
<M class="mclass">
<section id="sideA">
<div id="mainContent">
<div class="requestClass">
<span>Check</span>
<input type="text" id="box">
</div>
</div>
<section>
<section id="sideB">
...
<section>
</M>
</div>
```
I want to set some value to my text field ("box"). So I tired to set like below code
```
driver.findElement(By.xpath("...")).sendKeys("SetValue");
```
My Xpath id is correct, it's exist in the page but am getting this error
```
no such element: Unable to locate element: {"method":"xpath","selector":"id("..."}
```
Why I am getting this error because of my custom tag,if yes how to get element inside custom tag? | 2017/10/07 | [
"https://Stackoverflow.com/questions/46622918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4804899/"
] | As per the `HTML` you have provided to fill in some value to the text field represented by `<input type="text" id="box">` you can use either of the following line of code:
1. `cssSelector` :
```
driver.findElement(By.cssSelector("section#sideA input#box")).sendKeys("SetValue");
```
2. `xpath` :
```
driver.findElement(By.xpath("//section[@id='sideA']//input[@id='box']")).sendKeys("SetValue");
``` | If you still want to use XPath. This worked for me-
```
driver.FindElement(By.XPath(@"//*[@id='box']")).SendKeys("AB");
```
I don't think the custom tag causes any problem as the CssSelector also works-
```
driver.FindElement(By.CssSelector(@"m[class='mclass'] input")).SendKeys("AB");
``` |
46,622,918 | This is my sample html code.
```
<div class="content">
<M class="mclass">
<section id="sideA">
<div id="mainContent">
<div class="requestClass">
<span>Check</span>
<input type="text" id="box">
</div>
</div>
<section>
<section id="sideB">
...
<section>
</M>
</div>
```
I want to set some value to my text field ("box"). So I tired to set like below code
```
driver.findElement(By.xpath("...")).sendKeys("SetValue");
```
My Xpath id is correct, it's exist in the page but am getting this error
```
no such element: Unable to locate element: {"method":"xpath","selector":"id("..."}
```
Why I am getting this error because of my custom tag,if yes how to get element inside custom tag? | 2017/10/07 | [
"https://Stackoverflow.com/questions/46622918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4804899/"
] | As per the `HTML` you have provided to fill in some value to the text field represented by `<input type="text" id="box">` you can use either of the following line of code:
1. `cssSelector` :
```
driver.findElement(By.cssSelector("section#sideA input#box")).sendKeys("SetValue");
```
2. `xpath` :
```
driver.findElement(By.xpath("//section[@id='sideA']//input[@id='box']")).sendKeys("SetValue");
``` | You can use `ID` or `xpath` to locate it, My suggestion you have to use `ID`. Also use Explicit wait till element to be visible.
Using `ID`, your code is like this:
```
WebElement elem= driver.findElement(By.id("box"));
WebDriverWait wait=new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.visibilityOf(elem));
elem.sendKeys("test");
```
You can also use `JavascriptExecutor`
```
WebElement elem= driver.findElement(By.id("box"));
WebDriverWait wait=new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.visibilityOf(elem));
JavascriptExecutor myExecutor = ((JavascriptExecutor) driver);
myExecutor.executeScript("arguments[0].value='test';", elem);
``` |
2,869,504 | >
> I would like a **hint and only a hint** to prove
>
>
> $\forall \sigma\in S\_n$ , $S\_n$ is a finite symmetric group of permutation
>
>
> $\displaystyle \left|\prod\limits\_{1\le i<j\le n}\big(\sigma(i)-\sigma(j)\big)\right|=\left|\prod\limits\_{1\le i<j\le n}\big(i-j\big)\right|$
>
>
>
thanks !! | 2018/08/01 | [
"https://math.stackexchange.com/questions/2869504",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/460772/"
] | HINT: try by induction, starting from $n=2$ | Here is another: prove their squares are equal, both being $\prod\_{i\neq j} (i-j)$. |
2,869,504 | >
> I would like a **hint and only a hint** to prove
>
>
> $\forall \sigma\in S\_n$ , $S\_n$ is a finite symmetric group of permutation
>
>
> $\displaystyle \left|\prod\limits\_{1\le i<j\le n}\big(\sigma(i)-\sigma(j)\big)\right|=\left|\prod\limits\_{1\le i<j\le n}\big(i-j\big)\right|$
>
>
>
thanks !! | 2018/08/01 | [
"https://math.stackexchange.com/questions/2869504",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/460772/"
] | HINT: Consider the [Vandermonde matrix](https://en.wikipedia.org/wiki/Vandermonde_matrix) | Here is another: prove their squares are equal, both being $\prod\_{i\neq j} (i-j)$. |
29,498,006 | I tried some commands such as
```
echo "Your text here" | ssh hostname 'cat >> output.txt'
```
but it didnt work.
How can I write in a file inside the server using this exec code or just the ssh command that I will put to String command.
```
public class TestWrite{
private static final String user = "username here";
private static final String host = "host here";
private static final String password = "pass here";
public static void main(String[] arg){
try{
JSch jsch=new JSch();
Session session=jsch.getSession(user, host, 22);
session.setPassword(password);
session.setConfig("StrictHostKeyChecking", "no");
session.connect();
String command = "Command here";
Channel channel=session.openChannel("exec");
((ChannelExec)channel).setCommand(command);
channel.setInputStream(null);
((ChannelExec)channel).setErrStream(System.err);
InputStream in=channel.getInputStream();
channel.connect();
byte[] tmp=new byte[1024];
while(true){
while(in.available()>0){
int i=in.read(tmp, 0, 1024);
if(i<0)break;
System.out.print(new String(tmp, 0, i));
}
if(channel.isClosed()){
if(in.available()>0) continue;
System.out.println("exit-status: "+channel.getExitStatus());
break;
}
try{Thread.sleep(1000);}catch(Exception ee){}
}
channel.disconnect();
session.disconnect();
}
catch(Exception e){
System.out.println(e);
}
}
}
``` | 2015/04/07 | [
"https://Stackoverflow.com/questions/29498006",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3880831/"
] | You can write to a file with
```
echo "your text here" > file
```
You don't need `ssh` because Jsch takes its place. | Try a command like:
```
ssh hostname 'echo "Your text here" >> output.txt'
``` |
11,671 | Vistors to our website can fill out a form to create an account. It is a CiviCRM profile, and "WordPress user account registration option" is set to "Account creation required". The username and password fields are shown above the profile but a Wordpress account is not created when the form is saved. A Contact is created, but it is linked to the Wordpress admin account (ID #1).
I attempted to replicate this on the [Wordpress Demo site](http://wpmaster.demo.civicrm.org/). I created a profile that required Wordpress registration, but it (quite reasonably) would not allow me, as the demo user, to create a page for embedding it. When I view the profile in "Create Mode", it does not show the username and password fields (even when not logged in), and no new contact or account is created. | 2016/05/06 | [
"https://civicrm.stackexchange.com/questions/11671",
"https://civicrm.stackexchange.com",
"https://civicrm.stackexchange.com/users/897/"
] | Occasionally WordPress plugins can interfere with user account creation. Have you installed any spam prevention plugins recently? If so, try turning it off and seeing if the user creation option shows up on your profile.
The reason this isn't working with WordPress demo site, is that User Creation is turned off on all demo sites. You may want to check that this is enabled on your own site as well. | As it turns out, it was a custom extension that was causing the problem. Under certain conditions the extension would generate a blank `cms_name` value. When `wp_insert_user` was called with a blank username in the Wordpress.php system backend, it returned a `WP_Error` object instead of a userID. This error was ignored by CiviCRM and the newly created Contact was assigned Wordpress ID #1. |
24,752,810 | While browsing the web, **I need to fake my screen resolution** to websites I'm viewing but **keep my viewport the same** (Chrome's or FF's emulating doesn't solve my problem).
For instance, if I go to <http://www.whatismyscreenresolution.com/> from a browser in full screen mode which has 1920x1080px resolution **I want that site to think I am using 1024x728px** but still be able to browse in full screen mode.
One of my guessess is I need to override js variables screen.width and screen.height somehow (or get rid of js completely but the particular site won't work with js disabled), but how? And would that be enough?
**It's for anonymous purposes** I hope I don't need to explain in detail. I need to look as one device even though I am accessing the site from various devices (Tor browser not an option - changes IP). The browser I'm using is firefox 30.0 and it runs on VPS (Xubuntu 14.04) I'm connecting to remotely.
This thread ([Spoof JS Objects](https://stackoverflow.com/questions/6713434/spoof-js-objects)) brought me close but not quite enough, it remains unanswered. I've struggeled upon this question for quite a long time so any recommedation is highly appreciated! | 2014/07/15 | [
"https://Stackoverflow.com/questions/24752810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3839707/"
] | A very, very lazy option (to avoid setting up a [Google Custom Search Engine](http://google.com/cse)) is to make a form that points at Google with a hidden query element that limits the search to your own site:
```
<div id="contentsearch">
<form id="searchForm" name="searchForm" action="http://google.com/search">
<input name="q" type="text" value="search" maxlength="200" />
<input name="q" type="hidden" value="site:mysite.com"/>
<input name="submit" type="submit" value="Search" />
</form>
</div>
```
Aside from the laziness, this method gives you a bit more control over the appearance of the search form, compared to a CSE. | If your site is well index by Google a quick and ready solution is use [Google CSE](http://google.com/cse).
Other than that for a static website with hard coded html pages and directory containing images; yes it is possible to create search mechanism. But trust me it is more hectic and resource consuming then creating a dynamic website.
Using PHP to search in directories and within files will be very inefficient. Instead of providing complicated PHP workarounds I would suggest go for a dynamic CMS driven website. |
24,752,810 | While browsing the web, **I need to fake my screen resolution** to websites I'm viewing but **keep my viewport the same** (Chrome's or FF's emulating doesn't solve my problem).
For instance, if I go to <http://www.whatismyscreenresolution.com/> from a browser in full screen mode which has 1920x1080px resolution **I want that site to think I am using 1024x728px** but still be able to browse in full screen mode.
One of my guessess is I need to override js variables screen.width and screen.height somehow (or get rid of js completely but the particular site won't work with js disabled), but how? And would that be enough?
**It's for anonymous purposes** I hope I don't need to explain in detail. I need to look as one device even though I am accessing the site from various devices (Tor browser not an option - changes IP). The browser I'm using is firefox 30.0 and it runs on VPS (Xubuntu 14.04) I'm connecting to remotely.
This thread ([Spoof JS Objects](https://stackoverflow.com/questions/6713434/spoof-js-objects)) brought me close but not quite enough, it remains unanswered. I've struggeled upon this question for quite a long time so any recommedation is highly appreciated! | 2014/07/15 | [
"https://Stackoverflow.com/questions/24752810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3839707/"
] | There are quite a few solutions available for this. In no particular order:
**Free or Open Source**
1. [Google Custom Search Engine](https://www.google.com/cse/)
2. [Tapir](http://tapirgo.com/) - hosted service that indexes pages on your RSS feed.
3. [Tipue](http://www.tipue.com/search/) - self hosted javaScript plugin, well documented, includes options for pinned search results.
4. [lunr.js](http://lunrjs.com/) - javaScript library.
5. [phinde](https://github.com/cweiske/phinde) - self hosted php and elasticsearch based search engine
See also <http://indieweb.org/search#Software>
**Subscription (aka paid) Services:**
5. [Google Site Search](https://www.google.com/work/search/products/gss.html)
6. [Swiftype](https://swiftype.com/) - offers a free plan for personal sites/blogs.
7. [Algolia](http://www.algolia.com/)
8. [Amazon Cloud Search](http://aws.amazon.com/cloudsearch/) | If your site is well index by Google a quick and ready solution is use [Google CSE](http://google.com/cse).
Other than that for a static website with hard coded html pages and directory containing images; yes it is possible to create search mechanism. But trust me it is more hectic and resource consuming then creating a dynamic website.
Using PHP to search in directories and within files will be very inefficient. Instead of providing complicated PHP workarounds I would suggest go for a dynamic CMS driven website. |
24,752,810 | While browsing the web, **I need to fake my screen resolution** to websites I'm viewing but **keep my viewport the same** (Chrome's or FF's emulating doesn't solve my problem).
For instance, if I go to <http://www.whatismyscreenresolution.com/> from a browser in full screen mode which has 1920x1080px resolution **I want that site to think I am using 1024x728px** but still be able to browse in full screen mode.
One of my guessess is I need to override js variables screen.width and screen.height somehow (or get rid of js completely but the particular site won't work with js disabled), but how? And would that be enough?
**It's for anonymous purposes** I hope I don't need to explain in detail. I need to look as one device even though I am accessing the site from various devices (Tor browser not an option - changes IP). The browser I'm using is firefox 30.0 and it runs on VPS (Xubuntu 14.04) I'm connecting to remotely.
This thread ([Spoof JS Objects](https://stackoverflow.com/questions/6713434/spoof-js-objects)) brought me close but not quite enough, it remains unanswered. I've struggeled upon this question for quite a long time so any recommedation is highly appreciated! | 2014/07/15 | [
"https://Stackoverflow.com/questions/24752810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3839707/"
] | I was searching for solution for searching for my blog created using Jekyll but didn't found good one, also Custom Google Search was giving me ads and results from subdomains, so it was not good. So I've created my own solution for this. I've written an article about [how to create search for static site like Jekyll](https://translate.google.com/translate?sl=pl&tl=en&js=y&prev=_t&hl=pl&ie=UTF-8&u=https%3A%2F%2Fjcubic.pl%2F2018%2F10%2Fwyszukiwarka-plikow-statycznych-html-php-sqlite.html&edit-text=&act=url) it's in Polish and translated using google translate.
Probably will create better manual translation or rewrite on my English blog soon.
The solution is python script that create SQLite database from HTML files and small PHP script that show search results. But it will require that your static site hosting also support PHP.
Just in case the article go down, here is the code, it's created just for my blog (my html and file structure) so it need to be tweaked to work with your blog.
Python script:
```python
import os, sys, re, sqlite3
from bs4 import BeautifulSoup
def get_data(html):
"""return dictionary with title url and content of the blog post"""
tree = BeautifulSoup(html, 'html5lib')
body = tree.body
if body is None:
return None
for tag in body.select('script'):
tag.decompose()
for tag in body.select('style'):
tag.decompose()
for tag in body.select('figure'): # ignore code snippets
tag.decompose()
text = tree.findAll("div", {"class": "body"})
if len(text) > 0:
text = text[0].get_text(separator='\n')
else:
text = None
title = tree.findAll("h2", {"itemprop" : "title"}) # my h2 havee this attr
url = tree.findAll("link", {"rel": "canonical"}) # get url
if len(title) > 0:
title = title[0].get_text()
else:
title = None
if len(url) > 0:
url = url[0]['href']
else:
url = None
result = {
"title": title,
"url": url,
"text": text
}
return result
if __name__ == '__main__':
if len(sys.argv) == 2:
db_file = 'index.db'
# usunięcie starego pliku
if os.path.exists(db_file):
os.remove(db_file)
conn = sqlite3.connect(db_file)
c = conn.cursor()
c.execute('CREATE TABLE page(title text, url text, content text)')
for root, dirs, files in os.walk(sys.argv[1]):
for name in files:
# my files are in 20.* directories (eg. 2018) [/\\] is for windows and unix
if name.endswith(".html") and re.search(r"[/\\]20[0-9]{2}", root):
fname = os.path.join(root, name)
f = open(fname, "r")
data = get_data(f.read())
f.close()
if data is not None:
data = (data['title'], data['url'], data['text']
c.execute('INSERT INTO page VALUES(?, ?, ?)', data))
print "indexed %s" % data['url']
sys.stdout.flush()
conn.commit()
conn.close()
```
and PHP search script:
```php
function mark($query, $str) {
return preg_replace("%(" . $query . ")%i", '<mark>$1</mark>', $str);
}
if (isset($_GET['q'])) {
$db = new PDO('sqlite:index.db');
$stmt = $db->prepare('SELECT * FROM page WHERE content LIKE :var OR title LIKE :var');
$wildcarded = '%'. $_GET['q'] .'%';
$stmt->bindParam(':var', $wildcarded);
$stmt->execute();
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
$query = str_replace("%", "\\%", preg_quote($_GET['q']));
$re = "%(?>\S+\s*){0,10}(" . $query . ")\s*(?>\S+\s*){0,10}%i";
if (count($data) == 0) {
echo "<p>Brak wyników</p>";
} else {
foreach ($data as $row) {
if (preg_match($re, $row['content'], $match)) {
echo '<h3><a href="' . $row['url'] . '">' . mark($query, $row['title']) . '</a></h2>';
$text = trim($match[0], " \t\n\r\0\x0B,.{}()-");
echo '<p>' . mark($query, $text) . '</p>';
}
}
}
}
```
In my code an in article I've wrapped this PHP script in the same layout as other pages by adding front matter to PHP file.
If you can't use PHP on your hosting you can try to use [sql.js which is SQLite compiled to JS with Emscripten](https://github.com/kripken/sql.js). | If your site is well index by Google a quick and ready solution is use [Google CSE](http://google.com/cse).
Other than that for a static website with hard coded html pages and directory containing images; yes it is possible to create search mechanism. But trust me it is more hectic and resource consuming then creating a dynamic website.
Using PHP to search in directories and within files will be very inefficient. Instead of providing complicated PHP workarounds I would suggest go for a dynamic CMS driven website. |
24,752,810 | While browsing the web, **I need to fake my screen resolution** to websites I'm viewing but **keep my viewport the same** (Chrome's or FF's emulating doesn't solve my problem).
For instance, if I go to <http://www.whatismyscreenresolution.com/> from a browser in full screen mode which has 1920x1080px resolution **I want that site to think I am using 1024x728px** but still be able to browse in full screen mode.
One of my guessess is I need to override js variables screen.width and screen.height somehow (or get rid of js completely but the particular site won't work with js disabled), but how? And would that be enough?
**It's for anonymous purposes** I hope I don't need to explain in detail. I need to look as one device even though I am accessing the site from various devices (Tor browser not an option - changes IP). The browser I'm using is firefox 30.0 and it runs on VPS (Xubuntu 14.04) I'm connecting to remotely.
This thread ([Spoof JS Objects](https://stackoverflow.com/questions/6713434/spoof-js-objects)) brought me close but not quite enough, it remains unanswered. I've struggeled upon this question for quite a long time so any recommedation is highly appreciated! | 2014/07/15 | [
"https://Stackoverflow.com/questions/24752810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3839707/"
] | A very, very lazy option (to avoid setting up a [Google Custom Search Engine](http://google.com/cse)) is to make a form that points at Google with a hidden query element that limits the search to your own site:
```
<div id="contentsearch">
<form id="searchForm" name="searchForm" action="http://google.com/search">
<input name="q" type="text" value="search" maxlength="200" />
<input name="q" type="hidden" value="site:mysite.com"/>
<input name="submit" type="submit" value="Search" />
</form>
</div>
```
Aside from the laziness, this method gives you a bit more control over the appearance of the search form, compared to a CSE. | I was searching for solution for searching for my blog created using Jekyll but didn't found good one, also Custom Google Search was giving me ads and results from subdomains, so it was not good. So I've created my own solution for this. I've written an article about [how to create search for static site like Jekyll](https://translate.google.com/translate?sl=pl&tl=en&js=y&prev=_t&hl=pl&ie=UTF-8&u=https%3A%2F%2Fjcubic.pl%2F2018%2F10%2Fwyszukiwarka-plikow-statycznych-html-php-sqlite.html&edit-text=&act=url) it's in Polish and translated using google translate.
Probably will create better manual translation or rewrite on my English blog soon.
The solution is python script that create SQLite database from HTML files and small PHP script that show search results. But it will require that your static site hosting also support PHP.
Just in case the article go down, here is the code, it's created just for my blog (my html and file structure) so it need to be tweaked to work with your blog.
Python script:
```python
import os, sys, re, sqlite3
from bs4 import BeautifulSoup
def get_data(html):
"""return dictionary with title url and content of the blog post"""
tree = BeautifulSoup(html, 'html5lib')
body = tree.body
if body is None:
return None
for tag in body.select('script'):
tag.decompose()
for tag in body.select('style'):
tag.decompose()
for tag in body.select('figure'): # ignore code snippets
tag.decompose()
text = tree.findAll("div", {"class": "body"})
if len(text) > 0:
text = text[0].get_text(separator='\n')
else:
text = None
title = tree.findAll("h2", {"itemprop" : "title"}) # my h2 havee this attr
url = tree.findAll("link", {"rel": "canonical"}) # get url
if len(title) > 0:
title = title[0].get_text()
else:
title = None
if len(url) > 0:
url = url[0]['href']
else:
url = None
result = {
"title": title,
"url": url,
"text": text
}
return result
if __name__ == '__main__':
if len(sys.argv) == 2:
db_file = 'index.db'
# usunięcie starego pliku
if os.path.exists(db_file):
os.remove(db_file)
conn = sqlite3.connect(db_file)
c = conn.cursor()
c.execute('CREATE TABLE page(title text, url text, content text)')
for root, dirs, files in os.walk(sys.argv[1]):
for name in files:
# my files are in 20.* directories (eg. 2018) [/\\] is for windows and unix
if name.endswith(".html") and re.search(r"[/\\]20[0-9]{2}", root):
fname = os.path.join(root, name)
f = open(fname, "r")
data = get_data(f.read())
f.close()
if data is not None:
data = (data['title'], data['url'], data['text']
c.execute('INSERT INTO page VALUES(?, ?, ?)', data))
print "indexed %s" % data['url']
sys.stdout.flush()
conn.commit()
conn.close()
```
and PHP search script:
```php
function mark($query, $str) {
return preg_replace("%(" . $query . ")%i", '<mark>$1</mark>', $str);
}
if (isset($_GET['q'])) {
$db = new PDO('sqlite:index.db');
$stmt = $db->prepare('SELECT * FROM page WHERE content LIKE :var OR title LIKE :var');
$wildcarded = '%'. $_GET['q'] .'%';
$stmt->bindParam(':var', $wildcarded);
$stmt->execute();
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
$query = str_replace("%", "\\%", preg_quote($_GET['q']));
$re = "%(?>\S+\s*){0,10}(" . $query . ")\s*(?>\S+\s*){0,10}%i";
if (count($data) == 0) {
echo "<p>Brak wyników</p>";
} else {
foreach ($data as $row) {
if (preg_match($re, $row['content'], $match)) {
echo '<h3><a href="' . $row['url'] . '">' . mark($query, $row['title']) . '</a></h2>';
$text = trim($match[0], " \t\n\r\0\x0B,.{}()-");
echo '<p>' . mark($query, $text) . '</p>';
}
}
}
}
```
In my code an in article I've wrapped this PHP script in the same layout as other pages by adding front matter to PHP file.
If you can't use PHP on your hosting you can try to use [sql.js which is SQLite compiled to JS with Emscripten](https://github.com/kripken/sql.js). |
24,752,810 | While browsing the web, **I need to fake my screen resolution** to websites I'm viewing but **keep my viewport the same** (Chrome's or FF's emulating doesn't solve my problem).
For instance, if I go to <http://www.whatismyscreenresolution.com/> from a browser in full screen mode which has 1920x1080px resolution **I want that site to think I am using 1024x728px** but still be able to browse in full screen mode.
One of my guessess is I need to override js variables screen.width and screen.height somehow (or get rid of js completely but the particular site won't work with js disabled), but how? And would that be enough?
**It's for anonymous purposes** I hope I don't need to explain in detail. I need to look as one device even though I am accessing the site from various devices (Tor browser not an option - changes IP). The browser I'm using is firefox 30.0 and it runs on VPS (Xubuntu 14.04) I'm connecting to remotely.
This thread ([Spoof JS Objects](https://stackoverflow.com/questions/6713434/spoof-js-objects)) brought me close but not quite enough, it remains unanswered. I've struggeled upon this question for quite a long time so any recommedation is highly appreciated! | 2014/07/15 | [
"https://Stackoverflow.com/questions/24752810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3839707/"
] | There are quite a few solutions available for this. In no particular order:
**Free or Open Source**
1. [Google Custom Search Engine](https://www.google.com/cse/)
2. [Tapir](http://tapirgo.com/) - hosted service that indexes pages on your RSS feed.
3. [Tipue](http://www.tipue.com/search/) - self hosted javaScript plugin, well documented, includes options for pinned search results.
4. [lunr.js](http://lunrjs.com/) - javaScript library.
5. [phinde](https://github.com/cweiske/phinde) - self hosted php and elasticsearch based search engine
See also <http://indieweb.org/search#Software>
**Subscription (aka paid) Services:**
5. [Google Site Search](https://www.google.com/work/search/products/gss.html)
6. [Swiftype](https://swiftype.com/) - offers a free plan for personal sites/blogs.
7. [Algolia](http://www.algolia.com/)
8. [Amazon Cloud Search](http://aws.amazon.com/cloudsearch/) | I was searching for solution for searching for my blog created using Jekyll but didn't found good one, also Custom Google Search was giving me ads and results from subdomains, so it was not good. So I've created my own solution for this. I've written an article about [how to create search for static site like Jekyll](https://translate.google.com/translate?sl=pl&tl=en&js=y&prev=_t&hl=pl&ie=UTF-8&u=https%3A%2F%2Fjcubic.pl%2F2018%2F10%2Fwyszukiwarka-plikow-statycznych-html-php-sqlite.html&edit-text=&act=url) it's in Polish and translated using google translate.
Probably will create better manual translation or rewrite on my English blog soon.
The solution is python script that create SQLite database from HTML files and small PHP script that show search results. But it will require that your static site hosting also support PHP.
Just in case the article go down, here is the code, it's created just for my blog (my html and file structure) so it need to be tweaked to work with your blog.
Python script:
```python
import os, sys, re, sqlite3
from bs4 import BeautifulSoup
def get_data(html):
"""return dictionary with title url and content of the blog post"""
tree = BeautifulSoup(html, 'html5lib')
body = tree.body
if body is None:
return None
for tag in body.select('script'):
tag.decompose()
for tag in body.select('style'):
tag.decompose()
for tag in body.select('figure'): # ignore code snippets
tag.decompose()
text = tree.findAll("div", {"class": "body"})
if len(text) > 0:
text = text[0].get_text(separator='\n')
else:
text = None
title = tree.findAll("h2", {"itemprop" : "title"}) # my h2 havee this attr
url = tree.findAll("link", {"rel": "canonical"}) # get url
if len(title) > 0:
title = title[0].get_text()
else:
title = None
if len(url) > 0:
url = url[0]['href']
else:
url = None
result = {
"title": title,
"url": url,
"text": text
}
return result
if __name__ == '__main__':
if len(sys.argv) == 2:
db_file = 'index.db'
# usunięcie starego pliku
if os.path.exists(db_file):
os.remove(db_file)
conn = sqlite3.connect(db_file)
c = conn.cursor()
c.execute('CREATE TABLE page(title text, url text, content text)')
for root, dirs, files in os.walk(sys.argv[1]):
for name in files:
# my files are in 20.* directories (eg. 2018) [/\\] is for windows and unix
if name.endswith(".html") and re.search(r"[/\\]20[0-9]{2}", root):
fname = os.path.join(root, name)
f = open(fname, "r")
data = get_data(f.read())
f.close()
if data is not None:
data = (data['title'], data['url'], data['text']
c.execute('INSERT INTO page VALUES(?, ?, ?)', data))
print "indexed %s" % data['url']
sys.stdout.flush()
conn.commit()
conn.close()
```
and PHP search script:
```php
function mark($query, $str) {
return preg_replace("%(" . $query . ")%i", '<mark>$1</mark>', $str);
}
if (isset($_GET['q'])) {
$db = new PDO('sqlite:index.db');
$stmt = $db->prepare('SELECT * FROM page WHERE content LIKE :var OR title LIKE :var');
$wildcarded = '%'. $_GET['q'] .'%';
$stmt->bindParam(':var', $wildcarded);
$stmt->execute();
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
$query = str_replace("%", "\\%", preg_quote($_GET['q']));
$re = "%(?>\S+\s*){0,10}(" . $query . ")\s*(?>\S+\s*){0,10}%i";
if (count($data) == 0) {
echo "<p>Brak wyników</p>";
} else {
foreach ($data as $row) {
if (preg_match($re, $row['content'], $match)) {
echo '<h3><a href="' . $row['url'] . '">' . mark($query, $row['title']) . '</a></h2>';
$text = trim($match[0], " \t\n\r\0\x0B,.{}()-");
echo '<p>' . mark($query, $text) . '</p>';
}
}
}
}
```
In my code an in article I've wrapped this PHP script in the same layout as other pages by adding front matter to PHP file.
If you can't use PHP on your hosting you can try to use [sql.js which is SQLite compiled to JS with Emscripten](https://github.com/kripken/sql.js). |
402,150 | For a prime $p$, let $N(p)$ be the number of solutions $1 \le x \le p$ to $x^x \equiv 1 \mod p$. I am interested in methods to bound $N(p)$.
**Background:** This quantity appears in Problem 1 of the Miklós Schweitzer Competition 2010 where it was asked to prove $N(p) \ll p^{c}$ for some $c<\frac{1}{2}$. Let me quickly explain how one can solve this problem and why the exponent $\frac{1}{2}$ is critical.
For each divisor $d$ of $p-1$, let $A\_d$ be the set of numbers $1 \le x \le p$ for which $(x;p-1)=d$ and $x^x \equiv 1 \mod p$ so $N(p)=\sum\_{d \mid p-1} \vert A\_d\vert$.
The condition $x^x \equiv 1 \mod p$ now just says that $x$ is a $e$-th power modulo $p$ where $e=\frac{p-1}{d}$ is the complementary divisor.
So trivially $\vert A\_d\vert \ll \min(d,e) \ll p^{1/2}$ and hence $N(p) \ll p^{1/2+\varepsilon}$.
To improve this exponent, it clearly suffices to improve the bound for $\vert A\_d\vert$ when $d \approx e \approx p^{1/2}$.
Here the sum-product theorem over finite fields comes in handy: Since $A\_d+A\_d$ still contains essentially only multiples of $d$, it is easy to see that $\vert A\_d+A\_d\vert \le 2e$ and similarly $A\_d \cdot A\_d$ still contains only $e$-th powers so that $\vert A\_d \cdot A\_d\vert \le d$. Hence $\max(\vert A\_d +A\_d\vert, \vert A\_d \cdot A\_d\vert) \ll \max(d,e)$.
But by the (currently best-known version of the) sum-product theorem the LHS is at least $\vert A\_d\vert^{5/4-\varepsilon}$ so that we get the bound $\vert A\_d\vert \ll \max(d,e)^{4/5+\varepsilon}$ and we win.
Indeed, working out the exponents, we can prove $N(p) \ll p^{4/9+\varepsilon}$ this way.
Now I would be curious to learn about
**Question 1:** What are some other techniques that can be applied to get a non-trivial bound for $N(p)$? To be clear, I would be equally interested in (possibly more difficult) techniques that lead to an exponent $c<\frac{4}{9}$ as well as more elementary techniques that lead to a (possibly worse, but) non-trivial result.
Now even if one assumes a best possible sum-product conjecture to be true, it seems that by the method described above we could only prove $N(p) \ll p^{1/3+\varepsilon}$. On the other hand, it seems natural to conjecture that even $N(p) \ll p^{\varepsilon}$ is true, albeit very hard to prove. Given this gap, I am wondering about
**Question 2:** Are there some "natural/standard" conjectures that would imply an exponent less than $\frac{1}{3}$, possibly even as small as an $\varepsilon$? Or is there a good heuristic why the exponent $\frac{1}{3}$ is a natural barrier here?
EDIT: As pointed out in the answers, Cilleruelo and Garaev (2016) proved $N(p) \ll p^{27/82}$. This leaves us with the question of whether there is a natural/standard conjecture that would imply that $N(p) \ll p^{\varepsilon}$.
PS: To be clear, I don't claim that this is a very important problem on its own right. It just seems like a good toy problem to test our understanding of the interference between multiplicative and additive structures. | 2021/08/20 | [
"https://mathoverflow.net/questions/402150",
"https://mathoverflow.net",
"https://mathoverflow.net/users/81145/"
] | The $1/3 + \varepsilon$ is not a barrier anymore!
Resorting to estimates of exponential sums over subgroups due to Shkredov and Shteinikov, in the paper ["On the congruence $x^{x} \equiv 1 \pmod{p}$" (PAMS, **144** (2016), no. 6, pp. 2411 - 2418)](https://www.ams.org/journals/proc/2016-144-06/S0002-9939-2015-12919-X/S0002-9939-2015-12919-X.pdf), [J. Cilleruelo](https://mathoverflow.net/users/31020/javier) (†) and M. Z. Garaev proved the following result:
>
> Let $J(p)$ denote the number of solutions to the congruence $$x^{x} \equiv 1 \pmod{p}, \quad 1 \leq x \leq p-1.$$ Then, for any $\varepsilon>0$, there exists $c:=c(\varepsilon)>0$ such that $J(p) < c \, p^{27/82 + \varepsilon}$.
>
>
>
I am not totally sure, but I believe that this theorem is the state of the art on this problem... | Another answer already gives a reference to a smaller exponent, but since the OP states that they are interested in an elementary proof, this is a proof I came up with which shows $c < \frac{3}{7} + \varepsilon$ (which is smaller than $\frac{4}{9}$).
For $A \subset \left( \mathbb{Z} / p \mathbb{Z} \right)^{\*}$ we define $A A = \left\{ xy : x, y \in A \right\} \subset \mathbb{Z} / p \mathbb{Z}$ and $r (a) = \# \left\{ xy \equiv a : x, y \in A \right\}$, where throughout we will let $\equiv$ denote equality $\bmod p$ (just to simplify writing). We define the *multiplicative energy* of $A$ to be $E(A) = \# \left\{ x, y, z, w \in A : xy \equiv zw \right\}$. Notice that
$$\sum\_{x \in A A} 1 = \lvert A A \rvert$$
$$\sum\_{x \in A A} r(x) = \lvert A \rvert^2$$
$$\sum\_{x \in A A} r(x)^2 = E(A)$$
and so by Cauchy-Schwarz, $\lvert A \rvert^4 \leq \lvert A A \rvert E(A)$.
As stated in the post, it is sufficient to show $\lvert A\_d \rvert \leq p^{3/7 + \varepsilon}$. Our strategy will be to bound $\lvert A\_d A\_d \rvert$ and $E(A)$. Notice that since every element of $A\_d$ is a $d$-th root of unity, so is every element of $A\_d A\_d$, and therefore $\lvert A\_d A\_d \rvert \leq d$. Also, every element of $A\_d$ is of the form $d x$, where $x < \frac{p}{d}$. This means that the multiplicative energy of $A\_d$ is at most
$$\# \left\{ x, y, z, w < \frac{p}{d} : xy \equiv zw \right\}$$
We split into cases according to the larger among $d$ and $\sqrt{p}$.
**Case 1: $d > \sqrt{p}$**. In this case, $xy \equiv zw$ is equivalent to $xy = zw$. Fixing $x, y$, the number of solutions is at most the number of divisors of $xy$, which is $\ll p^{\varepsilon}$, and so $E(A\_d) \ll \frac{p^{2 + \varepsilon}}{d^2}$. This means that
$$\lvert A\_d \rvert \ll \left( d \cdot \frac{p^{2 + \varepsilon}}{d^2} \right)^{1/4} \ll p^{3/8 + \varepsilon}$$
which is even stronger than what we require.
**Case 2: $d < \sqrt{p}$**. Now, $xy \equiv zw$ means that $xy + pk = zw$ for some $k \leq \frac{p}{d^2}$. Fixing $x, y, k$ we have as before $\ll p^{\varepsilon}$ solutions, and so the multiplicative energy is at most
$$\frac{p^{3 + \varepsilon}}{d^4}$$
which as before gives that
$$\lvert A\_d \rvert \ll \left( \frac{p}{d} \right)^{3/4 + \varepsilon}$$
This bound is relatively good for $d \approx \sqrt{p}$, however when $d$ is small this is quite bad. Luckily, we always have the trivial bound $\lvert A\_d \rvert \leq d$. Optimizing, we get that $\lvert A\_d \rvert \ll p^{3/7 + \varepsilon}$, as required. |
18,770,450 | I have a header on my website with a large image ( 1000px width ).
This image is centered (horizontally). If a user comes to this website with a browser window which is slimmer than 1000px in width, he can scroll horizontally. This is what I would like to prevent, since the outer parts of the image are not important and the rest of the page is as wide as the users browser window.
For instance:
A users browser window is 600px in width, what I would like to happen is:
The first 200px of the image are invisible, the next 600px are visible and the last 200px of the image are invisible again.
```
<html>
<body>
<div id="outer" style="width:100%;overflow-x:hidden;">
<div id="inner" style="display: table;margin: 0 auto;width:1300px">
<img src="image.jpg" alt="image" width="1300px">
</div>
</div>
</body>
</html>
``` | 2013/09/12 | [
"https://Stackoverflow.com/questions/18770450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1816644/"
] | You will need to use CSS for that.
```
div {
overflow-x: hidden;
}
``` | Should work by itself if you just set it as a background image, centered. You'll need to put it on a div that has 100% width applied to it, and a height specified in order to expand the div to see anything. |
18,770,450 | I have a header on my website with a large image ( 1000px width ).
This image is centered (horizontally). If a user comes to this website with a browser window which is slimmer than 1000px in width, he can scroll horizontally. This is what I would like to prevent, since the outer parts of the image are not important and the rest of the page is as wide as the users browser window.
For instance:
A users browser window is 600px in width, what I would like to happen is:
The first 200px of the image are invisible, the next 600px are visible and the last 200px of the image are invisible again.
```
<html>
<body>
<div id="outer" style="width:100%;overflow-x:hidden;">
<div id="inner" style="display: table;margin: 0 auto;width:1300px">
<img src="image.jpg" alt="image" width="1300px">
</div>
</div>
</body>
</html>
``` | 2013/09/12 | [
"https://Stackoverflow.com/questions/18770450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1816644/"
] | You will need to use CSS for that.
```
div {
overflow-x: hidden;
}
``` | Try `position: fixed;`
This fixes the position and doesn't allow any scrolling |
18,770,450 | I have a header on my website with a large image ( 1000px width ).
This image is centered (horizontally). If a user comes to this website with a browser window which is slimmer than 1000px in width, he can scroll horizontally. This is what I would like to prevent, since the outer parts of the image are not important and the rest of the page is as wide as the users browser window.
For instance:
A users browser window is 600px in width, what I would like to happen is:
The first 200px of the image are invisible, the next 600px are visible and the last 200px of the image are invisible again.
```
<html>
<body>
<div id="outer" style="width:100%;overflow-x:hidden;">
<div id="inner" style="display: table;margin: 0 auto;width:1300px">
<img src="image.jpg" alt="image" width="1300px">
</div>
</div>
</body>
</html>
``` | 2013/09/12 | [
"https://Stackoverflow.com/questions/18770450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1816644/"
] | You will need to use CSS for that.
```
div {
overflow-x: hidden;
}
``` | You can do this with background-size: cover
css
```
main-page { // making a container for demonstration purposes
display: block; // custom tags need a display, block forces 100% width
max-width: 1000px; // just matching your image width
margin: 0 auto; // centering if window is bigger than max-width
}
banner-image {
display: block; // custom tag needs a display
height: 80px; // set to the height of your image
background:
no-repeat
url('https://www.w3schools.com/cssref/mountain.jpg')
50% 50% / cover; // center then cover the element completely
}
```
HTML note: I'm using custom tags
```
<main-page>
<banner-image></banner-image>
</main-page>
``` |
18,770,450 | I have a header on my website with a large image ( 1000px width ).
This image is centered (horizontally). If a user comes to this website with a browser window which is slimmer than 1000px in width, he can scroll horizontally. This is what I would like to prevent, since the outer parts of the image are not important and the rest of the page is as wide as the users browser window.
For instance:
A users browser window is 600px in width, what I would like to happen is:
The first 200px of the image are invisible, the next 600px are visible and the last 200px of the image are invisible again.
```
<html>
<body>
<div id="outer" style="width:100%;overflow-x:hidden;">
<div id="inner" style="display: table;margin: 0 auto;width:1300px">
<img src="image.jpg" alt="image" width="1300px">
</div>
</div>
</body>
</html>
``` | 2013/09/12 | [
"https://Stackoverflow.com/questions/18770450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1816644/"
] | Try `position: fixed;`
This fixes the position and doesn't allow any scrolling | Should work by itself if you just set it as a background image, centered. You'll need to put it on a div that has 100% width applied to it, and a height specified in order to expand the div to see anything. |
18,770,450 | I have a header on my website with a large image ( 1000px width ).
This image is centered (horizontally). If a user comes to this website with a browser window which is slimmer than 1000px in width, he can scroll horizontally. This is what I would like to prevent, since the outer parts of the image are not important and the rest of the page is as wide as the users browser window.
For instance:
A users browser window is 600px in width, what I would like to happen is:
The first 200px of the image are invisible, the next 600px are visible and the last 200px of the image are invisible again.
```
<html>
<body>
<div id="outer" style="width:100%;overflow-x:hidden;">
<div id="inner" style="display: table;margin: 0 auto;width:1300px">
<img src="image.jpg" alt="image" width="1300px">
</div>
</div>
</body>
</html>
``` | 2013/09/12 | [
"https://Stackoverflow.com/questions/18770450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1816644/"
] | Should work by itself if you just set it as a background image, centered. You'll need to put it on a div that has 100% width applied to it, and a height specified in order to expand the div to see anything. | You can do this with background-size: cover
css
```
main-page { // making a container for demonstration purposes
display: block; // custom tags need a display, block forces 100% width
max-width: 1000px; // just matching your image width
margin: 0 auto; // centering if window is bigger than max-width
}
banner-image {
display: block; // custom tag needs a display
height: 80px; // set to the height of your image
background:
no-repeat
url('https://www.w3schools.com/cssref/mountain.jpg')
50% 50% / cover; // center then cover the element completely
}
```
HTML note: I'm using custom tags
```
<main-page>
<banner-image></banner-image>
</main-page>
``` |
18,770,450 | I have a header on my website with a large image ( 1000px width ).
This image is centered (horizontally). If a user comes to this website with a browser window which is slimmer than 1000px in width, he can scroll horizontally. This is what I would like to prevent, since the outer parts of the image are not important and the rest of the page is as wide as the users browser window.
For instance:
A users browser window is 600px in width, what I would like to happen is:
The first 200px of the image are invisible, the next 600px are visible and the last 200px of the image are invisible again.
```
<html>
<body>
<div id="outer" style="width:100%;overflow-x:hidden;">
<div id="inner" style="display: table;margin: 0 auto;width:1300px">
<img src="image.jpg" alt="image" width="1300px">
</div>
</div>
</body>
</html>
``` | 2013/09/12 | [
"https://Stackoverflow.com/questions/18770450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1816644/"
] | Try `position: fixed;`
This fixes the position and doesn't allow any scrolling | You can do this with background-size: cover
css
```
main-page { // making a container for demonstration purposes
display: block; // custom tags need a display, block forces 100% width
max-width: 1000px; // just matching your image width
margin: 0 auto; // centering if window is bigger than max-width
}
banner-image {
display: block; // custom tag needs a display
height: 80px; // set to the height of your image
background:
no-repeat
url('https://www.w3schools.com/cssref/mountain.jpg')
50% 50% / cover; // center then cover the element completely
}
```
HTML note: I'm using custom tags
```
<main-page>
<banner-image></banner-image>
</main-page>
``` |
6,513,207 | I'm trying to understand how the events in a BSD socket interface translate to the state of a TCP Connection. In particular, I'm trying to understand at what stage in the connection process `accept()` returns on the server side
1. client sends SYN
2. server sends SYN+ACK
3. client sends ACK
In which one of these steps does `accept()` return? | 2011/06/28 | [
"https://Stackoverflow.com/questions/6513207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/357024/"
] | `accept` returns when the connection is complete. The connection is complete **after the client sends his ACK**.
`accept` gives you a socket on which you can communicate. Of course you know, you can't communicate until the connection is established. And the connection can't be established before the handshake.
It wouldn't make sense to return before the client sens his ACK. It is entirely possible he won't say anything after the initial SYN. | The TCP/IP stack code in the kernel normally[1] completes the three-way handshake entirely without intervention from any user space code. The three steps you list all happen *before* `accept()` returns. Indeed, they may happen before `accept()` is even called!
When you tell the stack to `listen()` for connections on a particular TCP port, you pass a `backlog` parameter, which tells the kernel how many connections it can silently accept on behalf of your program at once. It is this queue that is being used when the kernel automatically accepts new connection requests, and there that they are held until your program gets around to `accept()`ing them. When there is one or more connections in the listen backlog queue when you call `accept()`, all that happens is that the oldest is removed from the queue and bound to a new socket.[2]
In other words, if your program calls `listen(sd, 5)`, then goes into an infinite do-nothing loop so that it never calls `accept()`, five concurrent client connection requests will succeed, from the clients' point of view. A sixth connection request will get stalled on the first SYN packet until either the program owning the TCP port calls `accept()` or one of the other clients drops its connection.
---
[1] Firewall and other stack modifications can change this behavior, of course. I am speaking here only of default BSD sockets stack behavior.
[2] If there are no connections waiting in the backlog when you call `accept()`, it blocks by default, unless the listener socket was set to non-blocking, in which case it returns -1 and `errno` is `EWOULDBLOCK`. |
65,709,060 | My employee's IT department refuses to install R for me (claiming the open source version is a security risk) and I tried to create reports with Microsoft Access 2010.
I got stuck trying to create a query on a simple table of hospital wards (for the purpose of keeping track of a data collection exercise):
[](https://i.stack.imgur.com/YQwKc.png)
I did not manage to allocate each ward a sample size that would be proportional to its bed capacity (third column above) as I was not able to refer to the sum of the elements in the "bedCapacity" column. With Excel, I would try something like this:
[](https://i.stack.imgur.com/z2uYU.png)
Cell D2 in Excel contains `=INT(C2/SUM(C$2:C$6)*50)+1` and cells D3 to D6 according formulae.
Is there any way I can refer to the sum in the `bedCapacity` column in Access 2010? I tried creating a separate query that would sum up the the 'bedCapacity` column, however could not figure out how to refer to the value in that query.
I'm trying to use Access 2010 so I can create standardised reports for the data collectors on their progress (which is not easily possible with Excel 2010, as it requires too much manual manipulation - I tried pivot tables etc.).
Would be grateful for any insights. | 2021/01/13 | [
"https://Stackoverflow.com/questions/65709060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11451936/"
] | **Amazon Simple Storage Service (S3)**
>
> It allows you to store an infinite amount of data that can be accessed
> programmatically via different methods like REST API, SOAP, web
> interface, and more. It is an ideal storage option for videos, images
> and application data.
>
>
>
Features:
* Fully managed
* Store in buckets
* Versioning
* Access control lists and bucket policies
* AES-256 bit encryption at rest
* Private by default
Best used for:
* Hosting entire static websites
* Static web content and media
* Store data for computation and large-scale analytics, like analyzing
financial transactions, clickstream analytics, and media transcoding
* Disaster recovery solutions for business continuity
* **Secure solution for backup & archival of sensitive data**
**Use encryption to protect your data:**
If your use case requires encryption during transmission, Amazon S3 supports the HTTPS protocol, which encrypts data in transit to and from Amazon S3. All AWS SDKs and AWS tools use HTTPS by default
**Restrict access to your S3 resources:**
By default, all S3 buckets are private and can be accessed only by users that are explicitly granted access. When using AWS, it's a best practice to restrict access to your resources to the people that absolutely need it, you can see in that [Doc](https://aws.amazon.com/premiumsupport/knowledge-center/secure-s3-resources/). | I would go with aws s3 for such a use case where I want to store this kind of information.
[Setting default server-side encryption behavior for Amazon S3 buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-encryption.html). Depending on the type of setup and amount of money I am willing to spend, I would choose to go with [Customer Managed Key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html) for encrypting the bucket.
Considering the I am going through all the security checks AWS recommends [How can I secure the files in my Amazon S3 bucket?](https://aws.amazon.com/premiumsupport/knowledge-center/secure-s3-resources/).
Enable replication, Versioning, Logging and maybe IP based access for all the good keeping.
S3 provides all kinds of bells and whistles for security in that case. |
55,521,985 | Im trying to display the results from the json response from the server on my page, but some variables are displaying as NaN?
This is my json response from the server:
```
{"data":[{"id":"2","attributes":{"title":"Customer 1","status":"cancelled","end-date":"2019-01-01"}}]}
```
My customer service:
```
getCustomers(): Observable<Customer[]> {
return this.http.get<Customer[]>(this.url);
}
```
My customer component:
```
getCustomers(): void {
this.customerService.getCustomers()
.subscribe(cs => {
this.customers = cs;
//console.log(this.customers);
});
}
```
My customer html:
```
<tr *ngFor="let customer of customers.data">
<td>{{ customer.id }}</td>
<td>{{ customer.attributes.title }}</td>
<td>{{ customer.attributes.status }}</td>
<td>{{ customer.attributes.end-date }}</td>
</tr>
```
This displays title and status but not end-date...? end-date returns NaN. Im guessing it is the "-" thats messing this up? How can I solve this? | 2019/04/04 | [
"https://Stackoverflow.com/questions/55521985",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10847474/"
] | Dashes are not allowed in Typescript/JavaScript identifiers, you will have to use array syntax to get the end date.
```
<td>{{ customer.attributes["end-date"] }}</td>
``` | You need handle the data first.
```
let date = new Date('2019-01-01');
``` |
47,675,065 | Well i am using laratrust to handle roles and permissions for my application.
I want to attach a role to a user when registering but after reading laratrust documentation i cant seem to figure out whats the issue!
Here is my code
```
public function register(Request $request) {
$this->validation($request);
User::create([
'name' => $request->name,
'lastname' => $request->lastname,
'email' => $request->email,
'password' => bcrypt($request->password)
]);
$user->attachRole($employer);
Auth::attempt([
'email' =>$request->email,
'password' => $request->password]);
// Authentication passed...
return redirect('/');
}
```
With the above i get error unknown query builder attacheRole!
Any suggestions? | 2017/12/06 | [
"https://Stackoverflow.com/questions/47675065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | you forget to define **$user** (see in my code example) but there would be also error with the **$employer** it isn't definied in the function...
```
$user = User::create([
'name' => $request->name,
'lastname' => $request->lastname,
'email' => $request->email,
'password' => bcrypt($request->password)
]);
$user->attachRole($employer);
```
[Laratrust Examples & doc](https://github.com/santigarcor/laratrust/blob/5.0/docs/usage/concepts.rst) | This works for me
```
User::create([
'name' => $request->name,
'lastname' => $request->lastname,
'email' => $request->email,
'password' => bcrypt($request->password)
])->attachRole('employer');
``` |
6,131,896 | Where I got stuck:
------------------
In my spare time I work on a private website. My self-teaching is *really* unstructured, and I've run up against a huge hole in my fundamentals.
I'm looking at a jQuery example from the jQuery API website, [serializeArray](http://api.jquery.com/serializeArray/), and I can't wrap my head around the ShowValues function.
Here's how it goes:
```
function showValues() {
var fields = $(":input").serializeArray();
$("#results").empty();
jQuery.each(fields, function(i, field){
$("#results").append(field.value + " ");
});
}
$(":checkbox, :radio").click(showValues);
$("select").change(showValues);
showValues();
```
And I'm pretty sure I get what's going on in everything except lines 4 and 5:
```
jQuery.each(fields, function(i, field){
$("#results").append(field.value + " ");
```
jQuery goes through each key in the *fields* array and puts what it finds through the generic function: *function(i,field)*
that function uses its two parameters to produce a string to append to #results.
**My questions**:
Why does that function need two parameters? The variable *i* seems to count up from zero, for each time the function is run. and if it's taken out of the function, field.value returns undefined.
Since the values coming in to the two-parameter function are arranged into an array, the function has to...match the dimensions of the array?
Is `i` special, or could any spare variable be used?
And what's happening with `field.value`? `.value` isn't in the jQuery API, but I think it's still plucking values from the second position in the fields array? | 2011/05/25 | [
"https://Stackoverflow.com/questions/6131896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/769780/"
] | The [`jQuery.each`](http://api.jquery.com/jQuery.each/) runs the function you provide (here, an anonymous function) against each key/value pair in an array or object. This works much like iteration in a functional language.
The parameter names are neither special nor even required. The function is called with the current value as `this`, so in many cases you can omit them. In your code, for example, the function could be changed to `function() { $("#results").append(this.value + " "); }` and it would produce the same results.
Inside the function, `field` is a [DOMElement](https://developer.mozilla.org/en/DOM/element) and `.value` is DOM 0 property for accessing an input's `value=` attribute. In your code, `field.value` is equivalent to `$(field).val()`. | I believe i is passed to the inner workings of Jquery for it to work out which value in the array to pass/use in the function. Without i Jquery cant tell where it is on the iteration. |
6,131,896 | Where I got stuck:
------------------
In my spare time I work on a private website. My self-teaching is *really* unstructured, and I've run up against a huge hole in my fundamentals.
I'm looking at a jQuery example from the jQuery API website, [serializeArray](http://api.jquery.com/serializeArray/), and I can't wrap my head around the ShowValues function.
Here's how it goes:
```
function showValues() {
var fields = $(":input").serializeArray();
$("#results").empty();
jQuery.each(fields, function(i, field){
$("#results").append(field.value + " ");
});
}
$(":checkbox, :radio").click(showValues);
$("select").change(showValues);
showValues();
```
And I'm pretty sure I get what's going on in everything except lines 4 and 5:
```
jQuery.each(fields, function(i, field){
$("#results").append(field.value + " ");
```
jQuery goes through each key in the *fields* array and puts what it finds through the generic function: *function(i,field)*
that function uses its two parameters to produce a string to append to #results.
**My questions**:
Why does that function need two parameters? The variable *i* seems to count up from zero, for each time the function is run. and if it's taken out of the function, field.value returns undefined.
Since the values coming in to the two-parameter function are arranged into an array, the function has to...match the dimensions of the array?
Is `i` special, or could any spare variable be used?
And what's happening with `field.value`? `.value` isn't in the jQuery API, but I think it's still plucking values from the second position in the fields array? | 2011/05/25 | [
"https://Stackoverflow.com/questions/6131896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/769780/"
] | **Why does the function need two parameters?**
First of all you should read the documentation of [.each](http://api.jquery.com/jQuery.each/). It tells you that it expects a function defined as such:
```
callback(indexInArray, valueOfElement)
```
That has been decided, so you have to abide to it (the reasoning is beyond this answer).
If you define your callback as such
```
function(indexInArray, valueOfElement, foo) { ... }
```
and it is called as
```
callback(indexInArray, valueOfElement)
```
then `foo` will be undefined.
If you define your callback as
```
function(foo) { ... }
```
it will still be called as
```
callback(indexInArray, valueOfElement)
```
and `foo` will contain the `indexInArray` - and `0.value` will of course be undefined if you "leave out the `i`".
**Can I use a spare variable?**
Yes you can. In most functional languages you will find `_` used for parameter that you don't care about (be careful if you use libraries like `underscore.js` though). Any other name can be used.
```
$(...).each(function(_, elem) {
...
});
``` | I believe i is passed to the inner workings of Jquery for it to work out which value in the array to pass/use in the function. Without i Jquery cant tell where it is on the iteration. |
6,131,896 | Where I got stuck:
------------------
In my spare time I work on a private website. My self-teaching is *really* unstructured, and I've run up against a huge hole in my fundamentals.
I'm looking at a jQuery example from the jQuery API website, [serializeArray](http://api.jquery.com/serializeArray/), and I can't wrap my head around the ShowValues function.
Here's how it goes:
```
function showValues() {
var fields = $(":input").serializeArray();
$("#results").empty();
jQuery.each(fields, function(i, field){
$("#results").append(field.value + " ");
});
}
$(":checkbox, :radio").click(showValues);
$("select").change(showValues);
showValues();
```
And I'm pretty sure I get what's going on in everything except lines 4 and 5:
```
jQuery.each(fields, function(i, field){
$("#results").append(field.value + " ");
```
jQuery goes through each key in the *fields* array and puts what it finds through the generic function: *function(i,field)*
that function uses its two parameters to produce a string to append to #results.
**My questions**:
Why does that function need two parameters? The variable *i* seems to count up from zero, for each time the function is run. and if it's taken out of the function, field.value returns undefined.
Since the values coming in to the two-parameter function are arranged into an array, the function has to...match the dimensions of the array?
Is `i` special, or could any spare variable be used?
And what's happening with `field.value`? `.value` isn't in the jQuery API, but I think it's still plucking values from the second position in the fields array? | 2011/05/25 | [
"https://Stackoverflow.com/questions/6131896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/769780/"
] | **Why does the function need two parameters?**
First of all you should read the documentation of [.each](http://api.jquery.com/jQuery.each/). It tells you that it expects a function defined as such:
```
callback(indexInArray, valueOfElement)
```
That has been decided, so you have to abide to it (the reasoning is beyond this answer).
If you define your callback as such
```
function(indexInArray, valueOfElement, foo) { ... }
```
and it is called as
```
callback(indexInArray, valueOfElement)
```
then `foo` will be undefined.
If you define your callback as
```
function(foo) { ... }
```
it will still be called as
```
callback(indexInArray, valueOfElement)
```
and `foo` will contain the `indexInArray` - and `0.value` will of course be undefined if you "leave out the `i`".
**Can I use a spare variable?**
Yes you can. In most functional languages you will find `_` used for parameter that you don't care about (be careful if you use libraries like `underscore.js` though). Any other name can be used.
```
$(...).each(function(_, elem) {
...
});
``` | The [`jQuery.each`](http://api.jquery.com/jQuery.each/) runs the function you provide (here, an anonymous function) against each key/value pair in an array or object. This works much like iteration in a functional language.
The parameter names are neither special nor even required. The function is called with the current value as `this`, so in many cases you can omit them. In your code, for example, the function could be changed to `function() { $("#results").append(this.value + " "); }` and it would produce the same results.
Inside the function, `field` is a [DOMElement](https://developer.mozilla.org/en/DOM/element) and `.value` is DOM 0 property for accessing an input's `value=` attribute. In your code, `field.value` is equivalent to `$(field).val()`. |
366,496 | I've seen that both 'hoi polloi' and 'the hoi polloi' can be used. Does anyone know which is more accepted or correct? Or are they the same? | 2017/01/03 | [
"https://english.stackexchange.com/questions/366496",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/170840/"
] | In its definition of *[hoi polloi](http://unabridged.merriam-webster.com/unabridged/hoi%20polloi)*, M-W Unabridged notes:
>
> Since *hoi polloi* is a transliteration of the Greek for “the many,”
> some critics have asserted that the phrase should not be preceded by
> the. They find “the hoi polloi” to be redundant, equivalent to “the
> the many”—an opinion that fails to recognize that *hoi* means nothing
> at all in English. Nonetheless, the opinion has influenced the
> omission of *the* in the usage of some writers.
>
>
> But most writers use *the*, which is normal English grammar.
>
>
>
In its example usage sentences, M-W Unabridged gives examples of both usages:
>
> "strain so hard in making their questions comprehensible to *hoi
> polloi*" — S. L. Payne
>
>
> "burlesque performance … for the *hoi polloi*" — Henry Miller
>
>
> | From [this](http://www.phrases.org.uk/meanings/183475.html) article it seems like an article (the) is necessary because it translates directly to 'the many' |
366,496 | I've seen that both 'hoi polloi' and 'the hoi polloi' can be used. Does anyone know which is more accepted or correct? Or are they the same? | 2017/01/03 | [
"https://english.stackexchange.com/questions/366496",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/170840/"
] | In its definition of *[hoi polloi](http://unabridged.merriam-webster.com/unabridged/hoi%20polloi)*, M-W Unabridged notes:
>
> Since *hoi polloi* is a transliteration of the Greek for “the many,”
> some critics have asserted that the phrase should not be preceded by
> the. They find “the hoi polloi” to be redundant, equivalent to “the
> the many”—an opinion that fails to recognize that *hoi* means nothing
> at all in English. Nonetheless, the opinion has influenced the
> omission of *the* in the usage of some writers.
>
>
> But most writers use *the*, which is normal English grammar.
>
>
>
In its example usage sentences, M-W Unabridged gives examples of both usages:
>
> "strain so hard in making their questions comprehensible to *hoi
> polloi*" — S. L. Payne
>
>
> "burlesque performance … for the *hoi polloi*" — Henry Miller
>
>
> | I have been lectured by Brits that "the" should never be used, so English vs. American usage may be the crux of this question. |
230,299 | I've been looking for and thinking of a solution to the following but I cant come up with it, and hope someone can help me.
I have the following table:
```
ClientId RecordDateTime
-------- -------------------
1 2019-02-14 14:05:49
1 2019-02-14 14:06:34
1 2019-02-14 14:07:19
1 2019-02-14 14:08:49
1 2019-02-14 14:09:34
1 2019-02-14 14:10:32
1 2019-02-14 14:12:32
1 2019-02-14 14:14:18
1 2019-02-14 14:15:10
```
I need to count the amount of occurrences using a determined amount of minutes to split the occurrences. For example:
* I set the limit to 1 minutes
* First datetime is 14:05:49
* Second datetime is 14:06:34, which has less than 1 minute difference with the previous one (14:05:49), so I consider it belongs to the same occurrence.
* Third datetime is 14:07:19, which also has less than 1 minute difference with the previous one (14:06:34), so is still same occurrence
* Now it comes 14:08:49, which has a difference with the previous one of MORE than 1 minute, so I consider its a new occurence.
* Next 14:09:34, which has a difference of less than 1 minute with 14:08:49.
And so it goes.
At the end, the result I want is:
```
ClientId Occurrence Start Occurrence End
-------- ------------------- -------------------
1 2019-02-14 14:05:49 2019-02-14 14:07:19
1 2019-02-14 14:08:49 2019-02-14 14:10:32
1 2019-02-14 14:12:32 2019-02-14 14:12:32
1 2019-02-14 14:14:18 2019-02-14 14:15:10
```
This is just an example, but I have a lot of data, from multiple `ClientIds`.
Is there way of doing this without using stored procedures and looping through each row?
Thanks in advance for any help | 2019/02/20 | [
"https://dba.stackexchange.com/questions/230299",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/172985/"
] | You need to do some grouping for it
```
CREATE TABLE Table1
([ClientId] int, [RecordDateTime] datetime)
;
INSERT INTO Table1
([ClientId], [RecordDateTime])
VALUES
(1, '2019-02-14 14:05:49'),
(1, '2019-02-14 14:06:34'),
(1, '2019-02-14 14:07:19'),
(1, '2019-02-14 14:08:49'),
(1, '2019-02-14 14:09:34'),
(1, '2019-02-14 14:10:32'),
(1, '2019-02-14 14:12:32'),
(1, '2019-02-14 14:14:18'),
(1, '2019-02-14 14:15:10')
;
select
ClientID
,min(RecordDateTime) as [Occurrence Start]
,max(RecordDateTime) as [Occurrence End]
from
(
select
ClientID
,RecordDateTime
,sum(grp) over(PARTITION BY ClientID ORDER BY RecordDateTime) as sgrp
from
(
select
ClientID
,RecordDateTime
,isnull(prevRecordDT,RecordDateTime) as prevRecordDT
,case when datediff(second,prevRecordDT,RecordDateTime) <=60 then 0 else 1 end as grp
from
(
select
ClientID, RecordDateTime,
LAG(RecordDateTime,1,NULL)OVER(PARTITION BY ClientID ORDER BY RecordDateTime) as prevRecordDT
from Table1
) as s
) as g
) as a
group by ClientID,sgrp
```
output of it:
```
ClientID Occurrence Start Occurrence End
1 14/02/2019 14:05:49 14/02/2019 14:07:19
1 14/02/2019 14:08:49 14/02/2019 14:10:32
1 14/02/2019 14:12:32 14/02/2019 14:12:32
1 14/02/2019 14:14:18 14/02/2019 14:15:10
```
[dbfiddle](https://dbfiddle.uk/?rdbms=sqlserver_2017&fiddle=2ccca3dc3e3767e06c92a1bd0aa2237f)
[source of inspiration](https://sqlperformance.com/2018/09/t-sql-queries/special-islands)
A short description:
```
select
ClientID, RecordDateTime,
LAG(RecordDateTime,1,NULL)OVER(PARTITION BY ClientID ORDER BY RecordDateTime) as prevRecordDT
from Table1
```
key point here is the LAG function , to get the previous value
```
ClientID RecordDateTime prevRecordDT
1 14/02/2019 14:05:49
1 14/02/2019 14:06:34 14/02/2019 14:05:49
1 14/02/2019 14:07:19 14/02/2019 14:06:34
```
Then, do a difference, in seconds , to test if it's in interval:
**,case when datediff(second,prevRecordDT,RecordDateTime) <= 60 then 0 else 1 end as grp**
```
select
ClientID
,RecordDateTime
,isnull(prevRecordDT,RecordDateTime) as prevRecordDT
,case when datediff(second,prevRecordDT,RecordDateTime) <= 60 then 0 else 1 end as grp
from
(
select
ClientID, RecordDateTime,
LAG(RecordDateTime,1,NULL)OVER(PARTITION BY ClientID ORDER BY RecordDateTime) as prevRecordDT
from Table1
) as s
ClientID RecordDateTime prevRecordDT grp
1 14/02/2019 14:05:49 14/02/2019 14:05:49 1
1 14/02/2019 14:06:34 14/02/2019 14:05:49 0
1 14/02/2019 14:07:19 14/02/2019 14:06:34 0
1 14/02/2019 14:08:49 14/02/2019 14:07:19 1
```
After this, just do a sum base on `grp` column
**,sum(grp) over(PARTITION BY ClientID ORDER BY RecordDateTime) as sgrp**
```
select
ClientID
,RecordDateTime
,sum(grp) over(PARTITION BY ClientID ORDER BY RecordDateTime) as sgrp
from
(
select
ClientID
,RecordDateTime
,isnull(prevRecordDT,RecordDateTime) as prevRecordDT
,case when datediff(second,prevRecordDT,RecordDateTime) <= 60 then 0 else 1 end as grp
from
(
select
ClientID, RecordDateTime,
LAG(RecordDateTime,1,NULL)OVER(PARTITION BY ClientID ORDER BY RecordDateTime) as prevRecordDT
from Table1
) as s
) as g
ClientID RecordDateTime sgrp
1 14/02/2019 14:05:49 1
1 14/02/2019 14:06:34 1
1 14/02/2019 14:07:19 1
1 14/02/2019 14:08:49 2
1 14/02/2019 14:09:34 2
```
And finally, do `min` and `max` grouping by ClientID and sgrp | For small and medium resultset , Recursive CTE is not bad and it is very simple.
In case my script is not working for any other sample data that means that Test case is not covered and please provide that sample data with output.
```
create table #temp(ClientId int,RecordDateTime Datetime)
insert into #temp values
(1,'2019-02-14 14:05:49')
,(1,'2019-02-14 14:06:34')
,(1,'2019-02-14 14:07:19')
,(1,'2019-02-14 14:08:49')
,(1,'2019-02-14 14:09:34')
,(1,'2019-02-14 14:10:32')
,(1,'2019-02-14 14:12:32')
,(1,'2019-02-14 14:14:18')
,(1,'2019-02-14 14:15:10')
DECLARE @LimitSec int=60
;
WITH CTE1
AS (
SELECT *
,ROW_NUMBER() OVER (
PARTITION BY ClientId ORDER BY RecordDateTime
) rn
FROM #temp
)
,Cte2
AS (
SELECT clientid
,RecordDateTime
,rn AS grp
,rn
FROM cte1
WHERE rn = 1
UNION ALL
SELECT c.clientid
,c.RecordDateTime
,CASE
WHEN datediff(SECOND, c1.RecordDateTime, c.RecordDateTime) <= @LimitSec
THEN c1.grp
ELSE c1.grp + 1
END
,c.rn
FROM cte1 c
INNER JOIN cte2 c1 ON c.clientid = c1.clientid
AND c.rn = c1.rn + 1
)
SELECT clientid
,min(RecordDateTime) AS [Occurence Start]
,max(RecordDateTime) AS [Occurence End]
FROM cte2
GROUP BY clientid
,grp
DROP TABLE #temp
``` |
57,649,122 | I want to wait till the execution of one loop is completed in below code.Dont intended to process next item in list until one is done. How to ensure that execution inside foreach loop is completed once at a time or one loop at a time in the below scenario
Please note, this is a sample code only to demonstrate the issue, I know that if I remove the Task.Run from for each loop, it may work, but I need to have that task.Run in the foreach loop for some reason in my code.
```
List<int> Items = new List<int>();
Items.Add(1);
Items.Add(2);
Items.Add(3);
foreach(var itm in Items)
{
Task.Run(() =>
{
MyFunction(itm);
});
// I want to wait here till one execution is complete, e.g till execution of Item with Value 1 is completed,
//I dont' intend to execute next item value of 2 until processing with value 1 is completed.
}
private void MyFunction(int value)
{
Task.Factory.StartNew(() =>
{
MyFunction2(value);
});
}
private void MyFunction2 (int number)
{
// do some ops
// update UI
}
``` | 2019/08/25 | [
"https://Stackoverflow.com/questions/57649122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8143566/"
] | Use async await. `await` allows you to wait for a `Task` to finish without blocking the thread (thus your application won't freeze)
```cs
foreach(var itm in Items)
{
await MyFunction(itm);
}
// you must return Task to await it. void won't work
private Task MyFunction(int value)
{
// Task.Run is preferred over Task.Factory.StartNew,
// although it won't make any difference
return Task.Run(() => MyFunction2(value));
}
```
Also don't forget to make the method containing the foreach loop `async Task`. You can await Tasks only in `async` methods. Return type should be `Task`, so you can later await it and possibly catch exceptions. Avoid `async void`, unless the method is an event handler.
```cs
public async Task Foo()
{
foreach(var itm in Items)
{
await MyFunction(itm);
}
}
``` | Task.Run returns a Task object that represents that work. You need to call Wait on that.
```
var myTask = Task.Run(() =>
{
MyFunction(itm);
});
myTask.Wait();
``` |
18,076,879 | RTFM is the most natural reply but I have tried that and it did not work.
This is what I have done so far:
1. Install all the necessary USB drivers from the vendor's site. The USB device is properly installed.
2. Add `android:debuggable="true"` to my manifest
3. Tried `adb devices` in command prompt and it shows the device as connected
4. Enabled USB debugging via `Developer Settings`
Still, my phone is **not detected in Eclipse**
What is going wrong ?
I am using Windows 7 32 bit and trying to connect a Samsung Galaxy S3 (GT-I9300) with the latest firmware :) | 2013/08/06 | [
"https://Stackoverflow.com/questions/18076879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894684/"
] | I have same issue with my Galaxy S3 (GT-I9300). I solved this issue after "Factory Data Reset". Now when i connect my phone with USB ,Eclipse shows my device perfectly.
Hope its helpful to you... | Download Samsung Kies mini And Than Try To Connect Your Device. |
18,076,879 | RTFM is the most natural reply but I have tried that and it did not work.
This is what I have done so far:
1. Install all the necessary USB drivers from the vendor's site. The USB device is properly installed.
2. Add `android:debuggable="true"` to my manifest
3. Tried `adb devices` in command prompt and it shows the device as connected
4. Enabled USB debugging via `Developer Settings`
Still, my phone is **not detected in Eclipse**
What is going wrong ?
I am using Windows 7 32 bit and trying to connect a Samsung Galaxy S3 (GT-I9300) with the latest firmware :) | 2013/08/06 | [
"https://Stackoverflow.com/questions/18076879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894684/"
] | I have same issue with my Galaxy S3 (GT-I9300). I solved this issue after "Factory Data Reset". Now when i connect my phone with USB ,Eclipse shows my device perfectly.
Hope its helpful to you... | I think this is due to the driver problem. Just install the drivers properly and try reconnecting it.
 this is a driver for S5830 similarly you should install drivers for your device |
18,076,879 | RTFM is the most natural reply but I have tried that and it did not work.
This is what I have done so far:
1. Install all the necessary USB drivers from the vendor's site. The USB device is properly installed.
2. Add `android:debuggable="true"` to my manifest
3. Tried `adb devices` in command prompt and it shows the device as connected
4. Enabled USB debugging via `Developer Settings`
Still, my phone is **not detected in Eclipse**
What is going wrong ?
I am using Windows 7 32 bit and trying to connect a Samsung Galaxy S3 (GT-I9300) with the latest firmware :) | 2013/08/06 | [
"https://Stackoverflow.com/questions/18076879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894684/"
] | You could try Run-> Run Configurations-> Target in eclipse and change it to always prompt to pick device. This worked for me in the past. | Install the software Moborobo
and then
Try Run-> Run Configurations-> Target in eclipse and change it to always prompt to pick device. |
18,076,879 | RTFM is the most natural reply but I have tried that and it did not work.
This is what I have done so far:
1. Install all the necessary USB drivers from the vendor's site. The USB device is properly installed.
2. Add `android:debuggable="true"` to my manifest
3. Tried `adb devices` in command prompt and it shows the device as connected
4. Enabled USB debugging via `Developer Settings`
Still, my phone is **not detected in Eclipse**
What is going wrong ?
I am using Windows 7 32 bit and trying to connect a Samsung Galaxy S3 (GT-I9300) with the latest firmware :) | 2013/08/06 | [
"https://Stackoverflow.com/questions/18076879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894684/"
] | I think this is due to the driver problem. Just install the drivers properly and try reconnecting it.
 this is a driver for S5830 similarly you should install drivers for your device | Install the software Moborobo
and then
Try Run-> Run Configurations-> Target in eclipse and change it to always prompt to pick device. |
18,076,879 | RTFM is the most natural reply but I have tried that and it did not work.
This is what I have done so far:
1. Install all the necessary USB drivers from the vendor's site. The USB device is properly installed.
2. Add `android:debuggable="true"` to my manifest
3. Tried `adb devices` in command prompt and it shows the device as connected
4. Enabled USB debugging via `Developer Settings`
Still, my phone is **not detected in Eclipse**
What is going wrong ?
I am using Windows 7 32 bit and trying to connect a Samsung Galaxy S3 (GT-I9300) with the latest firmware :) | 2013/08/06 | [
"https://Stackoverflow.com/questions/18076879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894684/"
] | My friend had similar problem, solution was restarting adb server. Try running:
```
adb kill-server
adb start-server
```
from command line. | You could try Run-> Run Configurations-> Target in eclipse and change it to always prompt to pick device. This worked for me in the past. |
18,076,879 | RTFM is the most natural reply but I have tried that and it did not work.
This is what I have done so far:
1. Install all the necessary USB drivers from the vendor's site. The USB device is properly installed.
2. Add `android:debuggable="true"` to my manifest
3. Tried `adb devices` in command prompt and it shows the device as connected
4. Enabled USB debugging via `Developer Settings`
Still, my phone is **not detected in Eclipse**
What is going wrong ?
I am using Windows 7 32 bit and trying to connect a Samsung Galaxy S3 (GT-I9300) with the latest firmware :) | 2013/08/06 | [
"https://Stackoverflow.com/questions/18076879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894684/"
] | I have same issue with my Galaxy S3 (GT-I9300). I solved this issue after "Factory Data Reset". Now when i connect my phone with USB ,Eclipse shows my device perfectly.
Hope its helpful to you... | Install the software Moborobo
and then
Try Run-> Run Configurations-> Target in eclipse and change it to always prompt to pick device. |
18,076,879 | RTFM is the most natural reply but I have tried that and it did not work.
This is what I have done so far:
1. Install all the necessary USB drivers from the vendor's site. The USB device is properly installed.
2. Add `android:debuggable="true"` to my manifest
3. Tried `adb devices` in command prompt and it shows the device as connected
4. Enabled USB debugging via `Developer Settings`
Still, my phone is **not detected in Eclipse**
What is going wrong ?
I am using Windows 7 32 bit and trying to connect a Samsung Galaxy S3 (GT-I9300) with the latest firmware :) | 2013/08/06 | [
"https://Stackoverflow.com/questions/18076879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894684/"
] | My friend had similar problem, solution was restarting adb server. Try running:
```
adb kill-server
adb start-server
```
from command line. | Install the software Moborobo
and then
Try Run-> Run Configurations-> Target in eclipse and change it to always prompt to pick device. |
18,076,879 | RTFM is the most natural reply but I have tried that and it did not work.
This is what I have done so far:
1. Install all the necessary USB drivers from the vendor's site. The USB device is properly installed.
2. Add `android:debuggable="true"` to my manifest
3. Tried `adb devices` in command prompt and it shows the device as connected
4. Enabled USB debugging via `Developer Settings`
Still, my phone is **not detected in Eclipse**
What is going wrong ?
I am using Windows 7 32 bit and trying to connect a Samsung Galaxy S3 (GT-I9300) with the latest firmware :) | 2013/08/06 | [
"https://Stackoverflow.com/questions/18076879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894684/"
] | My friend had similar problem, solution was restarting adb server. Try running:
```
adb kill-server
adb start-server
```
from command line. | Download Samsung Kies mini And Than Try To Connect Your Device. |
18,076,879 | RTFM is the most natural reply but I have tried that and it did not work.
This is what I have done so far:
1. Install all the necessary USB drivers from the vendor's site. The USB device is properly installed.
2. Add `android:debuggable="true"` to my manifest
3. Tried `adb devices` in command prompt and it shows the device as connected
4. Enabled USB debugging via `Developer Settings`
Still, my phone is **not detected in Eclipse**
What is going wrong ?
I am using Windows 7 32 bit and trying to connect a Samsung Galaxy S3 (GT-I9300) with the latest firmware :) | 2013/08/06 | [
"https://Stackoverflow.com/questions/18076879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894684/"
] | My friend had similar problem, solution was restarting adb server. Try running:
```
adb kill-server
adb start-server
```
from command line. | I think this is due to the driver problem. Just install the drivers properly and try reconnecting it.
 this is a driver for S5830 similarly you should install drivers for your device |
18,076,879 | RTFM is the most natural reply but I have tried that and it did not work.
This is what I have done so far:
1. Install all the necessary USB drivers from the vendor's site. The USB device is properly installed.
2. Add `android:debuggable="true"` to my manifest
3. Tried `adb devices` in command prompt and it shows the device as connected
4. Enabled USB debugging via `Developer Settings`
Still, my phone is **not detected in Eclipse**
What is going wrong ?
I am using Windows 7 32 bit and trying to connect a Samsung Galaxy S3 (GT-I9300) with the latest firmware :) | 2013/08/06 | [
"https://Stackoverflow.com/questions/18076879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894684/"
] | I have same issue with my Galaxy S3 (GT-I9300). I solved this issue after "Factory Data Reset". Now when i connect my phone with USB ,Eclipse shows my device perfectly.
Hope its helpful to you... | You could try Run-> Run Configurations-> Target in eclipse and change it to always prompt to pick device. This worked for me in the past. |
51,117,498 | I am completely new to programming. However, I just wanna write a simple bit of code on Python, that allows me to input any data and the type of the data is relayed or 'printed' back at me.
The current script I have is:
```
x = input()
print(x)
print(type(x))
```
However, regardless of i input a string, integer or float it will always print string? Any suggestions? | 2018/06/30 | [
"https://Stackoverflow.com/questions/51117498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10015517/"
] | In Python `input` always returns a `string`.
If you want to consider it as an `int` you have to convert it.
```
num = int(input('Choose a number: '))
print(num, type(num))
```
If you aren't sure of the type you can do:
```
num = input('Choose a number: ')
try:
num = int(num)
except:
pass
print(num, type(num))
``` | 1111 or 1.10 are valid strings
------------------------------
If the user presses the "1" key four times and then Enter, there's no magic way to tell if they wanted to enter the number 1111 or the string "1111". The input function gives your program the arbitrary textual data entered by user as a string, and it's up to you to interpret it however you wish.
If you want different treatment for data in particular format (e.g. if they enter "1111" do something with it as a number 1111, and if they enter "111x" show a message "please enter a valid number") then your program needs to implement that logic. |
6,365,448 | As per the title, it seems only Chrome isn't playign along. Note that form fields cannot be clicked on which are on the left portion of the screen. This only occurs on some pages (such as the Contact page). It appears that the #left\_outer div is overlaying the content. When I edit the css via Firebug or Chrome's dev toools, it works, when I edit the actual css and refresh, it does not.
Any ideas?
**LINK:**
Thanks! | 2011/06/15 | [
"https://Stackoverflow.com/questions/6365448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262374/"
] | Usually when you have set the `z-index` property, but things aren't working as you might expect, it is related to the `position` attribute.
In order for `z-index` to work properly, the element needs to be "positioned". This means that it must have the `position` attribute set to one of `absolute`, `relative`, or `fixed`.
Note that your element will also be positioned relative to the first ancestor that is positioned if you use `position: absolute` and `top`, `left`, `right`, `bottom`, etc. | Without a link to look at, it's a bit tough to see what the problem might be.
Do you have a `z-index: -1;` anywhere (a negative number is the key here, doesn't matter the number)?
I have found in the past this renders the container void from being interacted with.
Good luck! |
6,365,448 | As per the title, it seems only Chrome isn't playign along. Note that form fields cannot be clicked on which are on the left portion of the screen. This only occurs on some pages (such as the Contact page). It appears that the #left\_outer div is overlaying the content. When I edit the css via Firebug or Chrome's dev toools, it works, when I edit the actual css and refresh, it does not.
Any ideas?
**LINK:**
Thanks! | 2011/06/15 | [
"https://Stackoverflow.com/questions/6365448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262374/"
] | Usually when you have set the `z-index` property, but things aren't working as you might expect, it is related to the `position` attribute.
In order for `z-index` to work properly, the element needs to be "positioned". This means that it must have the `position` attribute set to one of `absolute`, `relative`, or `fixed`.
Note that your element will also be positioned relative to the first ancestor that is positioned if you use `position: absolute` and `top`, `left`, `right`, `bottom`, etc. | Google Chrome to 84.0.4147.135 (Official Build) (64-bit) 2020-02-22.
Since my last update, CSS element z-index is broken in Chrome.
Chrome added "z-index: 1;" to the BODY element.
It now wrongly displays all z-index: ?; values in the BODY child elements.
Setting the position, z-index of BODY does not solve the problem.
Changing z-index values of child elements that were already correct does not help.
I hope this issue will be fixed, it is only broken since I updated Chrome.
Chrome 84.0.4147.135 bug on [www.eatme.pro/music](http://www.eatme.pro/music) - screen smaller than 500 px - push play - appearing bottom bar #lblBottomBarLink with z-index 5 is displayed under menu with z-index 2
(see image)
[image eatme.pro/music in Chrome 84.0.4147.135 with z-index 5 under z-index 2](https://i.stack.imgur.com/HIAD8.jpg) |
6,365,448 | As per the title, it seems only Chrome isn't playign along. Note that form fields cannot be clicked on which are on the left portion of the screen. This only occurs on some pages (such as the Contact page). It appears that the #left\_outer div is overlaying the content. When I edit the css via Firebug or Chrome's dev toools, it works, when I edit the actual css and refresh, it does not.
Any ideas?
**LINK:**
Thanks! | 2011/06/15 | [
"https://Stackoverflow.com/questions/6365448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262374/"
] | Usually when you have set the `z-index` property, but things aren't working as you might expect, it is related to the `position` attribute.
In order for `z-index` to work properly, the element needs to be "positioned". This means that it must have the `position` attribute set to one of `absolute`, `relative`, or `fixed`.
Note that your element will also be positioned relative to the first ancestor that is positioned if you use `position: absolute` and `top`, `left`, `right`, `bottom`, etc. | Markt's answer (see first answer) is great and this is the "by definition" of the z-index property.
Chrome's specific issue are usually related to the overflow property from the top container bottom.
So, for the following:
```
<div class="first-container">...</div>
<div class="second-container">
<div ...>
<div class="fixed-div> some text</div>
<... /div>
</div>
```
And styles:
```
.first-container {
position:relative;
z-index: 100;
width: 100%;
height: 10%;
}
.second-container {
position:relative;
z-index: 1000;
width: 100%;
height: 90%;
overflow: auto;
}
.fixed-div {
position: fixed;
z-index: 10000;
height: 110%;
}
```
**the following actually happens (Chrome only, firefox works as expected)**
The 'fixed-div' **is behind** the 'first-container', even though both 'fixed-div' and its container's ('second-container') z-index value is greater than 'first-container'.
The reason for this is Chrome always enforce boundaries within a container that enforces overflow **even though** one of its successors might have a **fixed** position.
I guess you can find a twisted logic for that... I can't - since the only reason for using fixed position is to enable 'on-top-of-everything' behavior.
So bug it is... |
6,365,448 | As per the title, it seems only Chrome isn't playign along. Note that form fields cannot be clicked on which are on the left portion of the screen. This only occurs on some pages (such as the Contact page). It appears that the #left\_outer div is overlaying the content. When I edit the css via Firebug or Chrome's dev toools, it works, when I edit the actual css and refresh, it does not.
Any ideas?
**LINK:**
Thanks! | 2011/06/15 | [
"https://Stackoverflow.com/questions/6365448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262374/"
] | Markt's answer (see first answer) is great and this is the "by definition" of the z-index property.
Chrome's specific issue are usually related to the overflow property from the top container bottom.
So, for the following:
```
<div class="first-container">...</div>
<div class="second-container">
<div ...>
<div class="fixed-div> some text</div>
<... /div>
</div>
```
And styles:
```
.first-container {
position:relative;
z-index: 100;
width: 100%;
height: 10%;
}
.second-container {
position:relative;
z-index: 1000;
width: 100%;
height: 90%;
overflow: auto;
}
.fixed-div {
position: fixed;
z-index: 10000;
height: 110%;
}
```
**the following actually happens (Chrome only, firefox works as expected)**
The 'fixed-div' **is behind** the 'first-container', even though both 'fixed-div' and its container's ('second-container') z-index value is greater than 'first-container'.
The reason for this is Chrome always enforce boundaries within a container that enforces overflow **even though** one of its successors might have a **fixed** position.
I guess you can find a twisted logic for that... I can't - since the only reason for using fixed position is to enable 'on-top-of-everything' behavior.
So bug it is... | Google Chrome to 84.0.4147.135 (Official Build) (64-bit) 2020-02-22.
Since my last update, CSS element z-index is broken in Chrome.
Chrome added "z-index: 1;" to the BODY element.
It now wrongly displays all z-index: ?; values in the BODY child elements.
Setting the position, z-index of BODY does not solve the problem.
Changing z-index values of child elements that were already correct does not help.
I hope this issue will be fixed, it is only broken since I updated Chrome.
Chrome 84.0.4147.135 bug on [www.eatme.pro/music](http://www.eatme.pro/music) - screen smaller than 500 px - push play - appearing bottom bar #lblBottomBarLink with z-index 5 is displayed under menu with z-index 2
(see image)
[image eatme.pro/music in Chrome 84.0.4147.135 with z-index 5 under z-index 2](https://i.stack.imgur.com/HIAD8.jpg) |
6,365,448 | As per the title, it seems only Chrome isn't playign along. Note that form fields cannot be clicked on which are on the left portion of the screen. This only occurs on some pages (such as the Contact page). It appears that the #left\_outer div is overlaying the content. When I edit the css via Firebug or Chrome's dev toools, it works, when I edit the actual css and refresh, it does not.
Any ideas?
**LINK:**
Thanks! | 2011/06/15 | [
"https://Stackoverflow.com/questions/6365448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262374/"
] | Usually when you have set the `z-index` property, but things aren't working as you might expect, it is related to the `position` attribute.
In order for `z-index` to work properly, the element needs to be "positioned". This means that it must have the `position` attribute set to one of `absolute`, `relative`, or `fixed`.
Note that your element will also be positioned relative to the first ancestor that is positioned if you use `position: absolute` and `top`, `left`, `right`, `bottom`, etc. | I know this is now resolved but posted solution didn't work for me. Here is what resolved my problem:
```
<act:AutoCompleteExtender ID="ace" runat="server" OnClientShown="clientShown">
</act:AutoCompleteExtender>
<script language="javascript" type="text/javascript">
function clientShown(ctl, args) {
ctl._completionListElement.style.zIndex = 99999;
}
</script>
``` |
6,365,448 | As per the title, it seems only Chrome isn't playign along. Note that form fields cannot be clicked on which are on the left portion of the screen. This only occurs on some pages (such as the Contact page). It appears that the #left\_outer div is overlaying the content. When I edit the css via Firebug or Chrome's dev toools, it works, when I edit the actual css and refresh, it does not.
Any ideas?
**LINK:**
Thanks! | 2011/06/15 | [
"https://Stackoverflow.com/questions/6365448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262374/"
] | Markt's answer (see first answer) is great and this is the "by definition" of the z-index property.
Chrome's specific issue are usually related to the overflow property from the top container bottom.
So, for the following:
```
<div class="first-container">...</div>
<div class="second-container">
<div ...>
<div class="fixed-div> some text</div>
<... /div>
</div>
```
And styles:
```
.first-container {
position:relative;
z-index: 100;
width: 100%;
height: 10%;
}
.second-container {
position:relative;
z-index: 1000;
width: 100%;
height: 90%;
overflow: auto;
}
.fixed-div {
position: fixed;
z-index: 10000;
height: 110%;
}
```
**the following actually happens (Chrome only, firefox works as expected)**
The 'fixed-div' **is behind** the 'first-container', even though both 'fixed-div' and its container's ('second-container') z-index value is greater than 'first-container'.
The reason for this is Chrome always enforce boundaries within a container that enforces overflow **even though** one of its successors might have a **fixed** position.
I guess you can find a twisted logic for that... I can't - since the only reason for using fixed position is to enable 'on-top-of-everything' behavior.
So bug it is... | I know this is now resolved but posted solution didn't work for me. Here is what resolved my problem:
```
<act:AutoCompleteExtender ID="ace" runat="server" OnClientShown="clientShown">
</act:AutoCompleteExtender>
<script language="javascript" type="text/javascript">
function clientShown(ctl, args) {
ctl._completionListElement.style.zIndex = 99999;
}
</script>
``` |
6,365,448 | As per the title, it seems only Chrome isn't playign along. Note that form fields cannot be clicked on which are on the left portion of the screen. This only occurs on some pages (such as the Contact page). It appears that the #left\_outer div is overlaying the content. When I edit the css via Firebug or Chrome's dev toools, it works, when I edit the actual css and refresh, it does not.
Any ideas?
**LINK:**
Thanks! | 2011/06/15 | [
"https://Stackoverflow.com/questions/6365448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262374/"
] | Without a link to look at, it's a bit tough to see what the problem might be.
Do you have a `z-index: -1;` anywhere (a negative number is the key here, doesn't matter the number)?
I have found in the past this renders the container void from being interacted with.
Good luck! | I know this is now resolved but posted solution didn't work for me. Here is what resolved my problem:
```
<act:AutoCompleteExtender ID="ace" runat="server" OnClientShown="clientShown">
</act:AutoCompleteExtender>
<script language="javascript" type="text/javascript">
function clientShown(ctl, args) {
ctl._completionListElement.style.zIndex = 99999;
}
</script>
``` |
6,365,448 | As per the title, it seems only Chrome isn't playign along. Note that form fields cannot be clicked on which are on the left portion of the screen. This only occurs on some pages (such as the Contact page). It appears that the #left\_outer div is overlaying the content. When I edit the css via Firebug or Chrome's dev toools, it works, when I edit the actual css and refresh, it does not.
Any ideas?
**LINK:**
Thanks! | 2011/06/15 | [
"https://Stackoverflow.com/questions/6365448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262374/"
] | I had a weird issue with zIndex on Chrome and I kept fiddling with the position attribute to see if anything worked. But, it didn't. Turns out, in my case, the issue was with the transform attribute. So, if you have a transform attribute in place, disable it and it should be fine. Other browsers work fine with stuff like that, but Chrome seems to play it differently.
Hope this helped you. | Google Chrome to 84.0.4147.135 (Official Build) (64-bit) 2020-02-22.
Since my last update, CSS element z-index is broken in Chrome.
Chrome added "z-index: 1;" to the BODY element.
It now wrongly displays all z-index: ?; values in the BODY child elements.
Setting the position, z-index of BODY does not solve the problem.
Changing z-index values of child elements that were already correct does not help.
I hope this issue will be fixed, it is only broken since I updated Chrome.
Chrome 84.0.4147.135 bug on [www.eatme.pro/music](http://www.eatme.pro/music) - screen smaller than 500 px - push play - appearing bottom bar #lblBottomBarLink with z-index 5 is displayed under menu with z-index 2
(see image)
[image eatme.pro/music in Chrome 84.0.4147.135 with z-index 5 under z-index 2](https://i.stack.imgur.com/HIAD8.jpg) |
6,365,448 | As per the title, it seems only Chrome isn't playign along. Note that form fields cannot be clicked on which are on the left portion of the screen. This only occurs on some pages (such as the Contact page). It appears that the #left\_outer div is overlaying the content. When I edit the css via Firebug or Chrome's dev toools, it works, when I edit the actual css and refresh, it does not.
Any ideas?
**LINK:**
Thanks! | 2011/06/15 | [
"https://Stackoverflow.com/questions/6365448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262374/"
] | Without a link to look at, it's a bit tough to see what the problem might be.
Do you have a `z-index: -1;` anywhere (a negative number is the key here, doesn't matter the number)?
I have found in the past this renders the container void from being interacted with.
Good luck! | I had a weird issue with zIndex on Chrome and I kept fiddling with the position attribute to see if anything worked. But, it didn't. Turns out, in my case, the issue was with the transform attribute. So, if you have a transform attribute in place, disable it and it should be fine. Other browsers work fine with stuff like that, but Chrome seems to play it differently.
Hope this helped you. |
6,365,448 | As per the title, it seems only Chrome isn't playign along. Note that form fields cannot be clicked on which are on the left portion of the screen. This only occurs on some pages (such as the Contact page). It appears that the #left\_outer div is overlaying the content. When I edit the css via Firebug or Chrome's dev toools, it works, when I edit the actual css and refresh, it does not.
Any ideas?
**LINK:**
Thanks! | 2011/06/15 | [
"https://Stackoverflow.com/questions/6365448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262374/"
] | Markt's answer (see first answer) is great and this is the "by definition" of the z-index property.
Chrome's specific issue are usually related to the overflow property from the top container bottom.
So, for the following:
```
<div class="first-container">...</div>
<div class="second-container">
<div ...>
<div class="fixed-div> some text</div>
<... /div>
</div>
```
And styles:
```
.first-container {
position:relative;
z-index: 100;
width: 100%;
height: 10%;
}
.second-container {
position:relative;
z-index: 1000;
width: 100%;
height: 90%;
overflow: auto;
}
.fixed-div {
position: fixed;
z-index: 10000;
height: 110%;
}
```
**the following actually happens (Chrome only, firefox works as expected)**
The 'fixed-div' **is behind** the 'first-container', even though both 'fixed-div' and its container's ('second-container') z-index value is greater than 'first-container'.
The reason for this is Chrome always enforce boundaries within a container that enforces overflow **even though** one of its successors might have a **fixed** position.
I guess you can find a twisted logic for that... I can't - since the only reason for using fixed position is to enable 'on-top-of-everything' behavior.
So bug it is... | I had a weird issue with zIndex on Chrome and I kept fiddling with the position attribute to see if anything worked. But, it didn't. Turns out, in my case, the issue was with the transform attribute. So, if you have a transform attribute in place, disable it and it should be fine. Other browsers work fine with stuff like that, but Chrome seems to play it differently.
Hope this helped you. |
54,174 | Lately I've started learning some basic music theory and I have been trying to rationalize some of the interesting chords I have heard of from famous pieces. Here is an example of which I am not sure if my understanding is correct.
Below are bar 11-12 from Mozart's Piano Sonata No.11 in A major, K.331. I have marked the chords using Roman numeral notations.
[](https://i.stack.imgur.com/Px8LY.png)
The blue text shows a naive marking. To me the ♯iv° chord gives a warm and sweet shifting feeling. I found that if I think of it as an applied chord (by tonicizing V) then the last three chords becomes a (vii° - IV - I) progression. If this is the case I was wondering how come the IV chord, as a pre-dominant chord, appears *after* the dominant chord vii° instead of before it? Why would the progression still sound inevitable when the strong dominant -> tonic progression is broken?
---
Per @Dekkadeci's answer I revised the analysis as follows. The final three-chord progression simultaneously resolves two tension (cadential I chord to V, and on the V scale, dominant vii° to tonic I.
[](https://i.stack.imgur.com/mf2pZ.png) | 2017/03/08 | [
"https://music.stackexchange.com/questions/54174",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37541/"
] | You ask how to rationalise the progression. Here's how. It's a bare-bones B7, the dominant of the following chord, E, to which it resolves, delayed by a suspension. There's no room for all the notes of B7 in 3-part texture, but that's no reason to analyse it as something unnecessarily complicated. | I'm not exactly qualified to give you the classical language answer but conceptually I hope I point you in the right direction. I had to look up the difference between an appogiatura, a suspension etc. etc. In Jazz we tend to call all resolving non chord tones suspensions, but I'm pretty sure in classical music a suspension has to come directly from the previous chord rather than be just any resolving non chord tone (which I believe in classical is strictly an "apogiatura".) I could be wrong with my terminology here, but hopefully that won't bog you down; the point is I'm talking about resolving non-chord tones!
Anyway, you are right that the diminished chord is absolutely tonicizing the V. The reason the A chord in its second inversion works here is that it ends up sounding like a suspended E chord, rather than an A chord.
The diminished chord resolves to the E in the bass, and then the the A and C# are apogiatura that resolve downwards to an E chord (it has a certain plagal cadence feel to it, but it's really an apogiatura.). To give an example without modulation, check this crappy midi thing I just whipped up <http://onlinesequencer.net/425519> . It's progression ending in a perfect cadence in A, but the ending I chord has resolving D and F# in it.
To illustrate the point, I added an F# apogiatura to the passage you gave. <http://onlinesequencer.net/425524>. The point is, an F# obviously isn't in an A chord, but doesn't sound at all out of place here; it's performing the same function as the A and the C# resolving downwards to the E chord.
You could also put a B above the E in the bass and not change the harmony (although it's a bit of an ugly voicing). |
54,174 | Lately I've started learning some basic music theory and I have been trying to rationalize some of the interesting chords I have heard of from famous pieces. Here is an example of which I am not sure if my understanding is correct.
Below are bar 11-12 from Mozart's Piano Sonata No.11 in A major, K.331. I have marked the chords using Roman numeral notations.
[](https://i.stack.imgur.com/Px8LY.png)
The blue text shows a naive marking. To me the ♯iv° chord gives a warm and sweet shifting feeling. I found that if I think of it as an applied chord (by tonicizing V) then the last three chords becomes a (vii° - IV - I) progression. If this is the case I was wondering how come the IV chord, as a pre-dominant chord, appears *after* the dominant chord vii° instead of before it? Why would the progression still sound inevitable when the strong dominant -> tonic progression is broken?
---
Per @Dekkadeci's answer I revised the analysis as follows. The final three-chord progression simultaneously resolves two tension (cadential I chord to V, and on the V scale, dominant vii° to tonic I.
[](https://i.stack.imgur.com/mf2pZ.png) | 2017/03/08 | [
"https://music.stackexchange.com/questions/54174",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37541/"
] | >
> If this is the case I was wondering how come the IV chord, as a pre-dominant chord, appears after the dominant chord vii° instead of before it? Why would the progression still sound inevitable when the strong dominant -> tonic progression is broken?
>
>
>
Due to the E as a root instead of an A, the second last chord is not formally a I or a plain IV/V chord, but it is actually a I 6/4 chord. The I 6/4 chord is treated as a pre-dominant chord that must be immediately followed by a dominant-function chord (often V, just like the last chord). Its pre-dominant function is so strong that one of the theory books I was told to use in harmony class labels it as V 6/4 instead.
(I also believe that the "#iv° 6" is actually vii° 6 of V.) | I'm not exactly qualified to give you the classical language answer but conceptually I hope I point you in the right direction. I had to look up the difference between an appogiatura, a suspension etc. etc. In Jazz we tend to call all resolving non chord tones suspensions, but I'm pretty sure in classical music a suspension has to come directly from the previous chord rather than be just any resolving non chord tone (which I believe in classical is strictly an "apogiatura".) I could be wrong with my terminology here, but hopefully that won't bog you down; the point is I'm talking about resolving non-chord tones!
Anyway, you are right that the diminished chord is absolutely tonicizing the V. The reason the A chord in its second inversion works here is that it ends up sounding like a suspended E chord, rather than an A chord.
The diminished chord resolves to the E in the bass, and then the the A and C# are apogiatura that resolve downwards to an E chord (it has a certain plagal cadence feel to it, but it's really an apogiatura.). To give an example without modulation, check this crappy midi thing I just whipped up <http://onlinesequencer.net/425519> . It's progression ending in a perfect cadence in A, but the ending I chord has resolving D and F# in it.
To illustrate the point, I added an F# apogiatura to the passage you gave. <http://onlinesequencer.net/425524>. The point is, an F# obviously isn't in an A chord, but doesn't sound at all out of place here; it's performing the same function as the A and the C# resolving downwards to the E chord.
You could also put a B above the E in the bass and not change the harmony (although it's a bit of an ugly voicing). |
54,174 | Lately I've started learning some basic music theory and I have been trying to rationalize some of the interesting chords I have heard of from famous pieces. Here is an example of which I am not sure if my understanding is correct.
Below are bar 11-12 from Mozart's Piano Sonata No.11 in A major, K.331. I have marked the chords using Roman numeral notations.
[](https://i.stack.imgur.com/Px8LY.png)
The blue text shows a naive marking. To me the ♯iv° chord gives a warm and sweet shifting feeling. I found that if I think of it as an applied chord (by tonicizing V) then the last three chords becomes a (vii° - IV - I) progression. If this is the case I was wondering how come the IV chord, as a pre-dominant chord, appears *after* the dominant chord vii° instead of before it? Why would the progression still sound inevitable when the strong dominant -> tonic progression is broken?
---
Per @Dekkadeci's answer I revised the analysis as follows. The final three-chord progression simultaneously resolves two tension (cadential I chord to V, and on the V scale, dominant vii° to tonic I.
[](https://i.stack.imgur.com/mf2pZ.png) | 2017/03/08 | [
"https://music.stackexchange.com/questions/54174",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37541/"
] | >
> If this is the case I was wondering how come the IV chord, as a pre-dominant chord, appears after the dominant chord vii° instead of before it? Why would the progression still sound inevitable when the strong dominant -> tonic progression is broken?
>
>
>
Due to the E as a root instead of an A, the second last chord is not formally a I or a plain IV/V chord, but it is actually a I 6/4 chord. The I 6/4 chord is treated as a pre-dominant chord that must be immediately followed by a dominant-function chord (often V, just like the last chord). Its pre-dominant function is so strong that one of the theory books I was told to use in harmony class labels it as V 6/4 instead.
(I also believe that the "#iv° 6" is actually vii° 6 of V.) | You ask how to rationalise the progression. Here's how. It's a bare-bones B7, the dominant of the following chord, E, to which it resolves, delayed by a suspension. There's no room for all the notes of B7 in 3-part texture, but that's no reason to analyse it as something unnecessarily complicated. |
54,174 | Lately I've started learning some basic music theory and I have been trying to rationalize some of the interesting chords I have heard of from famous pieces. Here is an example of which I am not sure if my understanding is correct.
Below are bar 11-12 from Mozart's Piano Sonata No.11 in A major, K.331. I have marked the chords using Roman numeral notations.
[](https://i.stack.imgur.com/Px8LY.png)
The blue text shows a naive marking. To me the ♯iv° chord gives a warm and sweet shifting feeling. I found that if I think of it as an applied chord (by tonicizing V) then the last three chords becomes a (vii° - IV - I) progression. If this is the case I was wondering how come the IV chord, as a pre-dominant chord, appears *after* the dominant chord vii° instead of before it? Why would the progression still sound inevitable when the strong dominant -> tonic progression is broken?
---
Per @Dekkadeci's answer I revised the analysis as follows. The final three-chord progression simultaneously resolves two tension (cadential I chord to V, and on the V scale, dominant vii° to tonic I.
[](https://i.stack.imgur.com/mf2pZ.png) | 2017/03/08 | [
"https://music.stackexchange.com/questions/54174",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37541/"
] | You ask how to rationalise the progression. Here's how. It's a bare-bones B7, the dominant of the following chord, E, to which it resolves, delayed by a suspension. There's no room for all the notes of B7 in 3-part texture, but that's no reason to analyse it as something unnecessarily complicated. | The second chord could easily be the leading tone chord with the E functioning like an escape tone. That big jump up and the step down is typical of an escape tone.
The d sharp that resolves to an e in bar two gives the very real impression of a leading tone resolving, Im thinking E major. The notes in the top two voices of the last beat just look like suspensions from the previous beat |
54,174 | Lately I've started learning some basic music theory and I have been trying to rationalize some of the interesting chords I have heard of from famous pieces. Here is an example of which I am not sure if my understanding is correct.
Below are bar 11-12 from Mozart's Piano Sonata No.11 in A major, K.331. I have marked the chords using Roman numeral notations.
[](https://i.stack.imgur.com/Px8LY.png)
The blue text shows a naive marking. To me the ♯iv° chord gives a warm and sweet shifting feeling. I found that if I think of it as an applied chord (by tonicizing V) then the last three chords becomes a (vii° - IV - I) progression. If this is the case I was wondering how come the IV chord, as a pre-dominant chord, appears *after* the dominant chord vii° instead of before it? Why would the progression still sound inevitable when the strong dominant -> tonic progression is broken?
---
Per @Dekkadeci's answer I revised the analysis as follows. The final three-chord progression simultaneously resolves two tension (cadential I chord to V, and on the V scale, dominant vii° to tonic I.
[](https://i.stack.imgur.com/mf2pZ.png) | 2017/03/08 | [
"https://music.stackexchange.com/questions/54174",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37541/"
] | >
> If this is the case I was wondering how come the IV chord, as a pre-dominant chord, appears after the dominant chord vii° instead of before it? Why would the progression still sound inevitable when the strong dominant -> tonic progression is broken?
>
>
>
Due to the E as a root instead of an A, the second last chord is not formally a I or a plain IV/V chord, but it is actually a I 6/4 chord. The I 6/4 chord is treated as a pre-dominant chord that must be immediately followed by a dominant-function chord (often V, just like the last chord). Its pre-dominant function is so strong that one of the theory books I was told to use in harmony class labels it as V 6/4 instead.
(I also believe that the "#iv° 6" is actually vii° 6 of V.) | The second chord could easily be the leading tone chord with the E functioning like an escape tone. That big jump up and the step down is typical of an escape tone.
The d sharp that resolves to an e in bar two gives the very real impression of a leading tone resolving, Im thinking E major. The notes in the top two voices of the last beat just look like suspensions from the previous beat |
39,640,684 | I have these in my header rather than under the body as it said bootstrap needs jQuery to run:
```
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
```
And this is the actual navbar part. I'm pretty sure something is missing but can't see what i'm doing wrong:
```
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed navbar-right " data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</div>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li id="button0"><a href="#landing-page">Home</a></li>
<li id="button1"><a href="#what-we-do">What We Do</a></li>
<li id="button2"><a href="#contact">Contact Us</a></li>
</div>
</ul>
</div>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
``` | 2016/09/22 | [
"https://Stackoverflow.com/questions/39640684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6864067/"
] | HTML Some Unwanted div change HTML
```
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed navbar-right " data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<div class="navbar-collapse">
<ul class="nav navbar-nav">
<li id="button0"><a href="#landing-page">Home</a></li>
<li id="button1"><a href="#what-we-do">What We Do</a></li>
<li id="button2"><a href="#contact">Contact Us</a></li>
</ul>
</div>
</div>
</nav>
```
<https://jsfiddle.net/o6p71fko/1/> | 1. do not include jQuery twice (you have version 3.1.0 and 1.8.3)
2. Include bootstrap CSS
3. Include bootstrap-collapse plugin: <https://getbootstrap.com/javascript/#collapse> |
39,640,684 | I have these in my header rather than under the body as it said bootstrap needs jQuery to run:
```
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
```
And this is the actual navbar part. I'm pretty sure something is missing but can't see what i'm doing wrong:
```
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed navbar-right " data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</div>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li id="button0"><a href="#landing-page">Home</a></li>
<li id="button1"><a href="#what-we-do">What We Do</a></li>
<li id="button2"><a href="#contact">Contact Us</a></li>
</div>
</ul>
</div>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
``` | 2016/09/22 | [
"https://Stackoverflow.com/questions/39640684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6864067/"
] | HTML Some Unwanted div change HTML
```
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed navbar-right " data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<div class="navbar-collapse">
<ul class="nav navbar-nav">
<li id="button0"><a href="#landing-page">Home</a></li>
<li id="button1"><a href="#what-we-do">What We Do</a></li>
<li id="button2"><a href="#contact">Contact Us</a></li>
</ul>
</div>
</div>
</nav>
```
<https://jsfiddle.net/o6p71fko/1/> | You have added two div with navbar-collapse collapse classes, remove the inner one before ul.
**See Demo**
```html
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed navbar-right " data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li id="button0"><a href="#landing-page">Home</a></li>
<li id="button1"><a href="#what-we-do">What We Do</a></li>
<li id="button2"><a href="#contact">Contact Us</a></li>
</ul>
</div><!-- /.container-fluid -->
</nav>
``` |
39,640,684 | I have these in my header rather than under the body as it said bootstrap needs jQuery to run:
```
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
```
And this is the actual navbar part. I'm pretty sure something is missing but can't see what i'm doing wrong:
```
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed navbar-right " data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</div>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li id="button0"><a href="#landing-page">Home</a></li>
<li id="button1"><a href="#what-we-do">What We Do</a></li>
<li id="button2"><a href="#contact">Contact Us</a></li>
</div>
</ul>
</div>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
``` | 2016/09/22 | [
"https://Stackoverflow.com/questions/39640684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6864067/"
] | HTML Some Unwanted div change HTML
```
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed navbar-right " data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<div class="navbar-collapse">
<ul class="nav navbar-nav">
<li id="button0"><a href="#landing-page">Home</a></li>
<li id="button1"><a href="#what-we-do">What We Do</a></li>
<li id="button2"><a href="#contact">Contact Us</a></li>
</ul>
</div>
</div>
</nav>
```
<https://jsfiddle.net/o6p71fko/1/> | Remove the div on line 17 and its closing tag. Also, remove the extra closing divs on line 11 and 22.
```
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed navbar-right " data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li id="button0"><a href="#landing-page">Home</a></li>
<li id="button1"><a href="#what-we-do">What We Do</a></li>
<li id="button2"><a href="#contact">Contact Us</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
``` |
18,514,346 | im very new to C# and ASP.Net. Does anybody know how to create a popup in Asp?
My scenario:
When I click on a button, it checks some states. If a condition is being fulfilled a popup shall be thrown due to the state (here: achieved percentages).
So 2 invidual Popup Windows shall be thrown by clicking the same button.
>
> (Do you want to abort the contract, which wasn't completed? Yes - No)
>
>
> (Do you want to completed the contract, which hasn't achieved the target? Yes - No)
>
>
>
So the dialog boxes shall appear according for the same button when the condition was fullfilled.
Can anybody help me? (Code behind in C# and javascript?) | 2013/08/29 | [
"https://Stackoverflow.com/questions/18514346",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2729782/"
] | Hmm. Well, first of all,this code is probably so heavily I/O bound that optimizing anything but disk access is probably inconsequential. You might try throwing a pointless loop to 1000 before every if-test just to see how much difference that makes.
It doesn't appear like indexing would help you here, since you must access all the data when a value isn't specified, but if you are computing aggregates then caching those might help. [Intersystem's DeepSee](http://docs.intersystems.com/cache20101/csp/docbook/DocBook.UI.Page.cls?KEY=SETDeepSee) product is designed for that.
But it sounds like maybe you are just running a big report printing all the data, and want to optimize what you can. In that case, I think your solution does that. As far as elegance, well, it usually isn't found in conjunction with heavy optimization. The problem with generalizing a solution is that it's usually slower than a tailored solution.
I think possibly using tags and goto statements, while much harder to read, might run a little faster than your solution - if you think it's worth it. The fact that Intersystems does tags and gotos in their compiled SQL routines makes me think it's likely the fastest option. I haven't measured the difference, but I suppose Intersystems probably has. If you really need speed then you should try different approaches and measure the speed. Be sure to test with warm and cold routine and global caches.
As far as a general solution, you could, if you really wanted to, write something that *generates* code similar to what you hand-coded, but can generate it for a general n level solution. You tell it about the levels and it generates the solution. That would be both general and fast - but I very much doubt that for this example it would be a good use of your time to write that general solution, since hand-coding is pretty trivial and most likely not that common. | You are going in right direction with your proposed answer, but I would change it slightly to avoid using xecute (xecute and performance rarely play well) and make overall architecture a bit better.
Instead of deciding what to do in main routine and passing in only needed parameters, pass in all parameters and decide what you need to do in subroutine itself.
So your code will become:
```
GatherData(...)
set date=fromDate-1,status=""
for {
set status=$order(^GLOBAL(status)) quit:status=""
for {
set date=$order(^GLOBAL(status,date)) quit:((date>toDate)||(date=""))
do LoopThroughRegions(status,date,state,region,street,.dataCollection)
}
}
quit
LoopThroughRegions(status,date,state,region,street,dataCollection)
if region'="" {
do LoopThroughStreets(status,date,state,region,street,.dataCollection)
quit
}
set currentRegion=""
for {
set currentRegion=$order(^GLOBAL(status,date,region,currentRegion)) quit:currentRegion=""
do LoopThroughStreets(status,date,state,currentRegion,street,.dataCollection)
}
quit
LoopThroughStreets(status,date,state,region,street,dataCollection)
if street'="" {
do LoopThroughData(status,date,state,region,street,dataCollection)
quit
}
set currentStreet=""
for{
set currentStreet=$order(^GLOBAL(status,date,state,region,currentStreet)) quit:currentStreet=""
do LoopThroughData(status,date,state,region,currentStreet,.dataCollection)
}
quit
LoopThroughData(status,date,state,region,street,dataCollection)
set dataItem=""
for{
set dataItem=$order(^GLOBAL(status,date,state,region,street,dataItem)) quit:dataItem=""
// Do stuff
}
quit
```
I would also recommend to change these small subroutines to private procedures. |
18,514,346 | im very new to C# and ASP.Net. Does anybody know how to create a popup in Asp?
My scenario:
When I click on a button, it checks some states. If a condition is being fulfilled a popup shall be thrown due to the state (here: achieved percentages).
So 2 invidual Popup Windows shall be thrown by clicking the same button.
>
> (Do you want to abort the contract, which wasn't completed? Yes - No)
>
>
> (Do you want to completed the contract, which hasn't achieved the target? Yes - No)
>
>
>
So the dialog boxes shall appear according for the same button when the condition was fullfilled.
Can anybody help me? (Code behind in C# and javascript?) | 2013/08/29 | [
"https://Stackoverflow.com/questions/18514346",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2729782/"
] | I have come up with a solution that works well for me. This might not be the perfect I was initially looking for, but it works for me for these reasons:
1. When I'm done with this work other programmers will periodically work on the reports and I want to make their life as easy as possible in this regard.
2. A report-generator will be nice, but not the most productive thing to do at the moment.
I believe my solution is fairly easy to read and maintain without sacrificing too much performance:
```
GatherData
set command="do LoopThroughRegions(status,date,state,.dataCollection)"
if ($length(street)>0){
set command="do LoopThroughData(status,date,state,region,street,.dataCollection)"
} elseif ($length(region)>0){
set command="do LoopThroughStreets(status,date,state,region,.dataCollection)"
}
set date=fromDate-1,status=""
for{
set status=$order(^GLOBAL(status)) quit:status=""
for{
set date=$order(^GLOBAL(status,date)) quit:((date>toDate)||(date=""))
xecute (command)
}
}
quit
LoopThroughRegions(status,date,state,dataCollection)
set currentRegion=""
for{
set currentRegion=$order(^GLOBAL(status,date,region,currentRegion)) quit:currentRegion=""
do LoopThroughStreets(status,date,state,currentRegion,.dataCollection)
}
quit
LoopThroughStreets(status,date,state,region,dataCollection)
set currentStreet=""
for{
set currentStreet=$order(^GLOBAL(status,date,state,region,currentStreet)) quit:currentStreet=""
do LoopThroughData(status,date,state,region,currentStreet,.dataCollection)
}
quit
LoopThroughData(status,date,state,region,street,dataCollection)
set dataItem=""
for{
set dataItem=$order(^GLOBAL(status,date,state,region,street,dataItem)) quit:dataItem=""
// Do stuff
}
quit
```
Unless a better solution is provided I will select my own answer for future reference. Hopefully it might even help someone else as well. | You are going in right direction with your proposed answer, but I would change it slightly to avoid using xecute (xecute and performance rarely play well) and make overall architecture a bit better.
Instead of deciding what to do in main routine and passing in only needed parameters, pass in all parameters and decide what you need to do in subroutine itself.
So your code will become:
```
GatherData(...)
set date=fromDate-1,status=""
for {
set status=$order(^GLOBAL(status)) quit:status=""
for {
set date=$order(^GLOBAL(status,date)) quit:((date>toDate)||(date=""))
do LoopThroughRegions(status,date,state,region,street,.dataCollection)
}
}
quit
LoopThroughRegions(status,date,state,region,street,dataCollection)
if region'="" {
do LoopThroughStreets(status,date,state,region,street,.dataCollection)
quit
}
set currentRegion=""
for {
set currentRegion=$order(^GLOBAL(status,date,region,currentRegion)) quit:currentRegion=""
do LoopThroughStreets(status,date,state,currentRegion,street,.dataCollection)
}
quit
LoopThroughStreets(status,date,state,region,street,dataCollection)
if street'="" {
do LoopThroughData(status,date,state,region,street,dataCollection)
quit
}
set currentStreet=""
for{
set currentStreet=$order(^GLOBAL(status,date,state,region,currentStreet)) quit:currentStreet=""
do LoopThroughData(status,date,state,region,currentStreet,.dataCollection)
}
quit
LoopThroughData(status,date,state,region,street,dataCollection)
set dataItem=""
for{
set dataItem=$order(^GLOBAL(status,date,state,region,street,dataItem)) quit:dataItem=""
// Do stuff
}
quit
```
I would also recommend to change these small subroutines to private procedures. |
4,950,396 | We are getting a CommunicationsException (from DBCP) after iding for a while (a few hours). The error message (in the Exception) is at the end of this question - but I dont see wait\_timeout defined in any of the configuration files. (Where should we look? Somewhere out of the tomcat/conf directory?).
Secondly, as suggested by the Exception, where does one put the "Connector/J connection property 'autoReconnect=true'"? Here is the resource definition in the file conf/context.xml in tomcat set up:
```
<Resource name="jdbc/TomcatResourceName" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
username="xxxx" password="yyyy"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1:3306/dbname?autoReconnect=true"/>
```
Thirdly, why does the JVM wait till the call to executeQuery() to throw the Exception? If the connection has timed out, the getConnection method should throw the Exception, shouldn't it? This is the section of the source code I am talking about:
```
try {
conn = getConnection (true);
stmt = conn.createStatement (ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
rset = stmt.executeQuery (bQuery);
while (rset.next()) {
....
```
Finally, here are the 1st few lines of the Stack trace...
```
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 84,160,724 milliseconds ago. The last packet sent successfully to the server was 84,160,848 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3291)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1938)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2107)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2642)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2571)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1451)
at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
```
These are the reasons some of us are thinking "forget dbcp, it may be so dependent on IDE configurations and under-the-hood magic that DriverManager.getConnection(...) may be more reliable". Any comments on that? Thank you for your insights, - MS | 2011/02/09 | [
"https://Stackoverflow.com/questions/4950396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/580796/"
] | Since DBCP keeps returned mysql connections open for upcoming connection requests, they fall victims to the [MySQL Server timeout](http://dev.mysql.com/doc/refman/5.0/en/gone-away.html).
DBCP has a number of features that can help (can be used starting with Tomcat 5.5 IIRC).
```
validationQuery="SELECT 1"
testOnBorrow="true"
```
The validation makes sure that a connection is valid before returning it to a webapp executing the 'borrow' method. The flag of course, enables this feature.
If the timeout (8 hours I believe) is elapsed and the connection is dead, then a new connection is tested (if there are none anymore, it is created) and provided to the webapp.
Other possible approaches:
1. use the `testWhileIdle="true"` DBCP in your resource settings to also check idle connections before an effective request is detected.
2. Use the 'connectionProperties' to harden your MySQL connection (e.g. `autoReconnect/autoReconnectForPools=true`) | DBCP is not meant for use in production, even the authors say that (see this presentation: <http://www.infoq.com/presentations/Tuning-Tomcat-Mark-Thomas>).
I suggest taking a look at C3P0: <http://www.mchange.com/projects/c3p0/index.html> |
17,487,538 | i am working with Sencha touch application like multiple choice Questions Quiz.
in sencha touch there is model-store concept,but i want to use database like Sqlite for Questions and answers.
so, is there any way to use database in Sencha toch ?
or can we make queries for databas operation ?
any help will be appreciated.
thanks in advance. | 2013/07/05 | [
"https://Stackoverflow.com/questions/17487538",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1992254/"
] | Take a look at the [Filter menu customization](http://demos.kendoui.com/web/grid/filter-menu-customization.html) demo. It appears you would do something along these lines:
```
@(Html.Kendo()
.Grid<MyClass>()
.Name("grid")
.DataSource(data =>
data.Ajax()
.ServerOperation(false)
.Read(read =>
read.Action("MyAction", "MyController"))
)
.Columns(cols =>
{
cols.Bound(x => x.dt).Title("Date").Width(150);
cols.Bound(x => x.name).Title("Name").Width(250);
})
.Filterable(filterable => filterable
.Extra(false)
.Operators(ops => ops
.ForString(str => str.Clear()
.Contains("Contains")
.StartsWith("Starts with")
// any other filters you want in there
)))
.Sortable())
```
If I'm interpreting it correctly, the `str.Clear()` clears out the filters that exist so you'll be building your own from there. So if you don't think the client needs or wants the `.EndsWith` filter, for example, you would not include it here. | If you have source code open kendo solution and find
class name `StringOperators` under `Kendo.Mvc/UI/Grid/Settings`
In `Operators = new Dictionary<string, string>()`
change the order as you wish , reBuild the solution and then overwrite generated file in your project. |
89,052 | We read in Lk 4: 38-39 :
>
> After leaving the synagogue he entered Simon’s house. Now Simon’s mother-in-law was suffering from a high fever, and they asked him about her. Then he stood over her and rebuked the fever, and it left her.
>
>
>
Elsewhere, we see Jesus rebuking the evil spirit (Lk 9: 42). But it is doubtful if anyone who witnessed the healing believed that the fever of Simon's MiL had been caused by evil spirit. Even more doubtful is the existence of knowledge that it could have been caused by an animate thing say, virus . Even today, fever is more often than not, measured by the external symptom namely high temperature. Is it that Jesus rebuked the temperature which is an inanimate entity?
My question therefore is: **According to Catholic scholars, what exactly did Jesus rebuke while healing the mother-in-law of Simon?** | 2022/01/17 | [
"https://christianity.stackexchange.com/questions/89052",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/21496/"
] | **What exactly did Jesus rebuke while healing the mother-in-law of Simon?**
English translations vary and if you do not mind I would like to use another version than the one you used. Translation can make a big difference. Thus I will use the Douay-Rheims 1899 American Edition (DRA). After all it is a Catholic Catholic Bible.
>
> 38 And Jesus rising up out of the synagogue, went into Simon's house. And Simon's wife's mother was taken with a great fever, and they besought him for her.
>
>
> 39 And standing over her, he commanded the fever, and it left her. And immediately rising, she ministered to them. - [Luke 4:38-39](https://www.biblegateway.com/passage/?search=Luke%204%3A38-39&version=DRA)
>
>
>
Now it becomes abundantly clear that Jesus simply commanded the fever to leave Peter’s Mother-in-Law. It much more than a simply rebuke! The Divine Healer cured her!
I would simply like to add a few reflections of the Church Fathers on this passage.
>
> [**Commentary from the Church Fathers**](https://en.m.wikipedia.org/wiki/Healing_the_mother_of_Peter%27s_wife)
>
>
> * **Glossa Ordinaria**: And it is not enough that she is cured, but strength is given her besides, for she arose and ministered unto them.
> * **Chrysostom**: This, she arose and ministered unto them, shows at once the Lord's power, and the woman's feeling towards Christ.
> * **Bede**: Figuratively; Peter's house is the Law, or the circumcision, his mother-in-law the synagogue, which is as it were the mother of the Church committed to Peter. She is in a fever, that is, she is sick of zealous hate, and persecutes the Church. The Lord touches her hand, when He turns her carnal works to spiritual uses.[6]
> * **Saint Remigius**: Or by Peter's mother-in-law may be understood the Law, which according to the Apostle was made weak through the flesh, i. e. the carnal understanding. But when the Lord through the mystery of the Incarnation appeared visibly in the synagogue, and fulfilled the Law in action, and taught that it was to be understood spiritually; straightway it thus allied with the grace of the Gospel received such strength, that what had been the minister of death and punishment, became the minister of life and glory.
> * **Rabanus Maurus**: Or, every soul that struggles with fleshly lusts is sick of a fever, but touched with the hand of Divine mercy, it recovers health, and restrains the concupiscence of the flesh by the bridle of continence, and with those limbs with which it had served uncleanness, it now ministers to righteousness.
> * **Hilary of Poitiers**: Or; In Peter's wife's mother is shown the sickly condition of infidelity, to which freedom of will is near akin, being united by the bonds as it were of wedlock. By the Lord's entrance into Peter's house, that is into the body, unbelief is cured, which was before sick of the fever of sin, and ministers in duties of righteousness to the Saviour.
>
>
> | On September 1, 2021, Fr. Simon, on his show Father Simon Says on Relevant Radio, discussed this.
<https://relevantradio.com/2021/09/father-simon-says-september-1-2021-orthodox-musings/>
>
> All right, let's go to the word of the day! [gong]
>
>
> Very interestingly, Jesus goes from the synagogue to Simon Peter's
> house, and he stands over his mother-in-law, and rebuked the fever,
> and it left her.
>
>
> He rebuked a fever? That's very interesting.
>
>
> We see this in the scripture quite a bit. Moses was told to speak to
> the rock. Jesus rebukes a fever.
>
>
> Well, the word of the day is rebuke.
>
>
> The word in Greek is epitimaó. It can mean to honor. It means to
> measure out a due measure or to censure.
>
>
> I remember I had a buddy who was very pentecostal and he believed that
> you rebuke illness, and he came up to me one day and said "Fr. Simon,
> you got an aspirin? I been rebuking this headache all day long."
> [sigh] He should have just come and got the aspirin in the first
> place.
>
>
> This idea of rebuking a fever or speaking to a rock... Why do we do
> that? Because words do have power. What this really means is to esteem
> it suitably. It isn't just scaring the fever. It is speaking of the
> fever what the fever is. Jesus said "Fever, you've got no power around
> me."
>
>
> We need to do that, occasionally. I never drive by an adult bookstore
> without rebuking Satan.
>
>
> I think we need to get used to that, to speak to things -- it's
> biblical -- and to rebuke that thing when it's appropriate. "In
> Jesus's name, I rebuke this illness." That's something we don't do,
> but it's in the biblical bag of tricks. Try it some time.
>
>
> I remember for years I drove by this store -- I think it was on
> Western Avenue in Chicago -- and I rebuked the store. Eventually it
> turned into a candy shop. [laughs] I don't know if my rebuking had
> anything to do with it, but, well...
>
>
> We have a power in our faith that we never use. We have a power to
> bless, and we also have a power to curse. Use it wisely and sparingly.
> You don't curse people, but you can curse illness, you can curse sin,
> and you can tell the devil where to go. I'm not saying that when
> you're sick you're possessed, however, there is a continuum that
> relates, I think, all things that are evil, and we have this amazing
> right, and even duty, to rebuke things that are out of order.
>
>
> Just a thought, who knows.
>
>
> All right, let's go to phone calls.
>
>
> That was weird...
>
>
> |
180,382 | Which one is the correct way of asking this question? When?
a) Why you changed your job?
b) Why did you change your Job?
c) Let me know why you changed your job?
d) Let me know why did you change your job? | 2018/09/21 | [
"https://ell.stackexchange.com/questions/180382",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/4084/"
] | Not in Standard English. Main clause interrogatives like this require subject-auxiliary inversion: "Where did you bring all these vegetables from?" Note that the plain verb-form "bring" is required after the auxiliary verb "did".
(answer transcribed from comment) | The format of the question is not quite correct. You need to have:
* auxiliary verb + subject + verb
So, we would say:
>
> Where **did** (*aux verb*) **you** (*subject*) **bring** (*verb*) all these vegetables from?
>
>
> |
8,132,594 | While making a project with Makefile, I get this error:
```
error: implicit declaration of function ‘fatal’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
```
The `./configure --help` shows:
```
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-gtktest do not try to compile and run a test GTK+ program
--enable-debug Turn on debugging
```
How can I tell *configure* not to include [-Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror)? | 2011/11/15 | [
"https://Stackoverflow.com/questions/8132594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/859227/"
] | [Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror) is a GCC argument, and you cannot remove it directly via [./configure](https://en.wikipedia.org/wiki/Configure_script). Otherwise, an option like `--disable-error` would show up in the help text. However, it's possible.
Set an environment variable:
```
export CFLAGS="-Wno-error"
```
That's for C compilers. If the project uses C++, do:
```
export CXXFLAGS="-Wno-error"
```
In the very rare case the project does not honor this variables, your last resort is to edit the `configure.ac` file and search for `-Werror` and remove it from the string it occurs in (be careful though). | It seems like the feature has been in [autotools](https://en.wikipedia.org/wiki/GNU_Autotools) for many years:
```
./configure --disable-werror
```
Unfortunately, I wasn't able to get the following specific case to work:
```
./configure --enable-wno-error=unused-value
```
Maybe it could work if one escaped the '`=`' symbol, assuming it's possible. Like [skim says](https://stackoverflow.com/questions/8132594/disable-werror-in-configure-file/8282450#8282450), one can still use `CFLAGS` or `CXXFLAGS`. |
8,132,594 | While making a project with Makefile, I get this error:
```
error: implicit declaration of function ‘fatal’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
```
The `./configure --help` shows:
```
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-gtktest do not try to compile and run a test GTK+ program
--enable-debug Turn on debugging
```
How can I tell *configure* not to include [-Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror)? | 2011/11/15 | [
"https://Stackoverflow.com/questions/8132594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/859227/"
] | [Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror) is a GCC argument, and you cannot remove it directly via [./configure](https://en.wikipedia.org/wiki/Configure_script). Otherwise, an option like `--disable-error` would show up in the help text. However, it's possible.
Set an environment variable:
```
export CFLAGS="-Wno-error"
```
That's for C compilers. If the project uses C++, do:
```
export CXXFLAGS="-Wno-error"
```
In the very rare case the project does not honor this variables, your last resort is to edit the `configure.ac` file and search for `-Werror` and remove it from the string it occurs in (be careful though). | This works for me, compiling curlpp on [Lubuntu](https://en.wikipedia.org/wiki/Lubuntu) 16.10:
```
./configure --disable-ewarning
``` |
8,132,594 | While making a project with Makefile, I get this error:
```
error: implicit declaration of function ‘fatal’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
```
The `./configure --help` shows:
```
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-gtktest do not try to compile and run a test GTK+ program
--enable-debug Turn on debugging
```
How can I tell *configure* not to include [-Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror)? | 2011/11/15 | [
"https://Stackoverflow.com/questions/8132594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/859227/"
] | [Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror) is a GCC argument, and you cannot remove it directly via [./configure](https://en.wikipedia.org/wiki/Configure_script). Otherwise, an option like `--disable-error` would show up in the help text. However, it's possible.
Set an environment variable:
```
export CFLAGS="-Wno-error"
```
That's for C compilers. If the project uses C++, do:
```
export CXXFLAGS="-Wno-error"
```
In the very rare case the project does not honor this variables, your last resort is to edit the `configure.ac` file and search for `-Werror` and remove it from the string it occurs in (be careful though). | I had to use `--disable-Werror` (with an uppercase `W`) on my module. While [sudoman's answer above](https://stackoverflow.com/a/24481662/474034) suggests to use `--disable-werror` (with a lowercase `w`).
It may look like a typo, but it is actually dependent on your particular `configure` setup, especially if `configure` is generated by `autoconf`. What needs to be passed to the `configure` script to disable `Werror` depends on how the build system was setup.
If your project uses the [AX\_COMPILER\_FLAGS](https://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html) option from the `autoconf-archive` project, then by default `-Werror` is enabled.
In another module you may find something like this:
```
+AC_ARG_ENABLE([werror],
+ AC_HELP_STRING([--disable-werror],
+ [do not build with -Werror]),
```
And thus you would need to use `--disable-werror`. |
8,132,594 | While making a project with Makefile, I get this error:
```
error: implicit declaration of function ‘fatal’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
```
The `./configure --help` shows:
```
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-gtktest do not try to compile and run a test GTK+ program
--enable-debug Turn on debugging
```
How can I tell *configure* not to include [-Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror)? | 2011/11/15 | [
"https://Stackoverflow.com/questions/8132594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/859227/"
] | [Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror) is a GCC argument, and you cannot remove it directly via [./configure](https://en.wikipedia.org/wiki/Configure_script). Otherwise, an option like `--disable-error` would show up in the help text. However, it's possible.
Set an environment variable:
```
export CFLAGS="-Wno-error"
```
That's for C compilers. If the project uses C++, do:
```
export CXXFLAGS="-Wno-error"
```
In the very rare case the project does not honor this variables, your last resort is to edit the `configure.ac` file and search for `-Werror` and remove it from the string it occurs in (be careful though). | I ran into this problem, and it turned out that GCC ***was not installed*** on my freshly-started [EC2](https://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud) instance running [Ubuntu 20.04](https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_20.04_LTS_(Focal_Fossa)) (Focal Fossa).
Simply running `sudo apt install gcc` fixed this issue for me. |
8,132,594 | While making a project with Makefile, I get this error:
```
error: implicit declaration of function ‘fatal’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
```
The `./configure --help` shows:
```
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-gtktest do not try to compile and run a test GTK+ program
--enable-debug Turn on debugging
```
How can I tell *configure* not to include [-Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror)? | 2011/11/15 | [
"https://Stackoverflow.com/questions/8132594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/859227/"
] | It seems like the feature has been in [autotools](https://en.wikipedia.org/wiki/GNU_Autotools) for many years:
```
./configure --disable-werror
```
Unfortunately, I wasn't able to get the following specific case to work:
```
./configure --enable-wno-error=unused-value
```
Maybe it could work if one escaped the '`=`' symbol, assuming it's possible. Like [skim says](https://stackoverflow.com/questions/8132594/disable-werror-in-configure-file/8282450#8282450), one can still use `CFLAGS` or `CXXFLAGS`. | This works for me, compiling curlpp on [Lubuntu](https://en.wikipedia.org/wiki/Lubuntu) 16.10:
```
./configure --disable-ewarning
``` |
8,132,594 | While making a project with Makefile, I get this error:
```
error: implicit declaration of function ‘fatal’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
```
The `./configure --help` shows:
```
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-gtktest do not try to compile and run a test GTK+ program
--enable-debug Turn on debugging
```
How can I tell *configure* not to include [-Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror)? | 2011/11/15 | [
"https://Stackoverflow.com/questions/8132594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/859227/"
] | It seems like the feature has been in [autotools](https://en.wikipedia.org/wiki/GNU_Autotools) for many years:
```
./configure --disable-werror
```
Unfortunately, I wasn't able to get the following specific case to work:
```
./configure --enable-wno-error=unused-value
```
Maybe it could work if one escaped the '`=`' symbol, assuming it's possible. Like [skim says](https://stackoverflow.com/questions/8132594/disable-werror-in-configure-file/8282450#8282450), one can still use `CFLAGS` or `CXXFLAGS`. | I had to use `--disable-Werror` (with an uppercase `W`) on my module. While [sudoman's answer above](https://stackoverflow.com/a/24481662/474034) suggests to use `--disable-werror` (with a lowercase `w`).
It may look like a typo, but it is actually dependent on your particular `configure` setup, especially if `configure` is generated by `autoconf`. What needs to be passed to the `configure` script to disable `Werror` depends on how the build system was setup.
If your project uses the [AX\_COMPILER\_FLAGS](https://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html) option from the `autoconf-archive` project, then by default `-Werror` is enabled.
In another module you may find something like this:
```
+AC_ARG_ENABLE([werror],
+ AC_HELP_STRING([--disable-werror],
+ [do not build with -Werror]),
```
And thus you would need to use `--disable-werror`. |
8,132,594 | While making a project with Makefile, I get this error:
```
error: implicit declaration of function ‘fatal’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
```
The `./configure --help` shows:
```
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-gtktest do not try to compile and run a test GTK+ program
--enable-debug Turn on debugging
```
How can I tell *configure* not to include [-Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror)? | 2011/11/15 | [
"https://Stackoverflow.com/questions/8132594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/859227/"
] | It seems like the feature has been in [autotools](https://en.wikipedia.org/wiki/GNU_Autotools) for many years:
```
./configure --disable-werror
```
Unfortunately, I wasn't able to get the following specific case to work:
```
./configure --enable-wno-error=unused-value
```
Maybe it could work if one escaped the '`=`' symbol, assuming it's possible. Like [skim says](https://stackoverflow.com/questions/8132594/disable-werror-in-configure-file/8282450#8282450), one can still use `CFLAGS` or `CXXFLAGS`. | I ran into this problem, and it turned out that GCC ***was not installed*** on my freshly-started [EC2](https://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud) instance running [Ubuntu 20.04](https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_20.04_LTS_(Focal_Fossa)) (Focal Fossa).
Simply running `sudo apt install gcc` fixed this issue for me. |
8,132,594 | While making a project with Makefile, I get this error:
```
error: implicit declaration of function ‘fatal’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
```
The `./configure --help` shows:
```
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-gtktest do not try to compile and run a test GTK+ program
--enable-debug Turn on debugging
```
How can I tell *configure* not to include [-Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror)? | 2011/11/15 | [
"https://Stackoverflow.com/questions/8132594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/859227/"
] | I had to use `--disable-Werror` (with an uppercase `W`) on my module. While [sudoman's answer above](https://stackoverflow.com/a/24481662/474034) suggests to use `--disable-werror` (with a lowercase `w`).
It may look like a typo, but it is actually dependent on your particular `configure` setup, especially if `configure` is generated by `autoconf`. What needs to be passed to the `configure` script to disable `Werror` depends on how the build system was setup.
If your project uses the [AX\_COMPILER\_FLAGS](https://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html) option from the `autoconf-archive` project, then by default `-Werror` is enabled.
In another module you may find something like this:
```
+AC_ARG_ENABLE([werror],
+ AC_HELP_STRING([--disable-werror],
+ [do not build with -Werror]),
```
And thus you would need to use `--disable-werror`. | This works for me, compiling curlpp on [Lubuntu](https://en.wikipedia.org/wiki/Lubuntu) 16.10:
```
./configure --disable-ewarning
``` |
8,132,594 | While making a project with Makefile, I get this error:
```
error: implicit declaration of function ‘fatal’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
```
The `./configure --help` shows:
```
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-gtktest do not try to compile and run a test GTK+ program
--enable-debug Turn on debugging
```
How can I tell *configure* not to include [-Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror)? | 2011/11/15 | [
"https://Stackoverflow.com/questions/8132594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/859227/"
] | This works for me, compiling curlpp on [Lubuntu](https://en.wikipedia.org/wiki/Lubuntu) 16.10:
```
./configure --disable-ewarning
``` | I ran into this problem, and it turned out that GCC ***was not installed*** on my freshly-started [EC2](https://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud) instance running [Ubuntu 20.04](https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_20.04_LTS_(Focal_Fossa)) (Focal Fossa).
Simply running `sudo apt install gcc` fixed this issue for me. |
8,132,594 | While making a project with Makefile, I get this error:
```
error: implicit declaration of function ‘fatal’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
```
The `./configure --help` shows:
```
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-gtktest do not try to compile and run a test GTK+ program
--enable-debug Turn on debugging
```
How can I tell *configure* not to include [-Werror](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Werror)? | 2011/11/15 | [
"https://Stackoverflow.com/questions/8132594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/859227/"
] | I had to use `--disable-Werror` (with an uppercase `W`) on my module. While [sudoman's answer above](https://stackoverflow.com/a/24481662/474034) suggests to use `--disable-werror` (with a lowercase `w`).
It may look like a typo, but it is actually dependent on your particular `configure` setup, especially if `configure` is generated by `autoconf`. What needs to be passed to the `configure` script to disable `Werror` depends on how the build system was setup.
If your project uses the [AX\_COMPILER\_FLAGS](https://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html) option from the `autoconf-archive` project, then by default `-Werror` is enabled.
In another module you may find something like this:
```
+AC_ARG_ENABLE([werror],
+ AC_HELP_STRING([--disable-werror],
+ [do not build with -Werror]),
```
And thus you would need to use `--disable-werror`. | I ran into this problem, and it turned out that GCC ***was not installed*** on my freshly-started [EC2](https://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud) instance running [Ubuntu 20.04](https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_20.04_LTS_(Focal_Fossa)) (Focal Fossa).
Simply running `sudo apt install gcc` fixed this issue for me. |
15,769,521 | I ran the following code to install the underscore js module:
```
npm install -g underscore
```
I then tried to access it via the node console, but I get the following error:
```
node
> __ = require('underscore');
Error: Cannot find module 'underscore'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at repl:1:6
at REPLServer.self.eval (repl.js:109:21)
at rli.on.self.bufferedCmd (repl.js:258:20)
at REPLServer.self.eval (repl.js:116:5)
at Interface.<anonymous> (repl.js:248:12)
at Interface.EventEmitter.emit (events.js:96:17)
```
Why doesn't this example work? | 2013/04/02 | [
"https://Stackoverflow.com/questions/15769521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/89761/"
] | I don't really know why, but it fails indeed (when installing underscore globally, as you have done).
If you install it without -g, it should work (be careful, however, as '\_' is already used by Node REPL to hold the result of the last operation, as explained here:
[Using the Underscore module with Node.js](https://stackoverflow.com/questions/5691901/using-the-underscore-module-with-node-js?rq=1)
Do you really need to install it globally? | I just had the same problem
```
$ export NODE_PATH=/usr/local/share/npm/lib/node_modules
```
sorted it out for me; this obviously depends on your platform and where npm has installed it. Also, as mentioned in Javo's answer, don't name it \_ in the REPL. |
5,149,982 | after exporting to p.12 in MacOSX, can i run the following 3 step in Linux? Or i must get it done in the same machine where i export to P.12 before i upload to Linux server to use with my php script?
```
openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
``` | 2011/03/01 | [
"https://Stackoverflow.com/questions/5149982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/633765/"
] | ```
double dArray[][];
```
is Array-of-arrays while
```
double dArray[,];
```
is a two dimentional array.
it's easy enough to look them up.
[MSDN Reference link](http://msdn.microsoft.com/en-us/library/aa288453%28v=vs.71%29.aspx) | [See the official documentation](http://msdn.microsoft.com/en-us/library/2s05feca.aspx) (click on the *C#* tab). |
5,149,982 | after exporting to p.12 in MacOSX, can i run the following 3 step in Linux? Or i must get it done in the same machine where i export to P.12 before i upload to Linux server to use with my php script?
```
openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
``` | 2011/03/01 | [
"https://Stackoverflow.com/questions/5149982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/633765/"
] | ```
double dArray[][];
```
is Array-of-arrays while
```
double dArray[,];
```
is a two dimentional array.
it's easy enough to look them up.
[MSDN Reference link](http://msdn.microsoft.com/en-us/library/aa288453%28v=vs.71%29.aspx) | The last syntax is easy, it declares a multidimensional array of doubles. Imagine the array is 3x2, then there would be 6 doubles in the array.
The 1st syntax declares a jagged array. The second syntax is rectangular or square, but this syntax need not be. You could have three rows, followed by 3 columns, then 2 columns, then 1 column, ie: its jagged.
```
2nd: 1-1, 1-2, 1-3
2-1, 2-2, 2-3
1st: 1-1, 1-2, 1-3
2-1, 2-2,
3-1,
``` |
5,149,982 | after exporting to p.12 in MacOSX, can i run the following 3 step in Linux? Or i must get it done in the same machine where i export to P.12 before i upload to Linux server to use with my php script?
```
openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
``` | 2011/03/01 | [
"https://Stackoverflow.com/questions/5149982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/633765/"
] | ```
double dArray[][];
```
is Array-of-arrays while
```
double dArray[,];
```
is a two dimentional array.
it's easy enough to look them up.
[MSDN Reference link](http://msdn.microsoft.com/en-us/library/aa288453%28v=vs.71%29.aspx) | The first is an array of `double` arrays, meaning each separate element in `dArray` can contain a different number of doubles depending on the length of the array.
```
double[][] dArray = new double[3][];
dArray[0] = new double[3];
dArray[1] = new double[2];
dArray[2] = new double[4];
Index
0 1 2
----- ----- -----
L 1 | | | | | |
e ----- ----- -----
n 2 | | | | | |
g ----- ----- -----
t 3 | | | |
h ----- -----
4 | |
-----
```
The second is called a multidimensional array, and can be thought of as a matrix, like rows and columns.
```
double[,] dArray = new dArray[3, 3];
Column
0 1 2
-------------
0 | | | |
R -------------
o 1 | | | |
w -------------
2 | | | |
-------------
``` |
5,149,982 | after exporting to p.12 in MacOSX, can i run the following 3 step in Linux? Or i must get it done in the same machine where i export to P.12 before i upload to Linux server to use with my php script?
```
openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
``` | 2011/03/01 | [
"https://Stackoverflow.com/questions/5149982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/633765/"
] | The last syntax is easy, it declares a multidimensional array of doubles. Imagine the array is 3x2, then there would be 6 doubles in the array.
The 1st syntax declares a jagged array. The second syntax is rectangular or square, but this syntax need not be. You could have three rows, followed by 3 columns, then 2 columns, then 1 column, ie: its jagged.
```
2nd: 1-1, 1-2, 1-3
2-1, 2-2, 2-3
1st: 1-1, 1-2, 1-3
2-1, 2-2,
3-1,
``` | [See the official documentation](http://msdn.microsoft.com/en-us/library/2s05feca.aspx) (click on the *C#* tab). |
5,149,982 | after exporting to p.12 in MacOSX, can i run the following 3 step in Linux? Or i must get it done in the same machine where i export to P.12 before i upload to Linux server to use with my php script?
```
openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
``` | 2011/03/01 | [
"https://Stackoverflow.com/questions/5149982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/633765/"
] | The first is an array of `double` arrays, meaning each separate element in `dArray` can contain a different number of doubles depending on the length of the array.
```
double[][] dArray = new double[3][];
dArray[0] = new double[3];
dArray[1] = new double[2];
dArray[2] = new double[4];
Index
0 1 2
----- ----- -----
L 1 | | | | | |
e ----- ----- -----
n 2 | | | | | |
g ----- ----- -----
t 3 | | | |
h ----- -----
4 | |
-----
```
The second is called a multidimensional array, and can be thought of as a matrix, like rows and columns.
```
double[,] dArray = new dArray[3, 3];
Column
0 1 2
-------------
0 | | | |
R -------------
o 1 | | | |
w -------------
2 | | | |
-------------
``` | [See the official documentation](http://msdn.microsoft.com/en-us/library/2s05feca.aspx) (click on the *C#* tab). |
40,262,413 | I wanted to use CloudFlare for my website (hosted on Microsoft Azure).
I have added my domain to Cloudflare, and changed my domains nameservers to the ones I got from Cloudflare.
Furthermore, cloudflare imported my current DNS settings which are the following (my domain has been replaced with domain.com):
[](https://i.stack.imgur.com/Gnkgr.png)
I thought the migration would go smoothly, however, when I go to www.domain.com I get the error:
>
> The webpage at <http://www.domain.com/> might be temporarily down or
> it may have moved permanently to a new web address.
>
>
>
However, when I refresh a couple of times it finally loads the site.
If I go to domain.com (no www-prefix), I get the error:
>
> domain.com’s server DNS address could not be found.
>
>
>
What could be going on? | 2016/10/26 | [
"https://Stackoverflow.com/questions/40262413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6047390/"
] | For the first issue...if you are seeing inconsistent responses from your Azure Website, they you should raise an Azure support ticket.
For the second issue...try verifying the CLOUDFLARE DNS resolution via <http://digwebinterface.com>, both via a recursive DNS service and by querying against the CLOUDFLARE name servers directly. If the latter is working, there must be a problem in your DNS delegation (check name server settings with your registrar, try also a delegation validation service such as <http://dnscheck.pingdom.com/>). If the latter is not working, you'll need to take it up with CLOUDFLARE. | You need both @ and www CNAME specified in your host records. Not just www.
the refresh is normal after you make a dns change. The browser keeps the dns lookup in cache, so if you visit the site on another browser you won't have to do a refresh. Just clear your browser cache when you want to see dns changes, but some edits could take 15min or longer to see changes. |
443,268 | В анкетах и формах ввода данных часто встречаются следующие конструкции:
>
> Фамилия: Говоров.
>
>
> Пол: мужской.
>
>
> Образование: высшее.
>
>
> Телефон: 89151234567.
>
>
> Адрес: г. Москва, ул. Ленина, д. 1.
>
>
>
Каким членом предложения является слово после двоеточия? | 2018/08/05 | [
"https://rus.stackexchange.com/questions/443268",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/189895/"
] | В анкетах после двоеточия стоит сказуемое. Назван предмет и его признак, в этом случае предмет - это подлежащее, а признак - сказуемое. Такое определение есть у Розенталя: Сказуемое - главный член двусоставного предложения, выражающий признак предмета, названного подлежащим. Всё вроде сходится.
Цель урока: научиться решать задачи. Здесь то же самое: цель - подлежащее, научиться - сказуемое.
Если поставить тире, то получится обычное предложение, оформленное по правилам пунктуации.
Если поставить двоеточие, то получится пояснительный вариант этого же предложения с тем же значением, потому что двоеточие предупреждает о последующем пояснении.
Зачем говорить об определениях или еще как-то усложнять тему. Мы в любой момент можем остановиться и эту паузу обозначить двоеточием. Можно вспомнить пример с пропущенным обобщающим словом (на заседании присутствовали:). | Думаю, это вообще не есть полноценные предложения, потому и говорить о членах смысла нет. Интересно, в связи с чем такой вопрос? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.